[Kimchi-devel] [PATCH 3/3] UI: Template with VM Image - List

huoyuxin at linux.vnet.ibm.com huoyuxin at linux.vnet.ibm.com
Fri Sep 5 07:27:29 UTC 2014


From: Yu Xin Huo <huoyuxin at linux.vnet.ibm.com>

Signed-off-by: Yu Xin Huo <huoyuxin at linux.vnet.ibm.com>
---
 ui/js/src/kimchi.template_main.js |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)

diff --git a/ui/js/src/kimchi.template_main.js b/ui/js/src/kimchi.template_main.js
index 3c8421d..775cb0b 100644
--- a/ui/js/src/kimchi.template_main.js
+++ b/ui/js/src/kimchi.template_main.js
@@ -22,7 +22,17 @@ kimchi.doListTemplates = function() {
             var listHtml = '';
             var templateHtml = $('#templateTmpl').html();
             $.each(result, function(index, value) {
-                var isLocal = /^\//.test(value['cdrom']);
+                var isLocal;
+                if(value.cdrom){
+                    isLocal = /^\//.test(value['cdrom']);
+                }else{
+                    for(var i=0;i<value.disks.length;i++){
+                        if(value.disks[i].base){
+                            isLocal = /^\//.test(value.disks[i].base);
+                            break;
+                        }
+                    }
+                }
                 if(isLocal){
                     value.location = "images/theme-default/icon-local.png";
                 }else{
-- 
1.7.1




More information about the Kimchi-devel mailing list