Revision 372f6c81
b/ui/static/synnefo.js | ||
---|---|---|
1438 | 1438 |
try { |
1439 | 1439 |
console.info('for server ' + serverID + ' set firewall profile to ' + profile); |
1440 | 1440 |
} catch(err) {} |
1441 |
//remove progress gif and toggle the content |
|
1442 |
$('button.firewall-apply').html(VARIOUS["APPLY"]); |
|
1443 |
$('button.firewall-apply').attr("disabled", false); |
|
1444 |
$('div#net-pub-server-' + serverID + ' div.firewall-header').click(); |
|
1441 | 1445 |
// toggle the reboot dialog |
1442 |
//display_reboot_dialog(networkID, serverID, serverName, serverState); |
|
1446 |
var serverName = $('div#net-pub-server-' + serverID).find('div.machine-name-div span.name').text(); |
|
1447 |
var serverState = $('div#net-pub-server-' + serverID).find('img.logo').attr('src').split('-')[1]; |
|
1448 |
serverState = serverState.split('.')[0]; |
|
1449 |
var networkID = $('div#net-pub-server-' + serverID).parent().parent().parent().parent().attr("id").split('-').pop(); |
|
1450 |
display_reboot_dialog(networkID, serverID, serverName, serverState); |
|
1443 | 1451 |
} else { |
1444 | 1452 |
ajax_error(jqXHR.status, undefined, 'Set firewall profile', jqXHR.responseText); |
1445 | 1453 |
} |
b/ui/templates/home.html | ||
---|---|---|
153 | 153 |
|
154 | 154 |
var VARIOUS = { |
155 | 155 |
'CONFIRM' : '{% trans "Confirm" %}', |
156 |
'CANCEL' : '{% trans "Cancel" %}' |
|
156 |
'CANCEL' : '{% trans "Cancel" %}', |
|
157 |
'APPLY' : '{% trans "Apply" %}', |
|
157 | 158 |
}; |
158 | 159 |
|
159 | 160 |
// ajax error checking |
b/ui/templates/networks.html | ||
---|---|---|
171 | 171 |
</div> |
172 | 172 |
<div class="firewall-content"> |
173 | 173 |
<div class="firewall-cable"></div> |
174 |
<input type="radio" class="checkboxes" name="image-id1" />
|
|
174 |
<input type="radio" class="checkboxes" value="DISABLED" name="firewall" />
|
|
175 | 175 |
<span class="checkbox-legends">{% trans "Unprotected mode (Firewall off)" %}</span> |
176 | 176 |
<br /> |
177 |
<input type="radio" class="checkboxes" name="image-id1" />
|
|
177 |
<input type="radio" class="checkboxes" value="ENABLED" name="firewall" />
|
|
178 | 178 |
<span class="checkbox-legends">{% trans "Fully protected mode (Firewall on)" %}</span> |
179 | 179 |
<br /> |
180 |
<input type="radio" class="checkboxes" name="image-id1" />
|
|
180 |
<input type="radio" class="checkboxes" value="PROTECTED" name="firewall" />
|
|
181 | 181 |
<span class="checkbox-legends">{% trans "Basically protected mode (Firewall on)" %}</span> |
182 | 182 |
<button type="submit" class="firewall-apply">{% trans "Apply" %}</button> |
183 | 183 |
</div> |
... | ... | |
653 | 653 |
|
654 | 654 |
//hide firewall content on apply click |
655 | 655 |
$("#networks-pane .firewall-apply").live('click', function() { |
656 |
$(this).parent().slideToggle(600); |
|
656 |
var serverID = $(this).parent().parent().attr("id").split('-').pop(); |
|
657 |
var networkID = $(this).parent().parent().parent().parent().parent().parent().attr("id").split('-').pop(); |
|
658 |
var profile = $(this).parent().find('input:checked').attr('value'); |
|
659 |
if (profile != undefined) { |
|
660 |
set_firewall(networkID, serverID, profile); |
|
661 |
$(this).attr("disabled", true); |
|
662 |
$(this).html('<img src="static/icons/indicators/medium/horizontal-progress.gif"></img>'); |
|
663 |
} |
|
657 | 664 |
return false; |
658 | 665 |
}); |
659 | 666 |
|
Also available in: Unified diff