1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

B #5146: Fix ready status vms in role tab (#356)

(cherry picked from commit 45955f332c1e50076613d0ba168427bd42f239bf)
This commit is contained in:
Sergio Betanzos 2020-10-23 13:44:52 +02:00 committed by Tino Vazquez
parent 2cd2d7d8cd
commit b8372e3806
No known key found for this signature in database
GPG Key ID: 14201E424D02047E
2 changed files with 13 additions and 2 deletions

View File

@ -200,6 +200,7 @@ define(function(require) {
function _roleHTML(context, role_index) {
var that = this;
var role = this.element.TEMPLATE.BODY.roles[role_index];
var ready_status_gate = that.element.TEMPLATE.BODY.ready_status_gate;
var promises = [];
var roleVms = [];
@ -215,6 +216,14 @@ define(function(require) {
function successCallback (data) {
if (data.VM && data.VM.ID === id) {
var ready = ""
if (ready_status_gate) {
ready = (data.VM.USER_TEMPLATE && data.VM.USER_TEMPLATE.READY == "YES")
? '<span class="has-tip" title="'+
Locale.tr("The VM is ready")+'"><i class="fas fa-check"/></span>'
: '<span class="has-tip" title="'+
Locale.tr("Waiting for the VM to be ready")+'"><i class="fas fa-clock"/></span>'
}
ips = OpenNebulaVM.ipsStr(data.VM);
if (OpenNebulaVM.isVNCSupported(data.VM)) {
@ -231,7 +240,7 @@ define(function(require) {
actions += rdp ? OpenNebulaVM.buttonRDP(rdp.IP, data.VM) : "";
}
roleVms[index] = rowInfoRoleVm(id, name, uname, gname, ips, actions);
roleVms[index] = rowInfoRoleVm(ready, id, name, uname, gname, ips, actions);
}
promises.push(promiseVmInfo(id, successCallback))
@ -262,8 +271,9 @@ define(function(require) {
});
}
function rowInfoRoleVm(id, name = "", uname = "", gname = "", ips = "", actions = "") {
function rowInfoRoleVm(ready, id, name = "", uname = "", gname = "", ips = "", actions = "") {
return [
ready,
'<input class="check_item" style="vertical-align: inherit;" type="checkbox" '+
'id="vm_' + id + '" name="selected_items" value="' + id + '"/>',
'<a href="/#vms-tab/' + id + '">'+ id +'</a>',

View File

@ -50,6 +50,7 @@
<table id="datatable_vms_{{panelId}}_{{role.name}}" class="dataTable hover ">
<thead>
<tr>
<th></th>
<th class="check">
<input type="checkbox" class="check_all" value=""></input>
</th>