Add a confirm box to create logical pool, because it is a quite
dangerous action.
Signed-off-by: zhoumeina <
zhou...@linux.vnet.ibm.com>
---
po/en_US.po | 7 +++++++
po/kimchi.pot | 5 +++++
po/pt_BR.po | 5 +++++
po/zh_CN.po | 5 +++++
ui/js/src/kimchi.storagepool_add_main.js | 30 ++++++++++++++++++++++++------
ui/pages/i18n.html.tmpl | 4 +++-
6 files changed, 49 insertions(+), 7 deletions(-)
mode change 100644 => 100755 po/en_US.po
mode change 100644 => 100755 po/kimchi.pot
mode change 100644 => 100755 po/pt_BR.po
mode change 100644 => 100755 po/zh_CN.po
diff --git a/po/en_US.po b/po/en_US.po
old mode 100644
new mode 100755
index 86d7c81..b81606b
--- a/po/en_US.po
+++ b/po/en_US.po
@@ -509,3 +509,10 @@ msgstr "Bridged: VMs are connected to physical network directly"
msgid "Destination"
msgstr "Destination"
+
+msgid ""
+"It will format your disk if you used those being used partitions,and it is "
+"dangerous, are you sure to continue? "
+msgstr ""
+"It will format your disk if you used those being used partitions,and it is "
+"dangerous, are you sure to continue? "
diff --git a/po/kimchi.pot b/po/kimchi.pot
old mode 100644
new mode 100755
index 1d2c688..1d5e3a0
--- a/po/kimchi.pot
+++ b/po/kimchi.pot
@@ -497,3 +497,8 @@ msgstr ""
msgid "Destination"
msgstr ""
+
+msgid ""
+"It will format your disk if you used those being used partitions,and it is "
+"dangerous, are you sure to continue? "
+msgstr ""
\ No newline at end of file
diff --git a/po/pt_BR.po b/po/pt_BR.po
old mode 100644
new mode 100755
index 4c58c87..f02f5e6
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -523,3 +523,8 @@ msgstr ""
msgid "Destination"
msgstr ""
+
+msgid ""
+"It will format your disk if you used those being used partitions,and it is "
+"dangerous, are you sure to continue? "
+msgstr ""
diff --git a/po/zh_CN.po b/po/zh_CN.po
old mode 100644
new mode 100755
index 2a34051..a93ee7e
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -514,3 +514,8 @@ msgstr "桥接: 虚拟机直接接入物理网络"
msgid "Destination"
msgstr "目标设备"
+
+msgid ""
+"It will format your disk if you used those being used partitions,and it is "
+"dangerous, are you sure to continue? "
+msgstr "本操作将会对正在使用的分区进行格式化,具有一定风险,是否确认继续?"
diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js
index 7efbfa0..66500f3 100644
--- a/ui/js/src/kimchi.storagepool_add_main.js
+++ b/ui/js/src/kimchi.storagepool_add_main.js
@@ -157,11 +157,29 @@ kimchi.addPool = function(event) {
formData.nfspath = $('#nfspathId').val();
formData.nfsserver = $('#nfsserverId').val();
}
- kimchi.createStoragePool(formData, function() {
- kimchi.doListStoragePools();
- kimchi.window.close();
- }, function(err) {
- kimchi.message.error(err.responseJSON.reason);
- });
+ if (poolType === 'logical') {
+ var settings = {
+ title : i18n['msg.confirm.delete.title'],
+ content : i18n['msg.logicalpool.confirm.delete'],
+ confirm : i18n['msg.confirm.delete.confirm'],
+ cancel : i18n['msg.confirm.delete.cancel']
+ };
+ kimchi.confirm(settings, function() {
+ kimchi.createStoragePool(formData, function() {
+ kimchi.doListStoragePools();
+ kimchi.window.close();
+ }, function(err) {
+ kimchi.message.error(err.responseJSON.reason);
+ });
+ }, function() {
+ });
+ } else {
+ kimchi.createStoragePool(formData, function() {
+ kimchi.doListStoragePools();
+ kimchi.window.close();
+ }, function(err) {
+ kimchi.message.error(err.responseJSON.reason);
+ });
+ }
}
};
diff --git a/ui/pages/i18n.html.tmpl b/ui/pages/i18n.html.tmpl
index 5b3fd94..aad0371 100644
--- a/ui/pages/i18n.html.tmpl
+++ b/ui/pages/i18n.html.tmpl
@@ -118,7 +118,9 @@ var i18n = {
'network_dialog_ok': "$_("OK")",
'network_dialog_cancel': "$_("Cancel")",
'action_create': "$_("Create")",
- 'msg_warning': "$_("Warning")"
+ 'msg_warning': "$_("Warning")",
+ 'msg.logicalpool.confirm.delete': "$_("It will format your disk if you used those being used partitions,"
+ "and it is dangerous, are you sure to continue? ")"
};
</script>
</body>
--
1.7.1