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

F #1271: Added possibility to use the utility without resource (#1803)

This commit is contained in:
juanmont 2018-02-27 18:30:23 +01:00 committed by Tino Vázquez
parent d75d7341ec
commit cbad565f0e

View File

@ -85,15 +85,19 @@ define(function(require) {
FUNCTION DEFINITIONS
*/
function _state_lock_to_color(resource,state,lock){
function _state_lock_to_color(resource, state, lock, set_color){
var color = "transparent";
var show_lock = "";
if (state && resource in resource_states){
var available_states = resource_states[resource];
if (state in available_states){
color = available_states[state];
if ( set_color == undefined ) {
if (state && resource in resource_states){
var available_states = resource_states[resource];
if (state in available_states){
color = available_states[state];
}
}
} else {
color = set_color;
}
if (lock){