mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
bug 7458: zone - network - implement List External Firewall.
This commit is contained in:
parent
b724ff8cfa
commit
b853cad913
@ -399,6 +399,66 @@
|
|||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- External Firewall template (begin) -->
|
||||||
|
<div class="grid_container" id="externalfirewall_template" style="display: none">
|
||||||
|
<div class="grid_header">
|
||||||
|
<div class="grid_header_title" id="grid_header_title">
|
||||||
|
</div>
|
||||||
|
<div class="grid_actionbox" id="firewall_action_link">
|
||||||
|
<div class="grid_actionsdropdown_box" id="firewall_action_menu" style="display: none;">
|
||||||
|
<ul class="actionsdropdown_boxlist" id="action_list">
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="gridheader_loaderbox" id="spinning_wheel" style="display: none; height: 18px;">
|
||||||
|
<div class="gridheader_loader" id="icon">
|
||||||
|
</div>
|
||||||
|
<p id="description">
|
||||||
|
Waiting …
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid_rows" id="after_action_info_container" style="display:none">
|
||||||
|
<div class="grid_row_cell" style="width: 90%; border: none;">
|
||||||
|
<div class="row_celltitles">
|
||||||
|
<strong id="after_action_info">Message will appear here</strong></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="grid_rows odd">
|
||||||
|
<div class="grid_row_cell" style="width: 20%;">
|
||||||
|
<div class="row_celltitles">
|
||||||
|
ID:</div>
|
||||||
|
</div>
|
||||||
|
<div class="grid_row_cell" style="width: 79%;">
|
||||||
|
<div class="row_celltitles" id="id">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="grid_rows even">
|
||||||
|
<div class="grid_row_cell" style="width: 20%;">
|
||||||
|
<div class="row_celltitles">
|
||||||
|
URL:</div>
|
||||||
|
</div>
|
||||||
|
<div class="grid_row_cell" style="width: 79%;">
|
||||||
|
<div class="row_celltitles" id="url">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="grid_rows odd">
|
||||||
|
<div class="grid_row_cell" style="width: 20%;">
|
||||||
|
<div class="row_celltitles">
|
||||||
|
Type:</div>
|
||||||
|
</div>
|
||||||
|
<div class="grid_row_cell" style="width: 79%;">
|
||||||
|
<div class="row_celltitles" id="type">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- External Firewall template (end) -->
|
||||||
|
|
||||||
<!-- IP Range template (begin) -->
|
<!-- IP Range template (begin) -->
|
||||||
<div class="grid_container" id="iprange_template" style="display: none">
|
<div class="grid_container" id="iprange_template" style="display: none">
|
||||||
<div class="grid_header">
|
<div class="grid_header">
|
||||||
|
|||||||
@ -222,13 +222,65 @@ function publicNetworkJsonToFirewallTab() {
|
|||||||
var $thisTab = $("#right_panel_content #public_network_page #tab_content_firewall");
|
var $thisTab = $("#right_panel_content #public_network_page #tab_content_firewall");
|
||||||
$thisTab.find("#tab_container").hide();
|
$thisTab.find("#tab_container").hide();
|
||||||
$thisTab.find("#tab_spinning_wheel").show();
|
$thisTab.find("#tab_spinning_wheel").show();
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
data: createURL("command=listExternalFirewalls&zoneid="+zoneObj.id),
|
||||||
$thisTab.find("#tab_container").show();
|
dataType: "json",
|
||||||
$thisTab.find("#tab_spinning_wheel").hide();
|
success: function(json) {
|
||||||
|
var items = json.listexternalfirewallsresponse.externalfirewall;
|
||||||
|
var $container = $thisTab.find("#tab_container").empty();
|
||||||
|
var $template = $("#externalfirewall_template");
|
||||||
|
if(items != null && items.length > 0) {
|
||||||
|
for(var i=0; i<items.length; i++) {
|
||||||
|
var $newTemplate = $template.clone();
|
||||||
|
publicNetworkFirewallJsonToTemplate(items[i], $newTemplate);
|
||||||
|
$container.append($newTemplate.show());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$thisTab.find("#tab_container").show();
|
||||||
|
$thisTab.find("#tab_spinning_wheel").hide();
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function publicNetworkFirewallJsonToTemplate(jsonObj, $template) {
|
||||||
|
$template.data("jsonObj", jsonObj);
|
||||||
|
$template.attr("id", "publicNetworkFirewall_" + jsonObj.id);
|
||||||
|
|
||||||
|
$template.find("#grid_header_title").text(fromdb(jsonObj.url));
|
||||||
|
$template.find("#id").text(fromdb(jsonObj.id));
|
||||||
|
$template.find("#type").text(fromdb(jsonObj.type));
|
||||||
|
$template.find("#url").text(fromdb(jsonObj.url));
|
||||||
|
|
||||||
|
var $actionLink = $template.find("#firewall_action_link");
|
||||||
|
$actionLink.bind("mouseover", function(event) {
|
||||||
|
$(this).find("#firewall_action_menu").show();
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
$actionLink.bind("mouseout", function(event) {
|
||||||
|
$(this).find("#firewall_action_menu").hide();
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
var $actionMenu = $actionLink.find("#firewall_action_menu");
|
||||||
|
$actionMenu.find("#action_list").empty();
|
||||||
|
|
||||||
|
buildActionLinkForSubgridItem("Delete Firewall", publicNetworkFirewallActionMap, $actionMenu, $template);
|
||||||
|
}
|
||||||
|
|
||||||
|
var publicNetworkFirewallActionMap = {
|
||||||
|
"Delete Firewall": {
|
||||||
|
api: "deleteExternalFirewall",
|
||||||
|
isAsyncJob: false,
|
||||||
|
inProcessText: "Deleting Firewall....",
|
||||||
|
afterActionSeccessFn: function(json, id, $subgridItem) {
|
||||||
|
$subgridItem.slideUp("slow", function() {
|
||||||
|
$(this).remove();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function publicNetworkJsonToLoadBalancerTab() {
|
function publicNetworkJsonToLoadBalancerTab() {
|
||||||
var $midmenuItem1 = $("#right_panel_content").data("$midmenuItem1");
|
var $midmenuItem1 = $("#right_panel_content").data("$midmenuItem1");
|
||||||
if($midmenuItem1 == null)
|
if($midmenuItem1 == null)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user