From f1a712795d72e92cdc4323bd155ff292e07a6633 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 17 Dec 2015 17:25:24 +0100 Subject: [PATCH] feature #4184: Add labels support to groups-tab --- src/sunstone/etc/sunstone-views/admin.yaml | 1 + src/sunstone/etc/sunstone-views/admin_vcenter.yaml | 1 + src/sunstone/etc/sunstone-views/user.yaml | 1 + src/sunstone/public/app/tabs/groups-tab/datatable.js | 10 ++++++++-- 4 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/sunstone/etc/sunstone-views/admin.yaml b/src/sunstone/etc/sunstone-views/admin.yaml index 803b4fdbab..f2fb08c26f 100644 --- a/src/sunstone/etc/sunstone-views/admin.yaml +++ b/src/sunstone/etc/sunstone-views/admin.yaml @@ -89,6 +89,7 @@ tabs: - 4 # VMs - 5 # Memory - 6 # CPU + #- 7 # Labels actions: Group.refresh: true Group.create_dialog: true diff --git a/src/sunstone/etc/sunstone-views/admin_vcenter.yaml b/src/sunstone/etc/sunstone-views/admin_vcenter.yaml index 423d072314..01b9e4faf6 100644 --- a/src/sunstone/etc/sunstone-views/admin_vcenter.yaml +++ b/src/sunstone/etc/sunstone-views/admin_vcenter.yaml @@ -89,6 +89,7 @@ tabs: - 4 # VMs - 5 # Memory - 6 # CPU + #- 7 # Labels actions: Group.refresh: true Group.create_dialog: true diff --git a/src/sunstone/etc/sunstone-views/user.yaml b/src/sunstone/etc/sunstone-views/user.yaml index 481984cd89..7adce14617 100644 --- a/src/sunstone/etc/sunstone-views/user.yaml +++ b/src/sunstone/etc/sunstone-views/user.yaml @@ -90,6 +90,7 @@ tabs: - 4 # VMs - 5 # Memory - 6 # CPU + #- 7 # Labels actions: Group.refresh: true Group.create_dialog: true diff --git a/src/sunstone/public/app/tabs/groups-tab/datatable.js b/src/sunstone/public/app/tabs/groups-tab/datatable.js index 8b7f8d785d..4669f50dcd 100644 --- a/src/sunstone/public/app/tabs/groups-tab/datatable.js +++ b/src/sunstone/public/app/tabs/groups-tab/datatable.js @@ -24,6 +24,7 @@ define(function(require) { var Locale = require('utils/locale'); var QuotaDefaults = require('utils/quotas/quota-defaults'); var QuotaWidgets = require('utils/quotas/quota-widgets'); + var LabelsUtils = require('utils/labels/utils'); /* CONSTANTS @@ -32,6 +33,8 @@ define(function(require) { var RESOURCE = "Group"; var XML_ROOT = "GROUP"; var TAB_NAME = require('./tabId'); + var LABELS_COLUMN = 7; + var TEMPLATE_ATTR = 'TEMPLATE'; /* CONSTRUCTOR @@ -43,6 +46,7 @@ define(function(require) { this.dataTableId = dataTableId; this.resource = RESOURCE; this.xmlRoot = XML_ROOT; + this.labelsColumn = LABELS_COLUMN; this.dataTableOptions = { "bAutoWidth": false, @@ -63,7 +67,8 @@ define(function(require) { Locale.tr("Users"), Locale.tr("VMs"), Locale.tr("Memory"), - Locale.tr("CPU") + Locale.tr("CPU"), + Locale.tr("Labels") ]; this.selectOptions = { @@ -141,7 +146,8 @@ define(function(require) { users_str, vms, memory, - cpu + cpu, + (LabelsUtils.labelsStr(element[TEMPLATE_ATTR])||'') ]; }