mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
Added subheader in all resource-tab (#414)
* Added total ACLs * Added total Zones * Added total Clusters * Added total Security Groups * Added total MarketPlaceApps * Added total MarketPlaces * Added total Files * Added total Images * Added total Datastores * Added total VRouters * Added total Templates * Added total Virtual Routers
This commit is contained in:
parent
4998103180
commit
b9e9f9660f
@ -40,7 +40,9 @@ define(function(require) {
|
||||
tabClass: "subTab",
|
||||
parentTab: "system-top-tab",
|
||||
listHeader: Locale.tr("Access Control Lists"),
|
||||
subheader: '<span/><small></small> ',
|
||||
subheader: '<span>\
|
||||
<span class="total_acl"/> <small>'+Locale.tr("TOTAL")+'</small>\
|
||||
</span>',
|
||||
resource: 'Acl',
|
||||
buttons: Buttons,
|
||||
actions: Actions,
|
||||
|
@ -57,6 +57,8 @@ define(function(require) {
|
||||
]
|
||||
};
|
||||
|
||||
this.totalACLs = 0;
|
||||
|
||||
this.columns = [
|
||||
Locale.tr("ID"),
|
||||
Locale.tr("Applies to"),
|
||||
@ -82,6 +84,8 @@ define(function(require) {
|
||||
Table.prototype = Object.create(TabDataTable.prototype);
|
||||
Table.prototype.constructor = Table;
|
||||
Table.prototype.elementArray = _elementArray;
|
||||
Table.prototype.preUpdateView = _preUpdateView;
|
||||
Table.prototype.postUpdateView = _postUpdateView;
|
||||
|
||||
return Table;
|
||||
|
||||
@ -96,6 +100,8 @@ define(function(require) {
|
||||
|
||||
var acl_array = _parseAclString(acl_string);
|
||||
|
||||
this.totalACLs++;
|
||||
|
||||
return [
|
||||
'<input class="check_item" type="checkbox" id="'+RESOURCE.toLowerCase()+'_' +
|
||||
element.ID + '" name="selected_items" value="' +
|
||||
@ -264,4 +270,12 @@ define(function(require) {
|
||||
return zone_str;
|
||||
}
|
||||
|
||||
function _preUpdateView() {
|
||||
this.totalACLs = 0;
|
||||
}
|
||||
|
||||
function _postUpdateView() {
|
||||
$(".total_acl").text(this.totalACLs);
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -49,7 +49,9 @@ define(function(require) {
|
||||
parentTab: "infrastructure-top-tab",
|
||||
listHeader: Locale.tr("Clusters"),
|
||||
infoHeader: Locale.tr("Cluster"),
|
||||
subheader: '<span/> <small></small> ',
|
||||
subheader: '<span>\
|
||||
<span class="total_clusters"/> <small>'+Locale.tr("TOTAL")+'</small>\
|
||||
</span>',
|
||||
resource: 'Cluster',
|
||||
buttons: Buttons,
|
||||
actions: Actions,
|
||||
|
@ -76,12 +76,16 @@ define(function(require) {
|
||||
"you_selected_multiple": Locale.tr("You selected the following clusters:")
|
||||
};
|
||||
|
||||
this.totalClusters = 0;
|
||||
|
||||
TabDataTable.call(this);
|
||||
}
|
||||
|
||||
Table.prototype = Object.create(TabDataTable.prototype);
|
||||
Table.prototype.constructor = Table;
|
||||
Table.prototype.elementArray = _elementArray;
|
||||
Table.prototype.preUpdateView = _preUpdateView;
|
||||
Table.prototype.postUpdateView = _postUpdateView;
|
||||
|
||||
return Table;
|
||||
|
||||
@ -91,6 +95,7 @@ define(function(require) {
|
||||
|
||||
function _elementArray(element_json) {
|
||||
var element = element_json[XML_ROOT];
|
||||
this.totalClusters++;
|
||||
|
||||
return [
|
||||
'<input class="check_item" type="checkbox" id="'+RESOURCE.toLowerCase()+'_' +
|
||||
@ -114,4 +119,13 @@ define(function(require) {
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
function _preUpdateView() {
|
||||
this.totalClusters = 0;
|
||||
}
|
||||
|
||||
function _postUpdateView() {
|
||||
$(".total_clusters").text(this.totalClusters);
|
||||
}
|
||||
|
||||
});
|
||||
|
@ -49,7 +49,9 @@ define(function(require) {
|
||||
parentTab: "storage-top-tab",
|
||||
listHeader: Locale.tr("Datastores"),
|
||||
infoHeader: Locale.tr("Datastore"),
|
||||
subheader: '',
|
||||
subheader: '<span class="total_ds"/> <small>'+Locale.tr("TOTAL")+'</small> \
|
||||
<span class="total_on"/> <small>'+Locale.tr("ON")+'</small> \
|
||||
<span class="total_off"/> <small>'+Locale.tr("OFF")+'</small>',
|
||||
resource: 'Datastore',
|
||||
buttons: Buttons,
|
||||
actions: Actions,
|
||||
|
@ -106,12 +106,18 @@ define(function(require) {
|
||||
this.conf.searchDropdownHTML = SearchDropdown({tableId: this.dataTableId});
|
||||
this.searchColumn = SEARCH_COLUMN;
|
||||
|
||||
this.totalDSs = 0;
|
||||
this.totalON = 0;
|
||||
this.totalOFF = 0;
|
||||
|
||||
TabDataTable.call(this);
|
||||
};
|
||||
|
||||
Table.prototype = Object.create(TabDataTable.prototype);
|
||||
Table.prototype.constructor = Table;
|
||||
Table.prototype.elementArray = _elementArray;
|
||||
Table.prototype.preUpdateView = _preUpdateView;
|
||||
Table.prototype.postUpdateView = _postUpdateView;
|
||||
|
||||
return Table;
|
||||
|
||||
@ -121,6 +127,7 @@ define(function(require) {
|
||||
|
||||
function _elementArray(element_json) {
|
||||
var element = element_json.DATASTORE;
|
||||
this.totalDSs++;
|
||||
|
||||
var clusters = '-';
|
||||
if (element.CLUSTERS.ID != undefined){
|
||||
@ -129,6 +136,12 @@ define(function(require) {
|
||||
|
||||
var state = OpenNebulaDatastore.stateStr(element.STATE);
|
||||
|
||||
if(state == "ON"){
|
||||
this.totalON++;
|
||||
} else if(state == "OFF"){
|
||||
this.totalOFF++;
|
||||
}
|
||||
|
||||
var search = {
|
||||
NAME: element.NAME,
|
||||
UNAME: element.UNAME,
|
||||
@ -157,4 +170,16 @@ define(function(require) {
|
||||
btoa(unescape(encodeURIComponent(JSON.stringify(search))))
|
||||
];
|
||||
}
|
||||
|
||||
function _preUpdateView() {
|
||||
this.totalDSs = 0;
|
||||
this.totalON = 0;
|
||||
this.totalOFF = 0;
|
||||
}
|
||||
|
||||
function _postUpdateView() {
|
||||
$(".total_ds").text(this.totalDSs);
|
||||
$(".total_on").text(this.totalON);
|
||||
$(".total_off").text(this.totalOFF);
|
||||
}
|
||||
});
|
||||
|
@ -45,7 +45,9 @@ define(function(require) {
|
||||
parentTab: "storage-top-tab",
|
||||
listHeader: Locale.tr("Files"),
|
||||
infoHeader: Locale.tr("File"),
|
||||
subheader: '',
|
||||
subheader: '<span>\
|
||||
<span class="total_files"/> <small>'+Locale.tr("TOTAL")+'</small>\
|
||||
</span>',
|
||||
resource: 'File',
|
||||
buttons: Buttons,
|
||||
actions: Actions,
|
||||
|
@ -47,12 +47,15 @@ define(function(require) {
|
||||
"you_selected_multiple": Locale.tr("You selected the following files:")
|
||||
};
|
||||
|
||||
this.totalFiles = 0;
|
||||
ImageCommonDataTable.call(this, RESOURCE, TAB_NAME, dataTableId, conf);
|
||||
};
|
||||
|
||||
Table.prototype = Object.create(ImageCommonDataTable.prototype);
|
||||
Table.prototype.constructor = Table;
|
||||
Table.prototype.elementArray = _elementArray;
|
||||
Table.prototype.preUpdateView = _preUpdateView;
|
||||
Table.prototype.postUpdateView = _postUpdateView;
|
||||
|
||||
return Table;
|
||||
|
||||
@ -69,6 +72,15 @@ define(function(require) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.totalFiles++;
|
||||
return this.elementArrayCommon(element_json);
|
||||
}
|
||||
|
||||
function _preUpdateView() {
|
||||
this.totalFiles = 0;
|
||||
}
|
||||
|
||||
function _postUpdateView() {
|
||||
$(".total_files").text(this.totalFiles);
|
||||
}
|
||||
});
|
@ -50,7 +50,8 @@ define(function(require) {
|
||||
parentTab: "storage-top-tab",
|
||||
listHeader: Locale.tr("Images"),
|
||||
infoHeader: Locale.tr("Image"),
|
||||
subheader: '',
|
||||
subheader: '<span class="total_images"/> <small>'+Locale.tr("TOTAL")+'</small> \
|
||||
<span class="size_images"/> <small>'+Locale.tr("TOTAL SIZE")+'</small>',
|
||||
resource: 'Image',
|
||||
buttons: Buttons,
|
||||
actions: Actions,
|
||||
|
@ -52,7 +52,9 @@ define(function(require) {
|
||||
parentTab: "storage-top-tab",
|
||||
listHeader: Locale.tr("Apps"),
|
||||
infoHeader: Locale.tr("App"),
|
||||
subheader: '',
|
||||
subheader: '<span>\
|
||||
<span class="total_apps"/> <small>'+Locale.tr("TOTAL")+'</small>\
|
||||
</span>',
|
||||
resource: 'MarketPlaceApp',
|
||||
buttons: Buttons,
|
||||
actions: Actions,
|
||||
|
@ -106,6 +106,8 @@ define(function(require) {
|
||||
"you_selected_multiple": Locale.tr("You selected the following appliances:")
|
||||
}
|
||||
|
||||
this.totalApps = 0;
|
||||
|
||||
this.conf.searchDropdownHTML = SearchDropdown({tableId: this.dataTableId});
|
||||
this.searchColumn = SEARCH_COLUMN;
|
||||
|
||||
@ -115,6 +117,8 @@ define(function(require) {
|
||||
Table.prototype = Object.create(TabDataTable.prototype);
|
||||
Table.prototype.constructor = Table;
|
||||
Table.prototype.elementArray = _elementArray;
|
||||
Table.prototype.preUpdateView = _preUpdateView;
|
||||
Table.prototype.postUpdateView = _postUpdateView;
|
||||
|
||||
return Table;
|
||||
|
||||
@ -128,6 +132,8 @@ define(function(require) {
|
||||
var state = OpenNebulaMarketPlaceApp.stateStr(element.STATE);
|
||||
var zone = OpenNebulaZone.getName(element.ZONE_ID);
|
||||
|
||||
this.totalApps++;
|
||||
|
||||
var search = {
|
||||
NAME: element.NAME,
|
||||
UNAME: element.UNAME,
|
||||
@ -168,4 +174,12 @@ define(function(require) {
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
function _preUpdateView() {
|
||||
this.totalApps = 0;
|
||||
}
|
||||
|
||||
function _postUpdateView() {
|
||||
$(".total_apps").text(this.totalApps);
|
||||
}
|
||||
});
|
||||
|
@ -51,7 +51,9 @@ define(function(require) {
|
||||
parentTab: "storage-top-tab",
|
||||
listHeader: Locale.tr("MarketPlaces"),
|
||||
infoHeader: Locale.tr("MarketPlace"),
|
||||
subheader: '',
|
||||
subheader: '<span>\
|
||||
<span class="total_markets"/> <small>'+Locale.tr("TOTAL")+'</small>\
|
||||
</span>',
|
||||
resource: 'MarketPlace',
|
||||
buttons: Buttons,
|
||||
actions: Actions,
|
||||
|
@ -104,12 +104,16 @@ define(function(require) {
|
||||
this.conf.searchDropdownHTML = SearchDropdown({tableId: this.dataTableId});
|
||||
this.searchColumn = SEARCH_COLUMN;
|
||||
|
||||
this.totalMarkets = 0;
|
||||
|
||||
TabDataTable.call(this);
|
||||
};
|
||||
|
||||
Table.prototype = Object.create(TabDataTable.prototype);
|
||||
Table.prototype.constructor = Table;
|
||||
Table.prototype.elementArray = _elementArray;
|
||||
Table.prototype.preUpdateView = _preUpdateView;
|
||||
Table.prototype.postUpdateView = _postUpdateView;
|
||||
|
||||
return Table;
|
||||
|
||||
@ -119,6 +123,7 @@ define(function(require) {
|
||||
|
||||
function _elementArray(element_json) {
|
||||
var element = element_json[XML_ROOT];
|
||||
this.totalMarkets++;
|
||||
|
||||
var zone = OpenNebulaZone.getName(element.ZONE_ID);
|
||||
|
||||
@ -156,4 +161,12 @@ define(function(require) {
|
||||
|
||||
return l;
|
||||
}
|
||||
|
||||
function _preUpdateView() {
|
||||
this.totalMarkets = 0;
|
||||
}
|
||||
|
||||
function _postUpdateView() {
|
||||
$(".total_markets").text(this.totalMarkets);
|
||||
}
|
||||
});
|
||||
|
@ -48,7 +48,9 @@ define(function(require) {
|
||||
parentTab: "network-top-tab",
|
||||
listHeader: Locale.tr("Security Groups"),
|
||||
infoHeader: Locale.tr("Security Group"),
|
||||
subheader: '',
|
||||
subheader: '<span>\
|
||||
<span class="total_secgroups"/> <small>'+Locale.tr("TOTAL")+'</small>\
|
||||
</span>',
|
||||
resource: 'SecurityGroup',
|
||||
buttons: Buttons,
|
||||
actions: Actions,
|
||||
|
@ -78,6 +78,8 @@ define(function(require) {
|
||||
"you_selected_multiple": Locale.tr("You selected the following security groups:")
|
||||
};
|
||||
|
||||
this.totalSecGroups = 0;
|
||||
|
||||
this.conf.searchDropdownHTML = SearchDropdown({tableId: this.dataTableId});
|
||||
this.searchColumn = SEARCH_COLUMN;
|
||||
|
||||
@ -87,6 +89,8 @@ define(function(require) {
|
||||
Table.prototype = Object.create(TabDataTable.prototype);
|
||||
Table.prototype.constructor = Table;
|
||||
Table.prototype.elementArray = _elementArray;
|
||||
Table.prototype.preUpdateView = _preUpdateView;
|
||||
Table.prototype.postUpdateView = _postUpdateView;
|
||||
|
||||
return Table;
|
||||
|
||||
@ -96,6 +100,7 @@ define(function(require) {
|
||||
|
||||
function _elementArray(element_json) {
|
||||
var element = element_json[XML_ROOT];
|
||||
this.totalSecGroups++;
|
||||
|
||||
var search = {
|
||||
NAME: element.NAME,
|
||||
@ -115,4 +120,12 @@ define(function(require) {
|
||||
btoa(unescape(encodeURIComponent(JSON.stringify(search))))
|
||||
];
|
||||
}
|
||||
|
||||
function _preUpdateView() {
|
||||
this.totalSecGroups = 0;
|
||||
}
|
||||
|
||||
function _postUpdateView() {
|
||||
$(".total_secgroups").text(this.totalSecGroups);
|
||||
}
|
||||
});
|
||||
|
@ -50,7 +50,9 @@ define(function(require) {
|
||||
parentTab: "templates-top-tab",
|
||||
listHeader: Locale.tr("VM Templates"),
|
||||
infoHeader: Locale.tr("VM Template"),
|
||||
subheader: '',
|
||||
subheader: '<span>\
|
||||
<span class="total_templates"/> <small>'+Locale.tr("TOTAL")+'</small>\
|
||||
</span>',
|
||||
resource: 'Template',
|
||||
buttons: Buttons,
|
||||
actions: Actions,
|
||||
|
@ -34,11 +34,14 @@ define(function(require) {
|
||||
|
||||
function Table(dataTableId, conf) {
|
||||
CommonDataTable.call(this, RESOURCE, TAB_NAME, dataTableId, conf);
|
||||
this.totalTemplates = 0;
|
||||
};
|
||||
|
||||
Table.prototype = Object.create(CommonDataTable.prototype);
|
||||
Table.prototype.constructor = Table;
|
||||
Table.prototype.elementArray = _elementArray;
|
||||
Table.prototype.preUpdateView = _preUpdateView;
|
||||
Table.prototype.postUpdateView = _postUpdateView;
|
||||
|
||||
return Table;
|
||||
|
||||
@ -55,6 +58,16 @@ define(function(require) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.totalTemplates++;
|
||||
|
||||
return this.elementArrayCommon(element_json);
|
||||
}
|
||||
|
||||
function _preUpdateView() {
|
||||
this.totalTemplates = 0;
|
||||
}
|
||||
|
||||
function _postUpdateView() {
|
||||
$(".total_templates").text(this.totalTemplates);
|
||||
}
|
||||
});
|
||||
|
@ -48,7 +48,9 @@ define(function(require) {
|
||||
parentTab: "templates-top-tab",
|
||||
listHeader: Locale.tr("Virtual Router VM Templates"),
|
||||
infoHeader: Locale.tr("Virtual Router VM Template"),
|
||||
subheader: '',
|
||||
subheader: '<span>\
|
||||
<span class="total_vrouters"/> <small>'+Locale.tr("TOTAL")+'</small>\
|
||||
</span>',
|
||||
resource: 'VirtualRouterTemplate',
|
||||
buttons: Buttons,
|
||||
actions: Actions,
|
||||
|
@ -34,11 +34,14 @@ define(function(require) {
|
||||
|
||||
function Table(dataTableId, conf) {
|
||||
CommonDataTable.call(this, RESOURCE, TAB_NAME, dataTableId, conf);
|
||||
this.totalVRouters = 0;
|
||||
};
|
||||
|
||||
Table.prototype = Object.create(CommonDataTable.prototype);
|
||||
Table.prototype.constructor = Table;
|
||||
Table.prototype.elementArray = _elementArray;
|
||||
Table.prototype.preUpdateView = _preUpdateView;
|
||||
Table.prototype.postUpdateView = _postUpdateView;
|
||||
|
||||
return Table;
|
||||
|
||||
@ -55,6 +58,16 @@ define(function(require) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this.totalVRouters++;
|
||||
|
||||
return this.elementArrayCommon(element_json);
|
||||
}
|
||||
|
||||
function _preUpdateView() {
|
||||
this.totalVRouters = 0;
|
||||
}
|
||||
|
||||
function _postUpdateView() {
|
||||
$(".total_vrouters").text(this.totalVRouters);
|
||||
}
|
||||
});
|
||||
|
@ -49,7 +49,9 @@ define(function(require) {
|
||||
parentTab: "instances-top-tab",
|
||||
listHeader: Locale.tr("Virtual Routers"),
|
||||
infoHeader: Locale.tr("Virtual Router"),
|
||||
subheader: '',
|
||||
subheader: '<span>\
|
||||
<span class="total_routers"/> <small>'+Locale.tr("TOTAL")+'</small>\
|
||||
</span>',
|
||||
resource: 'VirtualRouter',
|
||||
buttons: Buttons,
|
||||
actions: Actions,
|
||||
|
@ -78,6 +78,8 @@ define(function(require) {
|
||||
"you_selected_multiple": Locale.tr("You selected the following virtual routers:")
|
||||
};
|
||||
|
||||
this.totalRouters = 0;
|
||||
|
||||
this.conf.searchDropdownHTML = SearchDropdown({tableId: this.dataTableId});
|
||||
this.searchColumn = SEARCH_COLUMN;
|
||||
|
||||
@ -87,6 +89,8 @@ define(function(require) {
|
||||
Table.prototype = Object.create(TabDataTable.prototype);
|
||||
Table.prototype.constructor = Table;
|
||||
Table.prototype.elementArray = _elementArray;
|
||||
Table.prototype.preUpdateView = _preUpdateView;
|
||||
Table.prototype.postUpdateView = _postUpdateView;
|
||||
|
||||
return Table;
|
||||
|
||||
@ -96,6 +100,7 @@ define(function(require) {
|
||||
|
||||
function _elementArray(element_json) {
|
||||
var element = element_json[XML_ROOT];
|
||||
this.totalRouters++;
|
||||
|
||||
var search = {
|
||||
NAME: element.NAME,
|
||||
@ -115,4 +120,12 @@ define(function(require) {
|
||||
btoa(unescape(encodeURIComponent(JSON.stringify(search))))
|
||||
];
|
||||
}
|
||||
|
||||
function _preUpdateView() {
|
||||
this.totalRouters = 0;
|
||||
}
|
||||
|
||||
function _postUpdateView() {
|
||||
$(".total_routers").text(this.totalRouters);
|
||||
}
|
||||
});
|
||||
|
@ -43,7 +43,9 @@ define(function(require) {
|
||||
parentTab: "infrastructure-top-tab",
|
||||
listHeader: Locale.tr("Zones"),
|
||||
infoHeader: Locale.tr("Zone"),
|
||||
subheader: '',
|
||||
subheader: '<span>\
|
||||
<span class="total_zones"/> <small>'+Locale.tr("TOTAL")+'</small>\
|
||||
</span>',
|
||||
resource: 'Zone',
|
||||
buttons: Buttons,
|
||||
actions: Actions,
|
||||
|
@ -74,12 +74,16 @@ define(function(require) {
|
||||
"you_selected_multiple": Locale.tr("You selected the following Zones:")
|
||||
};
|
||||
|
||||
this.totalZones = 0;
|
||||
|
||||
TabDataTable.call(this);
|
||||
};
|
||||
|
||||
Table.prototype = Object.create(TabDataTable.prototype);
|
||||
Table.prototype.constructor = Table;
|
||||
Table.prototype.elementArray = _elementArray;
|
||||
Table.prototype.preUpdateView = _preUpdateView;
|
||||
Table.prototype.postUpdateView = _postUpdateView;
|
||||
|
||||
return Table;
|
||||
|
||||
@ -89,6 +93,7 @@ define(function(require) {
|
||||
|
||||
function _elementArray(element_json) {
|
||||
var element = element_json.ZONE;
|
||||
this.totalZones++;
|
||||
|
||||
return [
|
||||
'<input class="check_item" type="checkbox" id="' + RESOURCE.toLowerCase() + '_' +
|
||||
@ -100,4 +105,13 @@ define(function(require) {
|
||||
(LabelsUtils.labelsStr(element[TEMPLATE_ATTR])||'')
|
||||
];
|
||||
}
|
||||
|
||||
function _preUpdateView() {
|
||||
this.totalZones = 0;
|
||||
}
|
||||
|
||||
function _postUpdateView() {
|
||||
$(".total_zones").text(this.totalZones);
|
||||
}
|
||||
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user