diff --git a/src/sunstone/public/app/tabs/datastores-tab/form-panels/import.js b/src/sunstone/public/app/tabs/datastores-tab/form-panels/import.js index 874c87f183..229fef1ad1 100644 --- a/src/sunstone/public/app/tabs/datastores-tab/form-panels/import.js +++ b/src/sunstone/public/app/tabs/datastores-tab/form-panels/import.js @@ -82,25 +82,32 @@ define(function(require) { function _setup(context) { var that = this; - Sunstone.disableFormPanelSubmit(TAB_ID); + $("form.vcenter_credentials", context) + .off('forminvalid.zf.abide').off('formvalid.zf.abide').off("submit"); - $("#get_vcenter_datastores", context).on("click", function(){ - Sunstone.enableFormPanelSubmit(TAB_ID); + Foundation.reInit($("form.vcenter_credentials", context)); - var vcenter_user = $("#vcenter_user", context).val(); - var vcenter_password = $("#vcenter_password", context).val(); - var vcenter_host = $("#vcenter_host", context).val(); + $("form.vcenter_credentials", context) + .on('forminvalid.zf.abide', function(ev, frm) { + }) + .on('formvalid.zf.abide', function(ev, frm) { + Sunstone.enableFormPanelSubmit(TAB_ID); - that.vCenterDatastores.insert({ - container: context, - vcenter_user: vcenter_user, - vcenter_password: vcenter_password, - vcenter_host: vcenter_host + var vcenter_user = $("#vcenter_user", context).val(); + var vcenter_password = $("#vcenter_password", context).val(); + var vcenter_host = $("#vcenter_host", context).val(); + + that.vCenterDatastores.insert({ + container: context, + vcenter_user: vcenter_user, + vcenter_password: vcenter_password, + vcenter_host: vcenter_host + }); + }) + .on("submit", function(ev) { + ev.preventDefault(); }); - return false; - }); - return false; } @@ -109,7 +116,7 @@ define(function(require) { Sunstone.hideFormPanelLoading(TAB_ID); - this.vCenterDatastores.import(context); + this.vCenterDatastores.import(context.closest("#import_datastores_form_wrapper")); return false; } diff --git a/src/sunstone/public/app/tabs/datastores-tab/form-panels/import/html.hbs b/src/sunstone/public/app/tabs/datastores-tab/form-panels/import/html.hbs index d3bd534127..911c570014 100644 --- a/src/sunstone/public/app/tabs/datastores-tab/form-panels/import/html.hbs +++ b/src/sunstone/public/app/tabs/datastores-tab/form-panels/import/html.hbs @@ -14,28 +14,32 @@ {{! limitations under the License. }} {{! -------------------------------------------------------------------------- }} -
-
-
- - +
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
-
- - -
-
- - -
- -
+
{{{vCenterDatastoresHTML}}}
- +
\ No newline at end of file diff --git a/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js b/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js index 1058901620..3f0465a5f5 100644 --- a/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js +++ b/src/sunstone/public/app/tabs/hosts-tab/form-panels/create.js @@ -140,33 +140,38 @@ define(function(require) { $("#host_type_mad", context).change(); - $("#get_vcenter_clusters", context).on("click", function() { - // TODO notify if credentials empty + $("form.vcenter_credentials", context) + .off('forminvalid.zf.abide').off('formvalid.zf.abide').off("submit"); - var vcenter_user = $("#vcenter_user", context).val(); - var vcenter_password = $("#vcenter_password", context).val(); - var vcenter_host = $("#vcenter_host", context).val(); + Foundation.reInit($("form.vcenter_credentials", context)); - that.vCenterClusters.insert({ - container: context, - vcenter_user: vcenter_user, - vcenter_password: vcenter_password, - vcenter_host: vcenter_host, - success: function(){ - $("#vcenter_user", context).attr("disabled", "disabled"); - $("#vcenter_password", context).attr("disabled", "disabled"); - $("#vcenter_host", context).attr("disabled", "disabled"); - $("#get_vcenter_clusters", context).hide(); - $(".import_vcenter_clusters_div", context).show(); - } + $("form.vcenter_credentials", context) + .on('forminvalid.zf.abide', function(ev, frm) { + }) + .on('formvalid.zf.abide', function(ev, frm) { + var vcenter_user = $("#vcenter_user", context).val(); + var vcenter_password = $("#vcenter_password", context).val(); + var vcenter_host = $("#vcenter_host", context).val(); + + that.vCenterClusters.insert({ + container: context, + vcenter_user: vcenter_user, + vcenter_password: vcenter_password, + vcenter_host: vcenter_host, + success: function(){ + $("#vcenter_user", context).attr("disabled", "disabled"); + $("#vcenter_password", context).attr("disabled", "disabled"); + $("#vcenter_host", context).attr("disabled", "disabled"); + $("#get_vcenter_clusters", context).hide(); + $(".import_vcenter_clusters_div", context).show(); + } + }) + }) + .on("submit", function(ev) { + ev.preventDefault(); }); - return false; - }); - $("#import_vcenter_clusters", context).on("click", function() { - $(this).hide(); - var cluster_id = $('#host_cluster_id .resource_list_select', context).val(); if (!cluster_id) cluster_id = "-1"; @@ -193,14 +198,6 @@ define(function(require) { $('input[name="custom_im_mad"]').parent().hide(); }); - $('#create_host_form').on("keyup keypress", function(e) { - var code = e.keyCode || e.which; - if (code == 13) { - e.preventDefault(); - return false; - } - }); - Tips.setup(); return false; } diff --git a/src/sunstone/public/app/tabs/hosts-tab/form-panels/create/wizard.hbs b/src/sunstone/public/app/tabs/hosts-tab/form-panels/create/wizard.hbs index eaf68cd006..9f91a9ebfa 100644 --- a/src/sunstone/public/app/tabs/hosts-tab/form-panels/create/wizard.hbs +++ b/src/sunstone/public/app/tabs/hosts-tab/form-panels/create/wizard.hbs @@ -14,92 +14,94 @@ {{! limitations under the License. }} {{! -------------------------------------------------------------------------- }} -
-
-
- - -
-
- -
-
-
-
-
- - -
-
-
-
-
-
- {{tr "Drivers"}} -
-
-
-
- - -
-
- - -
-
-
-
-
-
- - -
-
- - -
-
-
+
+ +
+
+ +
-
-
- +
+
+ + +
+
+
+
+
+
+ {{tr "Drivers"}} +
+
+
+
+ + +
+
+ + +
+
+
+
+
+
+ + +
+
+ + +
+
+
+
+
+
+
+
{{tr "vCenter"}}
- +
- +
- +
@@ -112,5 +114,5 @@
- - + + \ No newline at end of file diff --git a/src/sunstone/public/app/tabs/images-tab/form-panels/import.js b/src/sunstone/public/app/tabs/images-tab/form-panels/import.js index 142744f4b6..d6e82b6555 100644 --- a/src/sunstone/public/app/tabs/images-tab/form-panels/import.js +++ b/src/sunstone/public/app/tabs/images-tab/form-panels/import.js @@ -82,27 +82,35 @@ define(function(require) { function _setup(context) { var that = this; - Sunstone.disableFormPanelSubmit(TAB_ID); + $("form.vcenter_credentials", context) + .off('forminvalid.zf.abide').off('formvalid.zf.abide').off("submit"); - $("#get_vcenter_images", context).on("click", function(){ - Sunstone.enableFormPanelSubmit(TAB_ID); + Foundation.reInit($("form.vcenter_credentials", context)); - var vcenter_user = $("#vcenter_user", context).val(); - var vcenter_password = $("#vcenter_password", context).val(); - var vcenter_host = $("#vcenter_host", context).val(); - var vcenter_datastore = $("#vcenter_datastore", context).val(); + $("form.vcenter_credentials", context) + .on('forminvalid.zf.abide', function(ev, frm) { + }) + .on('formvalid.zf.abide', function(ev, frm) { + Sunstone.enableFormPanelSubmit(TAB_ID); - that.vCenterImages.insert({ - container: context, - vcenter_user: vcenter_user, - vcenter_password: vcenter_password, - vcenter_host: vcenter_host, - vcenter_datastore: vcenter_datastore + var vcenter_user = $("#vcenter_user", context).val(); + var vcenter_password = $("#vcenter_password", context).val(); + var vcenter_host = $("#vcenter_host", context).val(); + var vcenter_datastore = $("#vcenter_datastore", context).val(); + + that.vCenterImages.insert({ + container: context, + vcenter_user: vcenter_user, + vcenter_password: vcenter_password, + vcenter_host: vcenter_host, + vcenter_datastore: vcenter_datastore + }); + + }) + .on("submit", function(ev) { + ev.preventDefault(); }); - return false; - }); - return false; } @@ -110,9 +118,8 @@ define(function(require) { var that = this; Sunstone.hideFormPanelLoading(TAB_ID); - Sunstone.disableFormPanelSubmit(TAB_ID); - this.vCenterImages.import(); + this.vCenterImages.import(context.closest("#import_images_form_wrapper")); return false; } diff --git a/src/sunstone/public/app/tabs/images-tab/form-panels/import/html.hbs b/src/sunstone/public/app/tabs/images-tab/form-panels/import/html.hbs index 5d15fce7d8..81046696c0 100644 --- a/src/sunstone/public/app/tabs/images-tab/form-panels/import/html.hbs +++ b/src/sunstone/public/app/tabs/images-tab/form-panels/import/html.hbs @@ -14,32 +14,36 @@ {{! limitations under the License. }} {{! -------------------------------------------------------------------------- }} -
-
-
- - +
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
+
+ + +
-
- - -
-
- - -
-
- - -
- -
+
{{{vCenterImagesHTML}}}
- +
\ No newline at end of file diff --git a/src/sunstone/public/app/tabs/secgroups-tab/form-panels/create/wizard.hbs b/src/sunstone/public/app/tabs/secgroups-tab/form-panels/create/wizard.hbs index 24fa211f42..2da4cd524c 100644 --- a/src/sunstone/public/app/tabs/secgroups-tab/form-panels/create/wizard.hbs +++ b/src/sunstone/public/app/tabs/secgroups-tab/form-panels/create/wizard.hbs @@ -83,7 +83,7 @@
- +
diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/import.js b/src/sunstone/public/app/tabs/templates-tab/form-panels/import.js index 265fd93262..c90843e9aa 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/import.js +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/import.js @@ -82,25 +82,32 @@ define(function(require) { function _setup(context) { var that = this; - Sunstone.disableFormPanelSubmit(TAB_ID); + $("form.vcenter_credentials", context) + .off('forminvalid.zf.abide').off('formvalid.zf.abide').off("submit"); - $("#get_vcenter_templates", context).on("click", function(){ - Sunstone.enableFormPanelSubmit(TAB_ID); + Foundation.reInit($("form.vcenter_credentials", context)); - var vcenter_user = $("#vcenter_user", context).val(); - var vcenter_password = $("#vcenter_password", context).val(); - var vcenter_host = $("#vcenter_host", context).val(); + $("form.vcenter_credentials", context) + .on('forminvalid.zf.abide', function(ev, frm) { + }) + .on('formvalid.zf.abide', function(ev, frm) { + Sunstone.enableFormPanelSubmit(TAB_ID); - that.vCenterTemplates.insert({ - container: context, - vcenter_user: vcenter_user, - vcenter_password: vcenter_password, - vcenter_host: vcenter_host + var vcenter_user = $("#vcenter_user", context).val(); + var vcenter_password = $("#vcenter_password", context).val(); + var vcenter_host = $("#vcenter_host", context).val(); + + that.vCenterTemplates.insert({ + container: context, + vcenter_user: vcenter_user, + vcenter_password: vcenter_password, + vcenter_host: vcenter_host + }); + }) + .on("submit", function(ev) { + ev.preventDefault(); }); - return false; - }); - return false; } @@ -108,9 +115,8 @@ define(function(require) { var that = this; Sunstone.hideFormPanelLoading(TAB_ID); - Sunstone.disableFormPanelSubmit(TAB_ID); - this.vCenterTemplates.import(); + this.vCenterTemplates.import(context.closest("#import_templates_form_wrapper")); return false; } diff --git a/src/sunstone/public/app/tabs/templates-tab/form-panels/import/html.hbs b/src/sunstone/public/app/tabs/templates-tab/form-panels/import/html.hbs index dab721d06e..32241e99b3 100644 --- a/src/sunstone/public/app/tabs/templates-tab/form-panels/import/html.hbs +++ b/src/sunstone/public/app/tabs/templates-tab/form-panels/import/html.hbs @@ -14,28 +14,32 @@ {{! limitations under the License. }} {{! -------------------------------------------------------------------------- }} -
-
-
- - +
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
-
- - -
-
- - -
- -
+
{{{vCenterTemplatesHTML}}}
- +
\ No newline at end of file diff --git a/src/sunstone/public/app/tabs/vnets-tab/form-panels/import.js b/src/sunstone/public/app/tabs/vnets-tab/form-panels/import.js index 121b08ccbc..46d30d413e 100644 --- a/src/sunstone/public/app/tabs/vnets-tab/form-panels/import.js +++ b/src/sunstone/public/app/tabs/vnets-tab/form-panels/import.js @@ -82,25 +82,32 @@ define(function(require) { function _setup(context) { var that = this; - Sunstone.disableFormPanelSubmit(TAB_ID); + $("form.vcenter_credentials", context) + .off('forminvalid.zf.abide').off('formvalid.zf.abide').off("submit"); - $("#get_vcenter_networks", context).on("click", function(){ - Sunstone.enableFormPanelSubmit(TAB_ID); + Foundation.reInit($("form.vcenter_credentials", context)); - var vcenter_user = $("#vcenter_user", context).val(); - var vcenter_password = $("#vcenter_password", context).val(); - var vcenter_host = $("#vcenter_host", context).val(); + $("form.vcenter_credentials", context) + .on('forminvalid.zf.abide', function(ev, frm) { + }) + .on('formvalid.zf.abide', function(ev, frm) { + Sunstone.enableFormPanelSubmit(TAB_ID); - that.vCenterNetworks.insert({ - container: context, - vcenter_user: vcenter_user, - vcenter_password: vcenter_password, - vcenter_host: vcenter_host + var vcenter_user = $("#vcenter_user", context).val(); + var vcenter_password = $("#vcenter_password", context).val(); + var vcenter_host = $("#vcenter_host", context).val(); + + that.vCenterNetworks.insert({ + container: context, + vcenter_user: vcenter_user, + vcenter_password: vcenter_password, + vcenter_host: vcenter_host + }); + }) + .on("submit", function(ev) { + ev.preventDefault(); }); - return false; - }); - return false; } @@ -108,9 +115,8 @@ define(function(require) { var that = this; Sunstone.hideFormPanelLoading(TAB_ID); - Sunstone.disableFormPanelSubmit(TAB_ID); - this.vCenterNetworks.import(); + this.vCenterNetworks.import(context.closest("#import_networks_form_wrapper")); return false; } diff --git a/src/sunstone/public/app/tabs/vnets-tab/form-panels/import/html.hbs b/src/sunstone/public/app/tabs/vnets-tab/form-panels/import/html.hbs index b7e5201c1e..b058cd5da3 100644 --- a/src/sunstone/public/app/tabs/vnets-tab/form-panels/import/html.hbs +++ b/src/sunstone/public/app/tabs/vnets-tab/form-panels/import/html.hbs @@ -14,28 +14,32 @@ {{! limitations under the License. }} {{! -------------------------------------------------------------------------- }} -
-
-
- - +
+ + +
+
+
+ + +
+
+ + +
+
+ + +
+
+ + +
-
- - -
-
- - -
- -
+
{{{vCenterNetworksHTML}}}
- +
\ No newline at end of file diff --git a/src/sunstone/public/app/utils/form-panels/form-panel.js b/src/sunstone/public/app/utils/form-panels/form-panel.js index 8a0b30f898..fe6ef1449d 100644 --- a/src/sunstone/public/app/utils/form-panels/form-panel.js +++ b/src/sunstone/public/app/utils/form-panels/form-panel.js @@ -70,7 +70,7 @@ define(function(require) { $('#' + that.formPanelId + 'Wizard, #' + that.formPanelId + 'Advanced', context) .off('forminvalid.zf.abide').off('formvalid.zf.abide').off("submit"); - Foundation.reInit($("form", context)); + Foundation.reInit($('#' + that.formPanelId + 'Wizard, #' + that.formPanelId + 'Advanced', context)); $('#' + that.formPanelId + 'Wizard, #' + that.formPanelId + 'Advanced', context) .on('forminvalid.zf.abide', function(ev, frm) { diff --git a/src/sunstone/public/scss/_vcenter.scss b/src/sunstone/public/scss/_vcenter.scss index fb00dbb547..cc040350e1 100644 --- a/src/sunstone/public/scss/_vcenter.scss +++ b/src/sunstone/public/scss/_vcenter.scss @@ -1,9 +1,5 @@ .vcenter_credentials { margin-bottom: 1rem; - - .button { - margin-top: 0.5rem; - } } .vcenter_row {