1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-04-01 06:50:25 +03:00

Feature #4513: Show zombie VMs in a table

This commit is contained in:
Jaime Melis 2016-06-07 16:50:25 +02:00
parent 9d94f90812
commit 8f9c92b9e1
10 changed files with 162 additions and 6 deletions

View File

@ -45,7 +45,7 @@ tabs:
# bellow. As the name suggest, the widgets will be scaled to fit one,
# two, or three per row. The footer uses the widgets at full size, i.e.
# one per row.
#
#
# - storage
# - users
# - network
@ -447,6 +447,7 @@ tabs:
host_monitoring_tab: true
host_vms_tab: true
host_wilds_tab: true
host_zombies_tab: true
host_esx_tab: true
host_pci_tab: true
table_columns:

View File

@ -45,7 +45,7 @@ tabs:
# bellow. As the name suggest, the widgets will be scaled to fit one,
# two, or three per row. The footer uses the widgets at full size, i.e.
# one per row.
#
#
# - storage
# - users
# - network
@ -423,6 +423,7 @@ tabs:
host_monitoring_tab: true
host_vms_tab: true
host_wilds_tab: true
host_zombies_tab: true
host_esx_tab: true
host_pci_tab: true
table_columns:

View File

@ -45,7 +45,7 @@ tabs:
# bellow. As the name suggest, the widgets will be scaled to fit one,
# two, or three per row. The footer uses the widgets at full size, i.e.
# one per row.
#
#
# - storage
# - users
# - network
@ -424,6 +424,7 @@ tabs:
host_monitoring_tab: true
host_vms_tab: true
host_wilds_tab: true
host_zombies_tab: true
host_esx_tab: true
host_pci_tab: true
table_columns:

View File

@ -45,7 +45,7 @@ tabs:
# bellow. As the name suggest, the widgets will be scaled to fit one,
# two, or three per row. The footer uses the widgets at full size, i.e.
# one per row.
#
#
# - storage
# - users
# - network
@ -426,6 +426,7 @@ tabs:
host_monitoring_tab: true
host_vms_tab: true
host_wilds_tab: true
host_zombies_tab: true
host_esx_tab: true
host_pci_tab: true
table_columns:

View File

@ -45,7 +45,7 @@ tabs:
# bellow. As the name suggest, the widgets will be scaled to fit one,
# two, or three per row. The footer uses the widgets at full size, i.e.
# one per row.
#
#
# - storage
# - users
# - network
@ -425,6 +425,7 @@ tabs:
host_monitoring_tab: true
host_vms_tab: true
host_wilds_tab: true
host_zombies_tab: true
host_esx_tab: true
host_pci_tab: true
table_columns:

View File

@ -33,6 +33,7 @@ define(function(require) {
require('./hosts-tab/panels/monitor'),
require('./hosts-tab/panels/vms'),
require('./hosts-tab/panels/wilds'),
require('./hosts-tab/panels/zombies'),
require('./hosts-tab/panels/esx'),
require('./hosts-tab/panels/pci')
];

View File

@ -67,7 +67,7 @@ define(function(require) {
// object to be used when the host info is updated.
that.unshownTemplate = {};
that.strippedTemplate = {};
var unshownKeys = ['HOST', 'VM', 'WILDS', 'RESERVED_CPU', 'RESERVED_MEM'];
var unshownKeys = ['HOST', 'VM', 'WILDS', 'ZOMBIES', 'RESERVED_CPU', 'RESERVED_MEM'];
$.each(that.element.TEMPLATE, function(key, value) {
if ($.inArray(key, unshownKeys) > -1) {
that.unshownTemplate[key] = value;

View File

@ -0,0 +1,103 @@
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2016, 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
*/
require('datatables.net');
require('datatables.foundation');
var Locale = require('utils/locale');
var OpenNebulaHost = require('opennebula/host');
var OpenNebulaAction = require('opennebula/action');
var Sunstone = require('sunstone');
var Notifier = require('utils/notifier');
/*
TEMPLATES
*/
var TemplateZombies = require('hbs!./zombies/html');
/*
CONSTANTS
*/
var PANEL_ID = require('./zombies/panelId');
var RESOURCE = "Host"
/*
CONSTRUCTOR
*/
function Panel(info) {
this.title = Locale.tr("Zombies");
this.icon = "fa-bug";
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() {
return TemplateZombies();
}
function _setup(context) {
var that = this;
that.dataTableZombieHosts = $("#datatable_host_zombies", context).dataTable({
"bSortClasses" : false,
"bDeferRender": true,
"bAutoWidth": false,
"aoColumnDefs": [
{"bSortable": false, "aTargets": [0]},
{"sWidth": "35px", "aTargets": [0]}
]
});
if (that.element.TEMPLATE.ZOMBIES) {
var zombies = that.element.TEMPLATE.ZOMBIES;
zombies = zombies.split(", ");
$.each(zombies, function(index, elem) {
var zombies_list_array = [
[
elem
]
];
that.dataTableZombieHosts.fnAddData(zombies_list_array);
});
}
delete that.element.TEMPLATE.ZOMBIES;
return false;
}
});

View File

@ -0,0 +1,28 @@
{{! -------------------------------------------------------------------------- }}
{{! Copyright 2002-2016, 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. }}
{{! -------------------------------------------------------------------------- }}
<div class="row">
<div class="large-12 columns">
<table id="datatable_host_zombies" class="datatable twelve">
<thead>
<tr>
<th>{{tr "VM name"}}</th>
</tr>
</thead>
<tbody id="tbody_host_zombies"></tbody>
</table>
</div>
</div>

View File

@ -0,0 +1,19 @@
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2016, 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 'host_zombies_tab';
})