diff --git a/src/sunstone/public/app/tabs/datastores-tab.js b/src/sunstone/public/app/tabs/datastores-tab.js index 80b76a0d99..5b2347f691 100644 --- a/src/sunstone/public/app/tabs/datastores-tab.js +++ b/src/sunstone/public/app/tabs/datastores-tab.js @@ -8,7 +8,10 @@ define(function(require) { var DATATABLE_ID = "dataTableDatastores"; var _dialogs = [ - require('./datastores-tab/dialogs/create') + ]; + + var _formPanels = [ + require('./datastores-tab/form-panels/create') ]; var _panels = [ @@ -29,6 +32,7 @@ define(function(require) { actions: Actions, dataTable: new Table(DATATABLE_ID, {actions: true, info: true}), panels: _panels, + formPanels: _formPanels, dialogs: _dialogs }; diff --git a/src/sunstone/public/app/tabs/datastores-tab/actions.js b/src/sunstone/public/app/tabs/datastores-tab/actions.js index 2ca9aa7976..3b2388b6eb 100644 --- a/src/sunstone/public/app/tabs/datastores-tab/actions.js +++ b/src/sunstone/public/app/tabs/datastores-tab/actions.js @@ -7,25 +7,28 @@ define(function(require) { var OpenNebulaAction = require('opennebula/action'); var TAB_ID = require('./tabId'); - var CREATE_DIALOG_ID = require('./dialogs/create/dialogId'); + var CREATE_DIALOG_ID = require('./form-panels/create/formPanelId'); var _actions = { "Datastore.create" : { type: "create", call : OpenNebulaDatastore.create, callback : function(request, response) { - Sunstone.getDialog(CREATE_DIALOG_ID).hide(); - Sunstone.getDialog(CREATE_DIALOG_ID).reset(); + Sunstone.resetFormPanel(TAB_ID, CREATE_DIALOG_ID); + Sunstone.hideFormPanel(TAB_ID); Sunstone.getDataTable(TAB_ID).addElement(request, response); Notifier.notifyCustom(Locale.tr("Datastore created"), " ID: " + response.DATASTORE.ID, false); }, - error : Notifier.onError + error: function(request, response) { + Sunstone.hideFormPanelLoading(TAB_ID); + Notifier.onError(request, response); + }, }, "Datastore.create_dialog" : { type: "custom", call: function() { - Sunstone.getDialog(CREATE_DIALOG_ID).show(); + Sunstone.showFormPanel(TAB_ID, CREATE_DIALOG_ID, "create"); } }, diff --git a/src/sunstone/public/app/tabs/datastores-tab/dialogs/create/dialogId.js b/src/sunstone/public/app/tabs/datastores-tab/dialogs/create/dialogId.js deleted file mode 100644 index 3bc3e063cd..0000000000 --- a/src/sunstone/public/app/tabs/datastores-tab/dialogs/create/dialogId.js +++ /dev/null @@ -1,3 +0,0 @@ -define(function(require){ - return 'createDatastoreDialog'; -}) \ No newline at end of file diff --git a/src/sunstone/public/app/tabs/datastores-tab/dialogs/create/html.hbs b/src/sunstone/public/app/tabs/datastores-tab/dialogs/create/html.hbs deleted file mode 100644 index a796acc055..0000000000 --- a/src/sunstone/public/app/tabs/datastores-tab/dialogs/create/html.hbs +++ /dev/null @@ -1,295 +0,0 @@ -