From ea60c75da318ea4d99c7e98a3fa5d0dcf22de890 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Mon, 18 May 2015 16:57:47 +0200 Subject: [PATCH] feature #3748: Define stateStr and simpleStateStr for hosts --- src/sunstone/public/app/opennebula/host.js | 28 ++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/sunstone/public/app/opennebula/host.js b/src/sunstone/public/app/opennebula/host.js index 5a15717c90..b4d2c23a20 100644 --- a/src/sunstone/public/app/opennebula/host.js +++ b/src/sunstone/public/app/opennebula/host.js @@ -3,8 +3,36 @@ define(function(require) { var RESOURCE = "HOST"; + var STATES = [ + "INIT", + "MONITORING_MONITORED", + "MONITORED", + "ERROR", + "DISABLED", + "MONITORING_ERROR", + "MONITORING_INIT", + "MONITORING_DISABLED" + ] + + var SIMPLE_STATES = [ + "INIT", + "UPDATE", + "ON", + "ERROR", + "OFF", + "RETRY", + "INIT", + "OFF" + ] + var Host = { "resource": RESOURCE, + "stateStr": function(stateId) { + return STATES[stateId]; + }, + "simpleStateStr": function(stateId) { + return SIMPLE_STATES[stateId]; + }, "create": function(params) { OpenNebulaAction.create(params, RESOURCE); },