Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 566

Přidáno uživatelem Michal Kliment před téměř 15 roky(ů)

U zobrazeni IP adres podsite se nyni zobrazuji i IP adresy VLAN rozhrani. Dale se zde vypisuje i nazev zarizeni, ke kteremu IP adresa patri.

Zobrazit rozdíly:

freenetis/trunk/kohana/application/models/ip_address.php
*/
public function get_ip_addresses_of_subnet($subnet_id)
{
return self::$db->query("SELECT
// old version without support of ip address of vlan ifaces
/*return self::$db->query("SELECT
ip.id, ip.ip_address, m.name, m.id AS mid
FROM ip_addresses ip
JOIN ifaces i ON i.id = ip.iface_id
......
JOIN members m ON m.id = u.member_id
WHERE ip.subnet_id = $subnet_id
ORDER BY inet_aton(ip.ip_address)
"); */
return self::$db->query("SELECT
q.id, q.ip_address, d.name AS device_name, m.name AS member_name, d.id AS did, m.id AS mid
FROM (SELECT
ip.id, ip.ip_address, IFNULL(ic1.device_id, ic2.device_id) as device_id
FROM ip_addresses ip
LEFT JOIN ifaces ic1 ON ip.iface_id = ic1.id
LEFT JOIN vlan_ifaces vic ON ip.vlan_iface_id = vic.id
LEFT JOIN ifaces ic2 ON vic.iface_id = ic2.id
WHERE ip.subnet_id = $subnet_id) AS q
LEFT JOIN devices d ON q.device_id = d.id
LEFT JOIN users u ON d.user_id = u.id
LEFT JOIN members m ON u.member_id = m.id
ORDER BY inet_aton(q.ip_address)
");
}
}
freenetis/trunk/kohana/application/controllers/subnets.php
$grid->field('id')->label(url_lang::lang('texts.ID'));
$grid->field('ip_address')->label(url_lang::lang('texts.IP address'));
$grid->action_field('id')->label(url_lang::lang('texts.IP address'))->url(url_lang::base().'ip_addresses/show')->action(url_lang::lang('texts.Show'))->class('center');
$grid->field('name')->label(url_lang::lang('texts.Member'));
$grid->field('device_name')->label(url_lang::lang('texts.Device'));
$grid->action_field('did')->label(url_lang::lang('texts.Device'))->url(url_lang::base().'devices/show')->action(url_lang::lang('texts.Show'))->class('center');
$grid->field('member_name')->label(url_lang::lang('texts.Member'));
$grid->action_field('mid')->label(url_lang::lang('texts.Member'))->url(url_lang::base().'members/show')->action(url_lang::lang('texts.Show'))->class('center');
$grid->datasource($ips);

Také k dispozici: Unified diff