[PATCH V2] Add confirm box to create logical pool,and modify device path number

5 views
Skip to first unread message

zhoumeina

unread,
Dec 17, 2013, 9:34:26 PM12/17/13
to project...@googlegroups.com, zhoumeina
Add a confirm box to create logical pool, because it is a quite
dangerous action.

Make device path number to "3"
Signed-off-by: zhoumeina <zhou...@linux.vnet.ibm.com>
---
ui/js/src/kimchi.storagepool_add_main.js | 30 ++++++++++++++++++++++++------
ui/pages/i18n.html.tmpl | 4 +++-
ui/pages/storagepool-add.html.tmpl | 2 +-
3 files changed, 28 insertions(+), 8 deletions(-)

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 3d0dfff..54bfada 100644
--- a/ui/pages/i18n.html.tmpl
+++ b/ui/pages/i18n.html.tmpl
@@ -119,7 +119,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 and you will loose any data in"
+ "there, are you sure to continue? ")"
};
</script>
</body>
diff --git a/ui/pages/storagepool-add.html.tmpl b/ui/pages/storagepool-add.html.tmpl
index 55cb6e8..d7b046d 100644
--- a/ui/pages/storagepool-add.html.tmpl
+++ b/ui/pages/storagepool-add.html.tmpl
@@ -92,7 +92,7 @@
</div>
<div class="logical-section tmpl-html">
<section class="form-section storageType">
- <h2>4. $_("Device Path")</h2>
+ <h2>3. $_("Device Path")</h2>
<div class="host-partition"></div>
</section>
</div>
--
1.7.1

Aline Manera

unread,
Dec 18, 2013, 7:12:16 AM12/18/13
to zhoumeina, project...@googlegroups.com

Reviewed-by: Aline Manera <ali...@linux.vnet.ibm.com>

Aline Manera

unread,
Dec 18, 2013, 7:17:33 AM12/18/13
to zhoumeina, project...@googlegroups.com, zhoumeina
Applied. Thanks.

Regards,

Aline Manera

Reply all
Reply to author
Forward
0 new messages