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:
parent
e90f0693c1
commit
6685f75af8
@ -349,6 +349,7 @@ tabs:
|
||||
#- 8 # TM
|
||||
#- 9 # DS
|
||||
- 10 # Type
|
||||
- 11 # Status
|
||||
actions:
|
||||
Datastore.refresh: true
|
||||
Datastore.create_dialog: true
|
||||
|
@ -350,6 +350,7 @@ tabs:
|
||||
#- 8 # TM
|
||||
#- 9 # DS
|
||||
#- 10 # Type
|
||||
#- 11 # Status
|
||||
actions:
|
||||
Datastore.refresh: true
|
||||
Datastore.create_dialog: false
|
||||
|
@ -349,6 +349,7 @@ tabs:
|
||||
#- 8 # TM
|
||||
#- 9 # DS
|
||||
- 10 # Type
|
||||
- 11 # Status
|
||||
actions:
|
||||
Datastore.refresh: true
|
||||
Datastore.create_dialog: true
|
||||
|
@ -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"
|
||||
|
@ -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");
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -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>\
|
||||
|
@ -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 = [];
|
||||
|
Loading…
Reference in New Issue
Block a user