1 <%doc>Copyright (C) 2009-2010 HDE, Inc.</%doc>
2 <%inherit file="../include/common.part" />
3 <script type="text/javascript">
5 $(document).ready(function(){
9 tool_invalid("#edit_settings");
12 function(){tool_over(this);},
13 function(){tool_over(this);}
14 ).mousedown(function(){
15 var id = $(this).attr("id");
19 renew_main_event("#tool_renew", "${ctx.homepath}${ctx.path}");
21 $("#device_tab td").each(function(){
22 $(this).click(function(){
23 var target = $(this).attr("id");
25 var target_val = target.split("_");
28 switch(target_val[0]){
30 ajax_get("#settings_value",
31 "${ctx.homepath}/host/${host_id}/networksettings/general.part",
33 tool_reset("#edit_settings");
37 ajax_get("#settings_value",
38 "${ctx.homepath}/host/${host_id}/networksettings/nic/" + target_val[1] + ".part",
40 tool_reset("#edit_settings");
41 if(target_val[1].substr(0,3) == "eth") {
44 tool_invalid("#edit_settings");
48 _ajax_alert_on("ERROR", "${_('Received an unexpected value.')}");
51 $("#device_tab td").each(function(){
52 if($(this).attr("id") != target){
53 $(this).removeClass("device_active");
55 $(this).addClass("device_active");
65 function get_target_id(){
67 $("#device_tab td").each(function(){
68 if($(this).hasClass("device_active") == true){
69 target_id = $(this).attr("id");
75 function bind_edit_event() {
76 $("#edit_settings").one("click.edit", function(){
77 var target_id = get_target_id();
78 var val = target_id.split("_");
82 edit_url = "${ctx.homepath}/host/${host_id}/networksettings/" + val[0] + ".part?mode=input";
84 edit_url = "${ctx.homepath}/host/${host_id}/networksettings/" + val[0] + "/" + val[1] + ".part?mode=input";
89 "${_('Edit Settings')}",
90 "${ctx.homepath}/host/${host_id}/networksettings.part");
94 function unbind_event() {
95 $("#edit_settings").unbind("click.edit");
100 <div id="settings_dialog"></div>
102 <div class="left"></div>
103 <a href="#" name="edit_settings" id="edit_settings" class="tool-link">
104 <div class="tool-mid">
105 <div class="tool-left"></div>
106 <div class="tool-img">
107 <img src="${ctx.homepath}/static/images/tool-edit.png" alt="" />
109 <div class="tool-right">
110 <div class="tool-text" >${_('Edit')}</div>
115 <a href="#" class="tool-link" >
116 <div class="tool-mid">
117 <img src="${ctx.homepath}/static/images/reload.gif" alt="renew" id="tool_renew"/>
122 <br style="clear: both;"/>
123 <div class="space"></div>
124 <br style="clear: both;"/>
125 <div class="alert"></div>
129 <table width="99.8%" cellspacing="1" border="0" style="background-color:#bcbcbc;">
131 <td style="background-color:#E4E4DD; padding:0px; text-align:left;" bgcolor="#FFFFFF" width="20%" valign="top">
132 <table id="device_tab" width="100%" cellspacing="0" border="0" style="background-color:#e4e4dd;">
134 <td id="general_" style="font-size:10px;">
135 <img src="${ctx.homepath}/static/images/device-console.png">
136 <span class="status">${_('General Settings')}</span>
139 % for dev in sorted(current.keys()):
141 <td id="nic_${dev}" style="font-size:10px;" width="100">
142 <img src="${ctx.homepath}/static/images/device-network.png">
143 <span class="status">${_('Device')} ${dev}</span>
149 <td bgcolor="#FFFFFF" valign="top" id="settings_value" width="80%" style="padding:30px;">
158 <br style="clear: both;"/>