[Kimchi-devel] [PATCH 1/2 - v2] Allow listStorageVolumes ajax call be synchronized
Rodrigo Trujillo
rodrigo.trujillo at linux.vnet.ibm.com
Thu Nov 12 12:11:02 UTC 2015
This patch changes kimchi.listStorageVolumes function to receive
a new parameter 'sync' in order to set it as synchronous call.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo at linux.vnet.ibm.com>
---
src/wok/plugins/kimchi/ui/js/src/kimchi.api.js | 7 ++++---
src/wok/plugins/kimchi/ui/js/src/kimchi.guest_storage_add.main.js | 2 +-
src/wok/plugins/kimchi/ui/js/src/kimchi.storage_main.js | 2 +-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/wok/plugins/kimchi/ui/js/src/kimchi.api.js b/src/wok/plugins/kimchi/ui/js/src/kimchi.api.js
index d01bed4..ff0c172 100644
--- a/src/wok/plugins/kimchi/ui/js/src/kimchi.api.js
+++ b/src/wok/plugins/kimchi/ui/js/src/kimchi.api.js
@@ -393,12 +393,13 @@ var kimchi = {
});
},
- listStorageVolumes : function(poolName, suc, err) {
+ listStorageVolumes : function(poolName, suc, err, sync) {
$.ajax({
url : 'plugins/kimchi/storagepools/' + encodeURIComponent(poolName) + '/storagevolumes',
type : 'GET',
contentType : 'application/json',
dataType : 'json',
+ async : !sync,
success : suc,
error : err
});
@@ -452,7 +453,7 @@ var kimchi = {
return;
}
suc(isos, true);
- }, err);
+ }, err, false);
} else if (status === "running") {
if (deepScanHandler.stop) {
return;
@@ -463,7 +464,7 @@ var kimchi = {
}
suc(isos, false);
setTimeout(monitorTask, 2000);
- }, err);
+ }, err, false);
} else if (status === "failed") {
if (deepScanHandler.stop) {
return;
diff --git a/src/wok/plugins/kimchi/ui/js/src/kimchi.guest_storage_add.main.js b/src/wok/plugins/kimchi/ui/js/src/kimchi.guest_storage_add.main.js
index ec07cf0..d6606ee 100644
--- a/src/wok/plugins/kimchi/ui/js/src/kimchi.guest_storage_add.main.js
+++ b/src/wok/plugins/kimchi/ui/js/src/kimchi.guest_storage_add.main.js
@@ -94,7 +94,7 @@ kimchi.guest_storage_add_main = function() {
}
}
$('#guest-disk').selectMenu("setData", options);
- });
+ }, null, false);
});
diff --git a/src/wok/plugins/kimchi/ui/js/src/kimchi.storage_main.js b/src/wok/plugins/kimchi/ui/js/src/kimchi.storage_main.js
index 567aba3..8ed896c 100644
--- a/src/wok/plugins/kimchi/ui/js/src/kimchi.storage_main.js
+++ b/src/wok/plugins/kimchi/ui/js/src/kimchi.storage_main.js
@@ -313,7 +313,7 @@ kimchi.doListVolumes = function(poolObj) {
slide.slideDown('slow');
}, function(err) {
wok.message.error(err.responseJSON.reason);
- });
+ }, false);
}
kimchi.initLogicalPoolExtend = function() {
--
2.1.0
More information about the Kimchi-devel
mailing list