-
-
-
+
+
{{{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. }}
{{! -------------------------------------------------------------------------- }}
-
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. }}
{{! -------------------------------------------------------------------------- }}
-