Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 1448

Přidáno uživatelem Ondřej Fibich před asi 12 roky(ů)

Upravy:
- dokonceni rozhrani pro pridavani zarizeni - bez dialogu (#185)

Opravy:
- odtraneni nepotrebneho obrazku (pozadi dialogu)

Zobrazit rozdíly:

freenetis/branches/network/media/css/jquery-ui.css
----------------------------------*/
.ui-widget .ui-widget { font-size: 1em; }
.ui-widget input, .ui-widget select, .ui-widget textarea, .ui-widget button { font-family: Verdana,Arial,sans-serif; font-size: 1em; }
.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff url(../images/jquery.ui/ui-bg_flat_75_ffffff_40x100.png) 50% 50% repeat-x; color: #222222; }
.ui-widget-content { border: 1px solid #aaaaaa; background: #ffffff none 50% 50%; color: #222222; }
.ui-widget-content a { color: #222222; }
.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc url(../images/jquery.ui/ui-bg_highlight-soft_75_cccccc_1x100.png) 50% 50% repeat-x; color: #222222; font-weight: bold; }
.ui-widget-header { border: 1px solid #aaaaaa; background: #cccccc none 50% 50%; color: #222222; font-weight: bold; }
.ui-widget-header a { color: #222222; }
/* Interaction states
......
.ui-corner-all { -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; }
/* Overlays */
.ui-widget-overlay { background: #aaaaaa url(../images/jquery.ui/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); }
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa url(../images/jquery.ui/ui-bg_flat_0_aaaaaa_40x100.png) 50% 50% repeat-x; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
.ui-widget-overlay { background: #aaaaaa none 50% 50%; opacity: .30;filter:Alpha(Opacity=30); }
.ui-widget-shadow { margin: -8px 0 0 -8px; padding: 8px; background: #aaaaaa none 50% 50%; opacity: .30;filter:Alpha(Opacity=30); -moz-border-radius: 8px; -webkit-border-radius: 8px; border-radius: 8px; }/*
* jQuery UI Resizable 1.8.13
*
* Copyright 2011, AUTHORS.txt (http://jqueryui.com/about)
freenetis/branches/network/media/css/style.css
.monitor-down a {
color: white !important;
}
}
label.device_add_label {
display: inline-block;
width: 35px;
margin: 5px;
}
a.device_add_detail_button {
padding-top: 2px;
padding-left: 5px;
}
a.device_add_detail_button img {
width: 14px;
height: 14px;
}
freenetis/branches/network/application/views/js/devices_add.php
// values for dropdowns
var subnets_options = '<option value="">---- <?php echo __('Select subnet') ?> ----</option><?php foreach ($arr_subnets as $k => $v): ?><option value="<?php echo $k ?>"><?php echo $v ?></option><?php endforeach; ?>';
var devices_options = '<option value="">---- <?php echo __('Select device') ?> ----</option><?php foreach ($arr_devices as $k => $v): ?><option value="<?php echo $k ?>"><?php echo $v ?></option><?php endforeach; ?>';
var port_mode_options = '<?php foreach (Iface_Model::get_port_modes() as $k => $v): ?><option value="<?php echo $k ?>"><?php echo $v ?></option><?php endforeach; ?>';
var wiface_mode_options = '<?php foreach (Iface_Model::get_wireless_modes() as $k => $v): ?><option value="<?php echo $k ?>"<?php echo ($k == Iface_Model::WIRELESS_MODE_CLIENT) ? ' selected="selected"' : '' ?>><?php echo $v ?></option><?php endforeach; ?>';
var wiface_antenna_options = '<?php foreach (Iface_Model::get_wireless_antennas() as $k => $v): ?><option value="<?php echo $k ?>"<?php echo ($k == Iface_Model::WIRELESS_ANTENNA_SECTIONAL) ? ' selected="selected"' : '' ?>><?php echo $v ?></option><?php endforeach; ?>';
// port modes asociative array
var port_modes = new Array();
......
*/
function change_use()
{
var inputs = $(this).parent().parent().find('input[type="text"], select');
var inputs = $(this).parent().parent().find('input.mac_address');
if ($(this).is(':checked'))
{
......
*/
function create_form_of_group($group, data, start_index)
{
var $table = $('<table>').addClass('extended');
var $table = $('<table>').addClass('extended').css('width', '100%');
var $tr = $('<tr>');
var $td;
// header
$tr.html(
$('<th>').css('width', '10px').text('<?php echo __('Use') ?>?')
);
if (data['count'] == undefined)
{
$tr.html(
$('<th>').css('width', '10px').text('<?php echo __('Use') ?>?')
);
}
if (data['has_mac'])
{
$tr.append(
$('<th>').text('<?php echo __('MAC') ?>')
$('<th>').text('<?php echo __('Interface') ?>')
);
}
else if (data['type'] == <?php echo Iface_Model::TYPE_PORT ?>)
......
{
$tr.append(
$('<th>').text('<?php echo __('IP address') ?>')
).append(
$('<th>').text('<?php echo __('Subnet') ?>')
);
}
......
$table.html($tr);
// array of default used rows
var used_rows = [];
// indicator of first row of group
var first_row = true;
......
// make HTML
$tr = $('<tr>');
// checked if minimal size
if ((data['min_count'] != undefined) &&
(data['min_count'] > (i - start_index)))
// not hard count => some fields may be optional
if (data['count'] == undefined)
{
used_rows.push('use[' + i + ']');
var $th = $('<th>').css('width', '10px');
if (data['min_count'] <= (i - start_index)) // optional
{
$th.html($('<input>', {
type : 'checkbox',
name : 'use[' + i + ']',
style : 'width: auto;',
change : change_use
}));
}
else // hard
{
$th.html($('<input>', {
type : 'hidden',
name : 'use[' + i + ']',
value : 1
}));
}
$tr.html($th);
}
$tr.html(
$('<th>').css('width', '10px').html($('<input>', {
type : 'checkbox',
else
{
$tr.html($('<input>', {
type : 'hidden',
name : 'use[' + i + ']',
style : 'width: auto;',
change : change_use
}))
);
value : 1
}));
}
$td = $('<td>').append($('<label>').addClass('device_add_label').text('<?php echo __('Name') ?>: ')).append(
$('<b>').text(item['name'])
).append($('<br>'));
$td = $('<td>');
if (data['has_mac'])
{
$td.append($('<input>', {
$td.append($('<label>').addClass('device_add_label').text('MAC: ')).append($('<input>', {
type : 'text',
name : 'mac[' + i + ']',
style : 'width: 9em',
change : use_row
}).addClass('mac_address'));
// required if count is solid or minimal
if ((data['count'] != undefined) ||
(data['min_count'] > (i - start_index)))
{
$td.find('input').addClass('required');
}
}
else if (data['type'] == <?php echo Iface_Model::TYPE_PORT ?>)
{
......
$td.append(iface_hid).append($('<a>', {
href : '#',
click : add_detail_to_iface,
style : 'margin: 4px',
title : '<?php echo __('Add details to interface') ?>'
}).html('<?php echo html::image(array('src' => 'media/images/icons/settings.gif')) ?>'));
}).addClass('device_add_detail_button').html('<?php echo html::image(array('src' => 'media/images/icons/settings.gif')) ?>'));
$tr.append($td);
if (data['has_ip'])
{
$tr.append(
$('<td>').html($('<input>', {
$('<td>').html($('<label>').addClass('device_add_label').text('IP: ')).append($('<input>', {
type : 'text',
name : 'ip[' + i + ']',
style : 'width: 8.5em',
......
}).addClass('ip_address')).append(ip_hiddden).append($('<a>', {
href : '#',
click : add_detail_to_ip,
style : 'margin: 4px',
title : '<?php echo __('Add details to IP address') ?>'
}).html('<?php echo html::image(array('src' => 'media/images/icons/settings.gif')) ?>'))
).append(
$('<td>').html($('<select>', {
}).addClass('device_add_detail_button').html('<?php echo html::image(array('src' => 'media/images/icons/settings.gif')) ?>')
).append($('<br>')).append($('<label>').addClass('device_add_label').text('<?php echo __('Subnet') ?>: ')).append($('<select>', {
name : 'subnet[' + i + ']',
style : 'width: 9em',
change : use_row
}).html(subnets_options))
);
}).html(subnets_options)
));
}
if (data['has_link'])
{
$tr.append(
$('<td>').html($('<select>', {
$('<td>').css('width', '160px').html($('<select>', {
name : 'connected[' + i + ']',
style : 'width: 13em',
change : use_row
}).bind('change', change_connected).html(devices_options)).append($('<a>', {
href : '#',
click : select_device_using_map,
style : 'margin: 4px',
title : '<?php echo __('Select device using device map') ?>'
}).html('<?php echo html::image(array('src' => 'media/images/icons/map_icon.gif')) ?>')).append(($('<select>', {
}).addClass('device_add_detail_button').html('<?php echo html::image(array('src' => 'media/images/icons/map_icon.gif')) ?>')).append($('<br>')).append($('<select>', {
name : 'connected_iface[' + i + ']',
style : 'width: 13em'
}))).append(link_hid).append($('<a>', {
})).append(link_hid).append($('<a>', {
href : '#',
click : add_detail_to_link,
style : 'margin: 4px',
title : '<?php echo __('Add details to link') ?>'
}).html('<?php echo html::image(array('src' => 'media/images/icons/settings.gif')) ?>'))
);
}).addClass('device_add_detail_button').html('<?php echo html::image(array('src' => 'media/images/icons/settings.gif')) ?>')
));
if (first_row)
{
......
if (sug != undefined && sug.iface_id != undefined)
{
$tr.find('select[name^="connected"]').val(sug.device_id).trigger('change');
$tr.find('select[name^="connected"]').val(sug.device_id).trigger('change')
$tr.find('select[name^="connected_iface"]').val(sug.iface_id);
}
......
}
}
$table.append($tr);
$table.append($tr);
}
$group.after(
......
$('<td>').attr('colspan', '2').html($table)
)
);
// check used options
for (var name in used_rows)
{
$('input[name="' + used_rows[name] + '"]').attr('checked', true).trigger('change');
}
return i;
}
......
// add new
$this.submit(function ()
{
return $(this).validate().form();
if ($(this).validate().form())
{
// enable previously disabled fields
$this.find('input').removeAttr('readonly');
$this.find('select').removeAttr('disabled');
// send form
return true;
}
return false;
});
// hide loader
$('#da_loader').hide();

Také k dispozici: Unified diff