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

F #4506: Fix create service dialog (#4559)

This commit is contained in:
Sergio Betanzos 2020-04-20 15:05:25 +02:00 committed by GitHub
parent 272bf36404
commit 057e5cc4d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 1 deletions

View File

@ -35,7 +35,6 @@ define(function(require) {
var _actions = {
"ServiceTemplate.create" : _commonActions.create(CREATE_DIALOG_ID),
"ServiceTemplate.create_dialog" : _commonActions.showCreate(CREATE_DIALOG_ID),
"ServiceTemplate.show" : _commonActions.show(),
"ServiceTemplate.refresh" : _commonActions.refresh(),
"ServiceTemplate.delete" : _commonActions.del(),
@ -46,6 +45,14 @@ define(function(require) {
"ServiceTemplate.update" : _commonActions.update(),
"ServiceTemplate.update_dialog" : _commonActions.checkAndShowUpdate(),
"ServiceTemplate.create_dialog" : {
type: "custom",
call: function() {
Sunstone.runAction("Network.list");
Sunstone.runAction("VNTemplate.list");
Sunstone.showFormPanel(TAB_ID, CREATE_DIALOG_ID, "create");
}
},
"ServiceTemplate.show_to_update" : {
type: "single",
call: function(params) {

View File

@ -611,8 +611,17 @@ define(function(require) {
function _get_networks() {
var networks = OpenNebulaAction.cache("VNET");
if (networks === undefined) {
Sunstone.runAction("Network.list");
networks = OpenNebulaAction.cache("VNET");
}
networks = networks ? networks.data : [];
var vntemplates = OpenNebulaAction.cache("VNTEMPLATE");
if (vntemplates === undefined) {
Sunstone.runAction("VNTemplate.list");
vntemplates = OpenNebulaAction.cache("VNTEMPLATE");
}
vntemplates = vntemplates ? vntemplates.data : [];
// Get networks list