[Kimchi-devel] [PATCH] Fix UI: Show proper message when detaching a guest storage

Rodrigo Trujillo rodrigo.trujillo at linux.vnet.ibm.com
Thu Aug 14 05:01:12 UTC 2014


Whenever an user tries to detach a storage from a guest, the
confirmation message always contains "CDROM". This patch fix this
problem, so when the storage type is "disk", it shows the right
message.

Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
---
 ui/js/src/kimchi.guest_edit_main.js | 2 ++
 ui/pages/guest-edit.html.tmpl       | 4 ++--
 ui/pages/i18n.json.tmpl             | 1 +
 3 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/ui/js/src/kimchi.guest_edit_main.js b/ui/js/src/kimchi.guest_edit_main.js
index 7d24b44..01d8045 100644
--- a/ui/js/src/kimchi.guest_edit_main.js
+++ b/ui/js/src/kimchi.guest_edit_main.js
@@ -107,6 +107,8 @@ kimchi.guest_edit_main = function() {
                 confirm : i18n['KCHAPI6002M'],
                 cancel : i18n['KCHAPI6003M']
             };
+            if ($(this).data('type') == "disk")
+                settings['content'] = i18n['KCHVMCD6009M'];
 
             var dev = $(this).data('dev');
             kimchi.confirm(settings, function() {
diff --git a/ui/pages/guest-edit.html.tmpl b/ui/pages/guest-edit.html.tmpl
index f24f7de..ed7ddeb 100644
--- a/ui/pages/guest-edit.html.tmpl
+++ b/ui/pages/guest-edit.html.tmpl
@@ -169,7 +169,7 @@
                 title='$_("Replace")'>
             </button>
             <button class="guest-edit-cdrom-button detach"
-                data-vm="{vm}" data-dev="{dev}"
+                data-vm="{vm}" data-dev="{dev}" data-type="{type}"
                 title='$_("Detach")'>
             </button>
             <button class="guest-edit-cdrom-button save hidden"
@@ -213,7 +213,7 @@
         </span>
         <span class="action-area">
             <button class="guest-edit-cdrom-button detach"
-                data-vm="{vm}" data-dev="{dev}"
+                data-vm="{vm}" data-dev="{dev}" data-type="{type}"
                 title="$_("Detach")">
             </button>
         </span>
diff --git a/ui/pages/i18n.json.tmpl b/ui/pages/i18n.json.tmpl
index 697f946..ccfb081 100644
--- a/ui/pages/i18n.json.tmpl
+++ b/ui/pages/i18n.json.tmpl
@@ -135,6 +135,7 @@
     "KCHVMCD6006M": "$_("Successfully attached!")",
     "KCHVMCD6007M": "$_("Successfully replaced!")",
     "KCHVMCD6008M": "$_("Successfully detached!")",
+    "KCHVMCD6009M": "$_("This disk will be detached permanently and you can re-attach it. Continue to detach it?")",
 
 
     "KCHNET6001E": "$_("The VLAN id must be between 1 and 4094.")",
-- 
1.9.3




More information about the Kimchi-devel mailing list