Reviewed-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
On 12/18/2013 12:34 AM, zhoumeina wrote:
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 <zhoumein(a)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>
--
project-kimchi mailing list <project-kimchi(a)googlegroups.com>
https://groups.google.com/forum/#!forum/project-kimchi
---
You received this message because you are subscribed to the Google Groups
"project-kimchi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
project-kimchi+unsubscribe(a)googlegroups.com.
For more options, visit
https://groups.google.com/groups/opt_out.