diff --git a/src/sunstone/public/js/plugins/hosts-tab.js b/src/sunstone/public/js/plugins/hosts-tab.js
index d0ad8cf089..69854974d6 100644
--- a/src/sunstone/public/js/plugins/hosts-tab.js
+++ b/src/sunstone/public/js/plugins/hosts-tab.js
@@ -962,10 +962,13 @@ function updateHostInfo(request,host){
'
}
+ // TODO make wilds configurable
+
var wilds_info_tab = {
title: tr("WILDS"),
icon: "fa-hdd-o",
- content : '
\
+ '
+ }
+
+ // Add event listener for importing WILDS
+ $('#import_wilds').on('click', function () {
+ var row = $(this).closest('table').DataTable().row( $(this).closest('tr') );
+
+ if ( row.child.isShown() ) {
+ row.child.hide();
+ $(this).children("span").addClass('fa-chevron-down');
+ $(this).children("span").removeClass('fa-chevron-up');
+ }
+ else {
+ var html = '\
+
\
+ \
+ \
+ '+tr("Security Group")+' | \
+ '+tr("Protocol")+' | \
+ '+tr("Type")+' | \
+ '+tr("Range")+' | \
+ '+tr("Network")+' | \
+ '+tr("ICMP Type")+' | \
+
\
+ \
+ ';
+
+ $.each(row.data().SECURITY_GROUP_RULES, function(index, elem){
+ var rule_st = sg_rule_to_st(this);
+
+ var new_tr = '\
+ '+this.SECURITY_GROUP_ID+' | \
+ '+this.SECURITY_GROUP_NAME+' | \
+ '+rule_st.PROTOCOL+' | \
+ '+rule_st.RULE_TYPE+' | \
+ '+rule_st.RANGE+' | \
+ '+rule_st.NETWORK+' | \
+ '+rule_st.ICMP_TYPE+' | \
+
'
+
+ html += new_tr;
+ });
+
+ row.child( html ).show();
+ $(this).children("span").removeClass('fa-chevron-down');
+ $(this).children("span").addClass('fa-chevron-up');
+ }
+ } );
//Sunstone.updateInfoPanelTab(info_panel_name,tab_name, new tab object);
Sunstone.updateInfoPanelTab("host_info_panel","host_info_tab",info_tab);
@@ -1039,16 +1090,18 @@ function updateHostInfo(request,host){
$.each(wilds, function(){
name = this.split("_")[0];
- uuid = this.split("_")[1];
+ uuid = "-"; // TODO get uuid from template and present it, CPU, MEMORY ??
wilds_list_array.push([
name,
uuid,
- ''
+ ''
]);
});
}
+ //$(".import_'+name+'", trow).data("wild_template", COREVALUE)
+
dataTable_wilds_hosts.fnAddData(wilds_list_array);
delete host_info.TEMPLATE.WILDS;
}