Revize 1508
Přidáno uživatelem Ondřej Fibich před asi 12 roky(ů)
freenetis/branches/network/application/i18n/cs_CZ/texts.php | ||
---|---|---|
'port number already exist' => 'Číslo portu již existuje.',
|
||
'port vlan has to be in tagged vlans' => 'Port VLAN musí být mezi tagovanými VLANy.',
|
||
'port vlan has to be in untagged vlans' => 'Port VLAN musí být mezi netagovanými VLANy.',
|
||
'port vlan setting' => 'VLAN nastavení portu',
|
||
'port setting' => 'Nastavení portu',
|
||
'ports list' => 'Seznam portů',
|
||
'ports' => 'Porty',
|
freenetis/branches/network/application/models/device.php | ||
---|---|---|
", $device_id, Iface_Model::TYPE_PORT, $port_number)->current()->total > 0;
|
||
}
|
||
|
||
/**
|
||
* Gets next available port number for new port of device
|
||
*
|
||
* @author Ondřej Fibich
|
||
* @param integer $device_id
|
||
* @return integer
|
||
*/
|
||
public function get_next_port_number($device_id = null)
|
||
{
|
||
if ($device_id === NULL && isset($this) && $this->id)
|
||
{
|
||
$device_id = $this->id;
|
||
}
|
||
|
||
return $this->db->query("
|
||
SELECT IFNULL(MAX(i.number) + 1, 1) AS pnumber
|
||
FROM ifaces i
|
||
WHERE i.device_id = ? AND i.type = ?
|
||
", $device_id, Iface_Model::TYPE_PORT)->current()->pnumber;
|
||
}
|
||
|
||
}
|
freenetis/branches/network/application/controllers/ifaces.php | ||
---|---|---|
Controller::error(RECORD);
|
||
}
|
||
|
||
$port_number = $device->get_next_port_number();
|
||
|
||
$this->device_id = $device_id;
|
||
$this->iface_type = $type;
|
||
|
||
... | ... | |
$port_form = $form->group('Port setting');
|
||
|
||
$port_form->input('number')
|
||
->value($port_number)
|
||
->class('increase_decrease_buttons')
|
||
->callback(array($this, 'valid_port_nr'));
|
||
|
||
$port_form->dropdown('port_mode')
|
||
->options($modes)
|
||
->selected(Iface_Model::PORT_MODE_ACCESS)
|
||
->rules('required')
|
||
->style('width:200px');
|
||
|
||
$vlan_port_form = $form->group('Port VLAN setting')->visible(FALSE);
|
||
|
||
$port_form->dropdown('port_vlan_id')
|
||
$vlan_port_form->dropdown('port_vlan_id')
|
||
->options($default_vlans)
|
||
->selected($default_vlan->id)
|
||
->rules('required')
|
||
... | ... | |
->style('width:200px')
|
||
->add_button('vlans');
|
||
|
||
$port_form->dropdown('tagged_vlan_id[]')
|
||
$vlan_port_form->dropdown('tagged_vlan_id[]')
|
||
->label('Tagged VLANs')
|
||
->options($arr_vlans)
|
||
->multiple('multiple')
|
||
->size(30)
|
||
->size(10)
|
||
->add_button('vlans');
|
||
|
||
$port_form->dropdown('untagged_vlan_id[]')
|
||
$vlan_port_form->dropdown('untagged_vlan_id[]')
|
||
->label('Untagged VLANs')
|
||
->options($arr_vlans)
|
||
->selected($default_vlan->id)
|
||
->callback(array($this, 'valid_vlans'))
|
||
->multiple('multiple')
|
||
->size(30)
|
||
->size(10)
|
||
->add_button('vlans');
|
||
}
|
||
|
||
... | ... | |
->label('Mode')
|
||
->rules('required')
|
||
->options($modes)
|
||
->selected(Iface_Model::WIRELESS_MODE_CLIENT)
|
||
->callback(array($this, 'valid_mode'))
|
||
->style('width:200px');
|
||
|
||
... | ... | |
->rules('required')
|
||
->style('width:200px')
|
||
->selected($iface->port_mode);
|
||
|
||
$vlan_port_form = $form->group('Port VLAN setting');
|
||
|
||
$port_form->dropdown('port_vlan_id')
|
||
$vlan_port_form->dropdown('port_vlan_id')
|
||
->options($default_vlans)
|
||
->selected($default_vlan_id)
|
||
->rules('required')
|
||
... | ... | |
->style('width:200px')
|
||
->add_button('vlans');
|
||
|
||
$port_form->dropdown('tagged_vlan_id[]')
|
||
$vlan_port_form->dropdown('tagged_vlan_id[]')
|
||
->label('Tagged VLANs')
|
||
->options($arr_vlans)
|
||
->selected($tagged_vlans_ids)
|
||
->multiple('multiple')
|
||
->size(30)
|
||
->size(10)
|
||
->add_button('vlans');
|
||
|
||
$port_form->dropdown('untagged_vlan_id[]')
|
||
$vlan_port_form->dropdown('untagged_vlan_id[]')
|
||
->label('Untagged VLANs')
|
||
->options($arr_vlans)
|
||
->selected($untagged_vlans_ids)
|
||
->callback(array($this, 'valid_vlans'))
|
||
->multiple('multiple')
|
||
->size(30)
|
||
->size(10)
|
||
->add_button('vlans');
|
||
}
|
||
|
freenetis/branches/network/application/controllers/links.php | ||
---|---|---|
$form->group('Basic data');
|
||
|
||
$form->input('name')
|
||
->rules('required')
|
||
->style('width: 600px');
|
||
|
||
$form->dropdown('medium')
|
||
... | ... | |
$form->group('Basic data');
|
||
|
||
$form->input('name')
|
||
->rules('required|length[3,100]')
|
||
->style('width: 600px')
|
||
->value($link->name);
|
||
|
freenetis/branches/network/application/views/js/devices_add.php | ||
---|---|---|
return;
|
||
}
|
||
|
||
if (!parseInt($(this).val()))
|
||
var value = $(this).val();
|
||
|
||
$(this).parent().find('a.device_show').remove();
|
||
|
||
if (!parseInt(value))
|
||
{
|
||
$eif.html('');
|
||
$eif.removeClass('required');
|
||
... | ... | |
$eif.addClass('required');
|
||
}
|
||
|
||
// add link for showing of device
|
||
$(this).parent().find('.a_filter_devices').after($('<a>', {
|
||
href: '<?php echo url_lang::base() ?>devices/show/' + value
|
||
}).addClass('device_add_detail_button popup_link device_show').html('<?php echo html::image(array('src' => '/media/images/icons/grid_action/show.png')) ?>'));
|
||
|
||
// change map button href for prefilled enum type in add form dialog
|
||
var map_a = $(this).parent().find('.device_map');
|
||
|
||
if (map_a.length)
|
||
{
|
||
var parts = map_a.attr('href').split('?');
|
||
map_a.attr('href', rtrim(parts[0], '0123456789/') + '/' + $(this).val() + '?' + parts[1]);
|
||
map_a.attr('href', rtrim(parts[0], '0123456789/') + '/' + value + '?' + parts[1]);
|
||
}
|
||
|
||
$.getJSON('<?php echo url_lang::base() ?>json/get_ifaces', {
|
||
data: $(this).val(), itype: $ety.val()
|
||
data: value, itype: $ety.val()
|
||
}, function (data)
|
||
{
|
||
var options = ['<option value="">---- <?php echo __('Select interface') ?> ---</option>'];
|
||
... | ... | |
html_buffer.push('<a href="#" class="device_add_detail_button a_filter_devices" title="<?php echo __('Filter devices') ?>">');
|
||
html_buffer.push('<?php echo html::image(array('src' => 'media/images/icons/filter.png')) ?>');
|
||
html_buffer.push('</a>');
|
||
html_buffer.push('<a href="<?php echo url_lang::base() ?>devices/map?action=devices_add&name=connected[');
|
||
html_buffer.push(i);
|
||
html_buffer.push(']" class="device_add_detail_button popup_link device_map" title="<?php echo __('Select device using device map') ?>">');
|
||
html_buffer.push('<?php echo html::image(array('src' => 'media/images/icons/map_icon.gif')) ?>');
|
||
html_buffer.push('</a><br />');
|
||
|
||
/////////////////// Device map - waiting for improoving of functionality :-( ///
|
||
// html_buffer.push('<a href="<?php echo url_lang::base() ?>devices/map?action=devices_add&name=connected[');
|
||
// html_buffer.push(i);
|
||
// html_buffer.push(']" class="device_add_detail_button popup_link device_map" title="<?php echo __('Select device using device map') ?>">');
|
||
// html_buffer.push('<?php echo html::image(array('src' => 'media/images/icons/map_icon.gif')) ?>');
|
||
// html_buffer.push('</a>');
|
||
////////////////////////////////////////////////////////////////////////////////
|
||
|
||
html_buffer.push('<br />');
|
||
html_buffer.push('<select name="connected_iface[');
|
||
html_buffer.push(i);
|
||
html_buffer.push(']" style="width: 16em"');
|
freenetis/branches/network/application/views/js/ifaces_add.php | ||
---|---|---|
|
||
// on change of port mode - set vlan options accoding to mode
|
||
$('#port_mode').live('change', function ()
|
||
{
|
||
{
|
||
switch ($(this).val())
|
||
{
|
||
case '<?php echo Iface_Model::PORT_MODE_ACCESS ?>':
|
||
$('#tagged_vlan_id').parent().parent().parent().parent().parent().parent().addClass('dispNone');
|
||
$('#untagged_vlan_id').parent().parent().parent().parent().parent().parent().removeClass('dispNone');
|
||
$('#tagged_vlan_id').parent().parent().parent().parent().parent().parent().hide();
|
||
$('#untagged_vlan_id').parent().parent().parent().parent().parent().parent().show();
|
||
break;
|
||
|
||
case '<?php echo Iface_Model::PORT_MODE_TRUNK ?>':
|
||
$('#tagged_vlan_id').parent().parent().parent().parent().parent().parent().removeClass('dispNone');
|
||
$('#untagged_vlan_id').parent().parent().parent().parent().parent().parent().addClass('dispNone');
|
||
$('#tagged_vlan_id').parent().parent().parent().parent().parent().parent().show();
|
||
$('#untagged_vlan_id').parent().parent().parent().parent().parent().parent().hide();
|
||
break;
|
||
|
||
case '<?php echo Iface_Model::PORT_MODE_HYBRID ?>':
|
||
$('#tagged_vlan_id').parent().parent().parent().parent().parent().parent().removeClass('dispNone');
|
||
$('#untagged_vlan_id').parent().parent().parent().parent().parent().parent().removeClass('dispNone');
|
||
$('#tagged_vlan_id').parent().parent().parent().parent().parent().parent().show();
|
||
$('#untagged_vlan_id').parent().parent().parent().parent().parent().parent().show();
|
||
break;
|
||
|
||
default: // if empty => hide
|
||
$('#tagged_vlan_id').parent().parent().parent().parent().parent().parent().addClass('dispNone');
|
||
$('#untagged_vlan_id').parent().parent().parent().parent().parent().parent().addClass('dispNone');
|
||
$('#tagged_vlan_id').parent().parent().parent().parent().parent().parent().hide();
|
||
$('#untagged_vlan_id').parent().parent().parent().parent().parent().parent().hide();
|
||
break;
|
||
}
|
||
}).trigger('change');
|
||
});
|
||
|
||
// show/hide items if group showned
|
||
$('#port_vlan_id').parents('table').find('.group-button').bind('groupShowed', function ()
|
||
{
|
||
$('#port_mode').trigger('change');
|
||
});
|
||
|
||
// on change of connected to
|
||
$('#connected_to').change(function ()
|
||
{
|
||
... | ... | |
|
||
// add require fields at start
|
||
$('#link_id').trigger('change');
|
||
$('#port_mode').trigger('change');
|
||
<?php endif ?>
|
||
|
freenetis/branches/network/application/views/js/base.php | ||
---|---|---|
|
||
// sort unordered grids
|
||
$('table').tablesorter();
|
||
|
||
// jQuery tabs
|
||
$('#tabs, .tabs').tabs();
|
||
|
||
<?php if (!$nobase): ?>
|
||
|
||
... | ... | |
if ($items.length && $($items.get(0)).is(':visible'))
|
||
{
|
||
$items.hide();
|
||
$(this).trigger('groupHided');
|
||
}
|
||
else
|
||
{
|
||
$items.show();
|
||
$(this).trigger('groupShowed', this);
|
||
img = 'minus';
|
||
title = '<?php echo __('Hide form items') ?>';
|
||
}
|
||
... | ... | |
// validate all form
|
||
$('.form').validate();
|
||
|
||
// jQuery tabs
|
||
$('#tabs, .tabs').tabs();
|
||
|
||
// show menu in mobile browsers (default state of menu is hide)
|
||
$('#a_show_menu').click(function ()
|
||
{
|
Také k dispozici: Unified diff
Novinky:
- triggery pro ziskavani zmeny zobrazeni skupiny polozek formulare
Upravy:
- nekolik vylepsenich pri pridavani rozhrani a zarizeni