mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-21 12:22:38 +09:00
Feature #4369: Show multiple clusters in sunstone
This commit is contained in:
1 parent
8a187be48e
commit
f2a2ec5555
15 files changed
+227
-14
No files matched your search
@@ -402,6 +402,7 @@ tabs:
|
||||
panel_tabs:
|
||||
datastore_info_tab: true
|
||||
datastore_image_tab: true
|
||||
datastore_clusters_tab: true
|
||||
table_columns:
|
||||
- 0 # Checkbox
|
||||
- 1 # ID
|
||||
@@ -555,6 +556,7 @@ tabs:
|
||||
vnet_leases_tab: true
|
||||
vnet_sg_list_tab: true
|
||||
vnet_vr_list_tab: true
|
||||
vnet_clusters_tab: true
|
||||
table_columns:
|
||||
- 0 # Checkbox
|
||||
- 1 # ID
|
||||
|
||||
@@ -402,6 +402,7 @@ tabs:
|
||||
panel_tabs:
|
||||
datastore_info_tab: true
|
||||
datastore_image_tab: true
|
||||
datastore_clusters_tab: true
|
||||
table_columns:
|
||||
- 0 # Checkbox
|
||||
- 1 # ID
|
||||
@@ -554,6 +555,7 @@ tabs:
|
||||
vnet_leases_tab: true
|
||||
vnet_sg_list_tab: false
|
||||
vnet_vr_list_tab: true
|
||||
vnet_clusters_tab: true
|
||||
table_columns:
|
||||
- 0 # Checkbox
|
||||
- 1 # ID
|
||||
|
||||
@@ -401,6 +401,7 @@ tabs:
|
||||
panel_tabs:
|
||||
datastore_info_tab: true
|
||||
datastore_image_tab: true
|
||||
datastore_clusters_tab: false
|
||||
table_columns:
|
||||
- 0 # Checkbox
|
||||
- 1 # ID
|
||||
@@ -554,6 +555,7 @@ tabs:
|
||||
vnet_leases_tab: true
|
||||
vnet_sg_list_tab: true
|
||||
vnet_vr_list_tab: false
|
||||
vnet_clusters_tab: false
|
||||
table_columns:
|
||||
- 0 # Checkbox
|
||||
- 1 # ID
|
||||
|
||||
@@ -403,6 +403,7 @@ tabs:
|
||||
panel_tabs:
|
||||
datastore_info_tab: true
|
||||
datastore_image_tab: true
|
||||
datastore_clusters_tab: false
|
||||
table_columns:
|
||||
- 0 # Checkbox
|
||||
- 1 # ID
|
||||
@@ -554,6 +555,7 @@ tabs:
|
||||
vnet_leases_tab: true
|
||||
vnet_sg_list_tab: false
|
||||
vnet_vr_list_tab: false
|
||||
vnet_clusters_tab: false
|
||||
table_columns:
|
||||
- 0 # Checkbox
|
||||
- 1 # ID
|
||||
|
||||
@@ -405,6 +405,7 @@ tabs:
|
||||
panel_tabs:
|
||||
datastore_info_tab: false
|
||||
datastore_image_tab: true
|
||||
datastore_clusters_tab: false
|
||||
table_columns:
|
||||
- 0 # Checkbox
|
||||
- 1 # ID
|
||||
@@ -558,6 +559,7 @@ tabs:
|
||||
vnet_leases_tab: true
|
||||
vnet_sg_list_tab: true
|
||||
vnet_vr_list_tab: true
|
||||
vnet_clusters_tab: false
|
||||
table_columns:
|
||||
- 0 # Checkbox
|
||||
- 1 # ID
|
||||
|
||||
@@ -33,7 +33,8 @@ define(function(require) {
|
||||
|
||||
var _panels = [
|
||||
require('./datastores-tab/panels/info'),
|
||||
require('./datastores-tab/panels/images')
|
||||
require('./datastores-tab/panels/images'),
|
||||
require('./datastores-tab/panels/clusters')
|
||||
];
|
||||
|
||||
var _panelsHooks = [
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */
|
||||
/* */
|
||||
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
|
||||
/* not use this file except in compliance with the License. You may obtain */
|
||||
/* a copy of the License at */
|
||||
/* */
|
||||
/* http://www.apache.org/licenses/LICENSE-2.0 */
|
||||
/* */
|
||||
/* Unless required by applicable law or agreed to in writing, software */
|
||||
/* distributed under the License is distributed on an "AS IS" BASIS, */
|
||||
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
|
||||
/* See the License for the specific language governing permissions and */
|
||||
/* limitations under the License. */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
define(function(require){
|
||||
/*
|
||||
DEPENDENCIES
|
||||
*/
|
||||
|
||||
var Locale = require('utils/locale');
|
||||
var ClustersTable = require('tabs/clusters-tab/datatable');
|
||||
|
||||
/*
|
||||
CONSTANTS
|
||||
*/
|
||||
|
||||
var PANEL_ID = require('./clusters/panelId');
|
||||
var CLUSTERS_TABLE_ID = PANEL_ID + "ClustersTable"
|
||||
var RESOURCE = "Datastore"
|
||||
|
||||
/*
|
||||
CONSTRUCTOR
|
||||
*/
|
||||
|
||||
function Panel(info) {
|
||||
this.title = Locale.tr("Clusters");
|
||||
this.icon = "fa-server";
|
||||
|
||||
this.element = info[RESOURCE.toUpperCase()];
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Panel.PANEL_ID = PANEL_ID;
|
||||
Panel.prototype.html = _html;
|
||||
Panel.prototype.setup = _setup;
|
||||
|
||||
return Panel;
|
||||
|
||||
/*
|
||||
FUNCTION DEFINITIONS
|
||||
*/
|
||||
|
||||
function _html() {
|
||||
var clusters = [];
|
||||
|
||||
if (this.element.CLUSTERS.ID != undefined){
|
||||
clusters = this.element.CLUSTERS.ID;
|
||||
|
||||
if (!$.isArray(clusters)){
|
||||
clusters = [clusters];
|
||||
}
|
||||
}
|
||||
|
||||
var opts = {
|
||||
info: true,
|
||||
select: true,
|
||||
selectOptions: {
|
||||
read_only: true,
|
||||
fixed_ids: clusters
|
||||
}
|
||||
};
|
||||
|
||||
this.clustersDataTable = new ClustersTable(CLUSTERS_TABLE_ID, opts);
|
||||
|
||||
return this.clustersDataTable.dataTableHTML;
|
||||
}
|
||||
|
||||
function _setup(context) {
|
||||
this.clustersDataTable.initialize();
|
||||
this.clustersDataTable.refreshResourceTableSelect();
|
||||
|
||||
return false;
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,19 @@
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */
|
||||
/* */
|
||||
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
|
||||
/* not use this file except in compliance with the License. You may obtain */
|
||||
/* a copy of the License at */
|
||||
/* */
|
||||
/* http://www.apache.org/licenses/LICENSE-2.0 */
|
||||
/* */
|
||||
/* Unless required by applicable law or agreed to in writing, software */
|
||||
/* distributed under the License is distributed on an "AS IS" BASIS, */
|
||||
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
|
||||
/* See the License for the specific language governing permissions and */
|
||||
/* limitations under the License. */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
define(function(require){
|
||||
return 'datastore_clusters_tab';
|
||||
})
|
||||
@@ -24,7 +24,6 @@ define(function(require) {
|
||||
var RenameTr = require('utils/panel/rename-tr');
|
||||
var TemplateTable = require('utils/panel/template-table');
|
||||
var PermissionsTable = require('utils/panel/permissions-table');
|
||||
var ClusterTr = require('utils/panel/cluster-tr');
|
||||
var OpenNebulaDatastore = require('opennebula/datastore');
|
||||
var DatastoreCapacityBar = require('../utils/datastore-capacity-bar');
|
||||
|
||||
@@ -68,7 +67,6 @@ define(function(require) {
|
||||
|
||||
function _html() {
|
||||
var renameTrHTML = RenameTr.html(TAB_ID, RESOURCE, this.element.NAME);
|
||||
var clusterTrHTML = ClusterTr.html(this.element.CLUSTER);
|
||||
var templateTableHTML = TemplateTable.html(
|
||||
this.element.TEMPLATE, RESOURCE,
|
||||
Locale.tr("Attributes"));
|
||||
@@ -85,7 +83,6 @@ define(function(require) {
|
||||
return TemplateInfo({
|
||||
'element': this.element,
|
||||
'renameTrHTML': renameTrHTML,
|
||||
'clusterTrHTML': clusterTrHTML,
|
||||
'templateTableHTML': templateTableHTML,
|
||||
'permissionsTableHTML': permissionsTableHTML,
|
||||
'capacityBar': capacityBar,
|
||||
@@ -97,7 +94,6 @@ define(function(require) {
|
||||
|
||||
function _setup(context) {
|
||||
RenameTr.setup(TAB_ID, RESOURCE, this.element.ID, context);
|
||||
ClusterTr.setup(RESOURCE, this.element.ID, this.element.CLUSTER_ID, context);
|
||||
TemplateTable.setup(this.element.TEMPLATE, RESOURCE, this.element.ID, context);
|
||||
PermissionsTable.setup(TAB_ID, RESOURCE, this.element, context);
|
||||
return false;
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
<td class="value_td" colspan="2">{{element.ID}}</td>
|
||||
</tr>
|
||||
{{{renameTrHTML}}}
|
||||
{{{clusterTrHTML}}}
|
||||
<tr>
|
||||
<td class="key_td">{{tr "State"}}</td>
|
||||
<td class="value_td">{{stateStr}}</td>
|
||||
|
||||
@@ -34,7 +34,8 @@ define(function(require) {
|
||||
require('./vnets-tab/panels/ar'),
|
||||
require('./vnets-tab/panels/leases'),
|
||||
require('./vnets-tab/panels/secgroups'),
|
||||
require('./vnets-tab/panels/vrouters')
|
||||
require('./vnets-tab/panels/vrouters'),
|
||||
require('./vnets-tab/panels/clusters')
|
||||
];
|
||||
|
||||
var _panelsHooks = [
|
||||
|
||||
@@ -0,0 +1,88 @@
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */
|
||||
/* */
|
||||
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
|
||||
/* not use this file except in compliance with the License. You may obtain */
|
||||
/* a copy of the License at */
|
||||
/* */
|
||||
/* http://www.apache.org/licenses/LICENSE-2.0 */
|
||||
/* */
|
||||
/* Unless required by applicable law or agreed to in writing, software */
|
||||
/* distributed under the License is distributed on an "AS IS" BASIS, */
|
||||
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
|
||||
/* See the License for the specific language governing permissions and */
|
||||
/* limitations under the License. */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
define(function(require){
|
||||
/*
|
||||
DEPENDENCIES
|
||||
*/
|
||||
|
||||
var Locale = require('utils/locale');
|
||||
var ClustersTable = require('tabs/clusters-tab/datatable');
|
||||
|
||||
/*
|
||||
CONSTANTS
|
||||
*/
|
||||
|
||||
var PANEL_ID = require('./clusters/panelId');
|
||||
var CLUSTERS_TABLE_ID = PANEL_ID + "ClustersTable"
|
||||
var RESOURCE = "Network";
|
||||
var XML_ROOT = "VNET";
|
||||
|
||||
/*
|
||||
CONSTRUCTOR
|
||||
*/
|
||||
|
||||
function Panel(info) {
|
||||
this.title = Locale.tr("Clusters");
|
||||
this.icon = "fa-server";
|
||||
|
||||
this.element = info[XML_ROOT];
|
||||
|
||||
return this;
|
||||
};
|
||||
|
||||
Panel.PANEL_ID = PANEL_ID;
|
||||
Panel.prototype.html = _html;
|
||||
Panel.prototype.setup = _setup;
|
||||
|
||||
return Panel;
|
||||
|
||||
/*
|
||||
FUNCTION DEFINITIONS
|
||||
*/
|
||||
|
||||
function _html() {
|
||||
var clusters = [];
|
||||
|
||||
if (this.element.CLUSTERS.ID != undefined){
|
||||
clusters = this.element.CLUSTERS.ID;
|
||||
|
||||
if (!$.isArray(clusters)){
|
||||
clusters = [clusters];
|
||||
}
|
||||
}
|
||||
|
||||
var opts = {
|
||||
info: true,
|
||||
select: true,
|
||||
selectOptions: {
|
||||
read_only: true,
|
||||
fixed_ids: clusters
|
||||
}
|
||||
};
|
||||
|
||||
this.clustersDataTable = new ClustersTable(CLUSTERS_TABLE_ID, opts);
|
||||
|
||||
return this.clustersDataTable.dataTableHTML;
|
||||
}
|
||||
|
||||
function _setup(context) {
|
||||
this.clustersDataTable.initialize();
|
||||
this.clustersDataTable.refreshResourceTableSelect();
|
||||
|
||||
return false;
|
||||
}
|
||||
})
|
||||
@@ -0,0 +1,19 @@
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* Copyright 2002-2015, OpenNebula Project, OpenNebula Systems */
|
||||
/* */
|
||||
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
|
||||
/* not use this file except in compliance with the License. You may obtain */
|
||||
/* a copy of the License at */
|
||||
/* */
|
||||
/* http://www.apache.org/licenses/LICENSE-2.0 */
|
||||
/* */
|
||||
/* Unless required by applicable law or agreed to in writing, software */
|
||||
/* distributed under the License is distributed on an "AS IS" BASIS, */
|
||||
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
|
||||
/* See the License for the specific language governing permissions and */
|
||||
/* limitations under the License. */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
define(function(require){
|
||||
return 'vnet_clusters_tab';
|
||||
})
|
||||
@@ -22,7 +22,6 @@ define(function(require) {
|
||||
var TemplateInfo = require('hbs!./info/html');
|
||||
var Locale = require('utils/locale');
|
||||
var PermissionsTable = require('utils/panel/permissions-table');
|
||||
var ClusterTr = require('utils/panel/cluster-tr');
|
||||
var RenameTr = require('utils/panel/rename-tr');
|
||||
var OpenNebulaNetwork = require('opennebula/network');
|
||||
|
||||
@@ -66,7 +65,6 @@ define(function(require) {
|
||||
|
||||
function _html() {
|
||||
var renameTrHTML = RenameTr.html(TAB_ID, RESOURCE, this.element.NAME);
|
||||
var clusterTrHTML = ClusterTr.html(this.element.CLUSTER);
|
||||
var permissionsTableHTML = PermissionsTable.html(TAB_ID, RESOURCE, this.element);
|
||||
|
||||
// TODO: simplify interface?
|
||||
@@ -101,7 +99,6 @@ define(function(require) {
|
||||
return TemplateInfo({
|
||||
'element': this.element,
|
||||
'renameTrHTML': renameTrHTML,
|
||||
'clusterTrHTML': clusterTrHTML,
|
||||
'reservationTrHTML': reservationTrHTML,
|
||||
'permissionsTableHTML': permissionsTableHTML,
|
||||
'templateTableHTML': templateTableHTML
|
||||
@@ -110,7 +107,6 @@ define(function(require) {
|
||||
|
||||
function _setup(context) {
|
||||
RenameTr.setup(TAB_ID, RESOURCE, this.element.ID, context);
|
||||
ClusterTr.setup(RESOURCE, this.element.ID, this.element.CLUSTER_ID, context);
|
||||
PermissionsTable.setup(TAB_ID, RESOURCE, this.element, context);
|
||||
|
||||
// TODO: simplify interface?
|
||||
|
||||
@@ -29,9 +29,6 @@
|
||||
<td></td>
|
||||
</tr>
|
||||
{{{renameTrHTML}}}
|
||||
<tr>
|
||||
{{{clusterTrHTML}}}
|
||||
</tr>
|
||||
{{{reservationTrHTML}}}
|
||||
<tbody>
|
||||
</table>
|
||||
|
||||
Reference in new issue
Block a user