1
0
mirror of https://github.com/OpenNebula/one.git synced 2024-12-23 17:33:56 +03:00

Feature #3456: DS enable/disable in sunstone

This commit is contained in:
Carlos Martín 2015-02-13 16:42:18 +01:00
parent e90f0693c1
commit 6685f75af8
7 changed files with 59 additions and 3 deletions

View File

@ -349,6 +349,7 @@ tabs:
#- 8 # TM
#- 9 # DS
- 10 # Type
- 11 # Status
actions:
Datastore.refresh: true
Datastore.create_dialog: true

View File

@ -350,6 +350,7 @@ tabs:
#- 8 # TM
#- 9 # DS
#- 10 # Type
#- 11 # Status
actions:
Datastore.refresh: true
Datastore.create_dialog: false

View File

@ -349,6 +349,7 @@ tabs:
#- 8 # TM
#- 9 # DS
- 10 # Type
- 11 # Status
actions:
Datastore.refresh: true
Datastore.create_dialog: true

View File

@ -51,6 +51,8 @@ module OpenNebulaJSON
when "chown" then self.chown(action_hash['params'])
when "chmod" then self.chmod_octet(action_hash['params'])
when "rename" then self.rename(action_hash['params'])
when "enable" then self.enable
when "disable" then self.disable
else
error_msg = "#{action_hash['perform']} action not " <<
" available for this resource"

View File

@ -164,6 +164,11 @@ var OpenNebula = {
"DELETE",
"USED_PERS"][value]);
break;
case "DATASTORE":
case "datastore":
state = tr(["READY",
"DISABLED"][value]);
break;
case "VM_MIGRATE_REASON":
case "vm_migrate_reason":
state = tr(["NONE",
@ -1500,6 +1505,12 @@ var OpenNebula = {
OpenNebula.Datastore.resource,
"rename",
action_obj);
},
"enable": function(params){
OpenNebula.Action.simple_action(params,OpenNebula.Datastore.resource,"enable");
},
"disable": function(params){
OpenNebula.Action.simple_action(params,OpenNebula.Datastore.resource,"disable");
}
},

View File

@ -489,6 +489,28 @@ var datastore_actions = {
},
error: onError,
notify: true
},
"Datastore.enable" : {
type: "multiple",
call: OpenNebula.Datastore.enable,
callback: function (req) {
Sunstone.runAction("Datastore.show",req.request.data[0]);
},
elements: datastoreElements,
error: onError,
notify: true
},
"Datastore.disable" : {
type: "multiple",
call: OpenNebula.Datastore.disable,
callback: function (req) {
Sunstone.runAction("Datastore.show",req.request.data[0]);
},
elements: datastoreElements,
error: onError,
notify: true
}
};
@ -538,6 +560,16 @@ var datastore_buttons = {
layout: "del",
condition: mustBeAdmin
},
"Datastore.enable" : {
type: "action",
layout: "more_select",
text: tr("Enable")
},
"Datastore.disable" : {
type: "action",
layout: "more_select",
text: tr("Disable")
}
}
var datastore_info_panel = {
@ -571,6 +603,7 @@ var datastores_tab = {
<th>'+tr("TM MAD")+'</th>\
<th>'+tr("DS MAD")+'</th>\
<th>'+tr("Type")+'</th>\
<th>'+tr("Status")+'</th>\
</tr>\
</thead>\
<tbody id="tbodydatastores">\
@ -632,7 +665,8 @@ function datastoreElementArray(element_json){
element.BASE_PATH,
element.TM_MAD,
element.DS_MAD,
ds_type_str.toLowerCase().split('_')[0]
ds_type_str.toLowerCase().split('_')[0],
OpenNebula.Helper.resource_state("datastore",element.STATE)
];
}
@ -720,6 +754,11 @@ function updateDatastoreInfo(request,ds){
'<tr>'+
cluster_str +
'</tr>\
<tr>\
<td class="key_td">'+tr("State")+'</td>\
<td class="value_td">'+OpenNebula.Helper.resource_state("datastore",info.STATE)+'</td>\
<td></td>\
</tr>\
<tr>\
<td class="key_td">'+tr("Base path")+'</td>\
<td class="value_td">'+info.BASE_PATH+'</td>\

View File

@ -6443,7 +6443,8 @@ function generateDatastoreTableSelect(context_id){
tr("Basepath"),
tr("TM MAD"),
tr("DS MAD"),
tr("Type")
tr("Type"),
tr("Status")
];
var options = {
@ -6546,7 +6547,7 @@ function setupDatastoreTableSelect(section, context_id, opts){
}
});
var n_columns = 11; // SET FOR EACH RESOURCE
var n_columns = 12; // SET FOR EACH RESOURCE
$.each(fixed_ids_map, function(id,v){
var empty = [];