[PATCH] Issue #296 [enhance]kimchi UI should not waiting while generating reports
by Wen Wang
1) Removed the dialogue window when generating a debug report.
2) Designed an animation bar indicate user there is a report generating
during the generating progress.
3) Disable the buttons' functions in debug report area when generating a new
report in case there might be any conflict. Meanwhile user can operate
on other parts of Kimchi.
4) Enable all buttonss' functions in debug report area after generating
progress.
---
ui/css/theme-default/host.css | 22 +++++++++++++++++++++
ui/js/src/kimchi.report_add_main.js | 38 ++++++++++++++++++++++++++++++++-----
2 files changed, 55 insertions(+), 5 deletions(-)
diff --git a/ui/css/theme-default/host.css b/ui/css/theme-default/host.css
index 6a1a308..c684c0a 100644
--- a/ui/css/theme-default/host.css
+++ b/ui/css/theme-default/host.css
@@ -219,6 +219,28 @@
width: 200px;
}
+#id-generate-bar {
+ text-align: center;
+ vertical-align: middle;
+}
+
+#id-generate-panel {
+ vertical-align: middle;
+ margin: 0 auto;
+ text-align: center;
+ height: 20px;
+ width: 250px;
+ color: #fff;
+ border: 1px solid #ccc;
+ background-color: #5af;
+}
+
+#id-generating {
+ font-color: #fff;
+ background: #5af url(../../images/theme-default/loading.gif) 7px
+ center no-repeat;
+ padding-left: 26px;
+}
/* End of Debug Report */
/* Software Updates */
diff --git a/ui/js/src/kimchi.report_add_main.js b/ui/js/src/kimchi.report_add_main.js
index 8759c2b..1e5df89 100644
--- a/ui/js/src/kimchi.report_add_main.js
+++ b/ui/js/src/kimchi.report_add_main.js
@@ -1,4 +1,5 @@
kimchi.report_add_main = function() {
+ var reportGridID = 'available-reports-grid';
var addReportForm = $('#form-report-add');
var submitButton = $('#button-report-add');
var nameTextbox = $('input[name="name"]', addReportForm);
@@ -13,12 +14,39 @@ kimchi.report_add_main = function() {
return false;
}
var formData = addReportForm.serializeObject();
- submitButton
- .text(i18n['KCHDR6007M'])
- .prop('disabled', true);
- nameTextbox.prop('disabled', true);
+ kimchi.window.close();
+ var reportGrid = null;
+ $('#' + reportGridID + '-generate-button').prop('disabled',true);
+ $('#' + reportGridID + '-remove-button').prop('disabled',true);
+ $('#' + reportGridID + '-download-button').prop('disabled',true);
+ $('#' + reportGridID + '-rename-button').prop('disabled',true);
+ $('#available-reports-grid').find('.grid-body').find('table').find('tr').click(function() {
+ $('#' + reportGridID + '-remove-button').prop('disabled',true);
+ $('#' + reportGridID + '-download-button').prop('disabled',true);
+ $('#' + reportGridID + '-rename-button').prop('disabled',true);
+ });
+ var len = $('#available-reports-grid').find('.grid-frozen-body-view').find('tr').length + 1;
+ $('#available-reports-grid').find('.grid-frozen-body-view').find('table').append('<tr id="temp-row-col1"><td>' + len + '</td></tr>');
+ $('#available-reports-grid').find('.grid-body-view').find('table').append('<tr id="temp-row-col2"><td id="id-generate-bar"; colspan="2"></td></tr>');
+ var textboxValue = $('#report-name-textbox').val();
+ if (textboxValue != "") {
+ if (textboxValue.length <= 15) {
+ $('#id-generate-bar').append('<div id="id-generate-panel"></div>');
+ $('#id-generate-panel').append('<label id="id-generating"><span>' + '"' + textboxValue +'" ' + i18n['KCHDR6007M'] + '</span></label>');
+ }
+ else {
+ $('#id-generate-bar').append('<div id="id-generate-panel"></div>');
+ $('#id-generate-panel').append('<label id="id-generating"><span>' + '"' + textboxValue.substring(0,13) +'..." ' + i18n['KCHDR6007M'] + '</span></label>');
+ }
+ }
+ else {
+ $('#id-generate-bar').append('<div id="id-generate-panel"></div>');
+ $('#id-generate-panel').append('<label id="id-generating"><span>' + i18n['KCHDR6007M'] + '</span></label>');
+ }
kimchi.createReport(formData, function(result) {
- kimchi.window.close();
+ $('#temp-row-col1').remove();
+ $('#temp-row-col2').remove();
+ $('#' + reportGridID + '-generate-button').prop('disabled',false);
kimchi.topic('kimchi/debugReportAdded').publish({
result: result
});
--
1.9.1
10 years, 4 months
[PATCHv3 0/2] ref_cnt fixes for disk attachment
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Royce Lv (2):
disk attachment: fix ref_cnt to prevent double attach
disk attachment: limit ref_cnt check to disk attachment
src/kimchi/model/vmstorages.py | 31 ++++++++++++++++++++++++++++++-
tests/test_model.py | 1 +
2 files changed, 31 insertions(+), 1 deletion(-)
--
1.8.3.2
10 years, 4 months
[PATCHv4 0/2] Support for storage pool extend
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Depend on exception fix patchset.
v3>v4, delete json schema change.(Shaohe's comments)
v2>v3, fixed loading info cannot display when reopen,
also correct i18n for Chinese.(Yuxin's comments)
v1>v2, Added error msg and loading info for pool extend.(Aline's comments)
Royce Lv (2):
StoragePool Edit: Add Disk to Logical Pool
Update po file
po/zh_CN.po | 5 +++-
ui/js/src/kimchi.api.js | 12 ++++++++
ui/js/src/kimchi.storage_main.js | 47 ++++++++++++++++++++++++++++++++
ui/js/src/kimchi.storagepool_add_main.js | 2 +-
ui/pages/i18n.html.tmpl | 1 +
ui/pages/tabs/storage.html.tmpl | 15 ++++++++++
6 files changed, 80 insertions(+), 2 deletions(-)
--
1.8.3.2
10 years, 4 months
[PATCH] Issue#348: Add loading icon when nfs mount is in progress
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Add loading icon to indicate nfs mount in progress,
when error or normal response returns,
close create window.
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.storagepool_add_main.js | 2 ++
ui/pages/storagepool-add.html.tmpl | 6 ++++++
2 files changed, 8 insertions(+)
diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js
index 86dbe7f..6b77bd8 100644
--- a/ui/js/src/kimchi.storagepool_add_main.js
+++ b/ui/js/src/kimchi.storagepool_add_main.js
@@ -198,6 +198,7 @@ kimchi.validateNfsForm = function () {
kimchi.message.error.code('KCHPOOL6005E');
return false;
}
+ $('#nfs-mount-loading').removeClass('hidden');
return true;
};
@@ -295,6 +296,7 @@ kimchi.addPool = function(event) {
kimchi.window.close();
}, function(err) {
kimchi.message.error(err.responseJSON.reason);
+ kimchi.window.close();
});
}
}
diff --git a/ui/pages/storagepool-add.html.tmpl b/ui/pages/storagepool-add.html.tmpl
index 977db66..b0bc36d 100644
--- a/ui/pages/storagepool-add.html.tmpl
+++ b/ui/pages/storagepool-add.html.tmpl
@@ -91,6 +91,12 @@
</ul>
</div>
</div>
+ <div class="hidden" id="nfs-mount-loading">
+ <p class="text-help">
+ $_("Server trying mount nfs export path...")
+ <img src = "../images/theme-default/loading.gif" />
+ </p>
+ </div>
</div>
</section>
</div>
--
1.8.3.2
10 years, 4 months
[PATCH] Add dependency of pyflakes and pep8
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Pyflakes and pep8 dependencies need to be added so that pyflakes
check can be performed properly.
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
contrib/DEBIAN/control.in | 2 ++
contrib/kimchi.spec.fedora.in | 2 ++
contrib/kimchi.spec.suse.in | 2 ++
3 files changed, 6 insertions(+)
diff --git a/contrib/DEBIAN/control.in b/contrib/DEBIAN/control.in
index aac1a24..581601b 100644
--- a/contrib/DEBIAN/control.in
+++ b/contrib/DEBIAN/control.in
@@ -25,6 +25,8 @@ Depends: python-cherrypy3 (>= 3.2.0),
firewalld,
nginx
Build-Depends: libxslt,
+ pep8,
+ pyflakes,
python-libxml2
Maintainer: Aline Manera <alinefm(a)br.ibm.com>
Description: Kimchi web server
diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
index 2d4699b..9f62e05 100644
--- a/contrib/kimchi.spec.fedora.in
+++ b/contrib/kimchi.spec.fedora.in
@@ -32,6 +32,8 @@ Requires: nginx
Requires: iscsi-initiator-utils
BuildRequires: libxslt
BuildRequires: libxml2-python
+BuildRequires: python-pep8
+BuildRequires: pyflakes
%if 0%{?rhel} == 6
Requires: python-ordereddict
diff --git a/contrib/kimchi.spec.suse.in b/contrib/kimchi.spec.suse.in
index 165f566..36d6b0a 100644
--- a/contrib/kimchi.spec.suse.in
+++ b/contrib/kimchi.spec.suse.in
@@ -28,6 +28,8 @@ Requires: nginx
Requires: open-iscsi
BuildRequires: libxslt-tools
BuildRequires: python-libxml2
+BuildRequires: python-pyflakes
+BuildRequires: python-pep8
%if 0%{?sles_version} == 11
Requires: python-ordereddict
--
1.8.3.2
10 years, 4 months
[PATCH] Insert loading icon in Storage tab
by Daniel Barboza
From: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
Due to the timeout period to see if the NFS pool is
online, the Storage tab may look irresponsible and
the user might believe that the UI/kimchi is frozen.
Inserting the loading icon+text in this tab to show that
the UI is responsive, just waiting for an answer from the
server.
Signed-off-by: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.storage_main.js | 2 ++
ui/pages/tabs/storage.html.tmpl | 8 +++++++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/ui/js/src/kimchi.storage_main.js b/ui/js/src/kimchi.storage_main.js
index 6052510..74e6892 100644
--- a/ui/js/src/kimchi.storage_main.js
+++ b/ui/js/src/kimchi.storage_main.js
@@ -17,6 +17,7 @@
*/
kimchi.doListStoragePools = function() {
kimchi.listStoragePools(function(result) {
+ $('#storagepoolsLoading').addClass('hidden');
var storageHtml = $('#storageTmpl').html();
if (result && result.length) {
var listHtml = '';
@@ -34,6 +35,7 @@ kimchi.doListStoragePools = function() {
$('#storagepoolsList').html('');
}
}, function(err) {
+ $('#storagepoolsLoading').addClass('hidden');
kimchi.message.error(err.responseJSON.reason);
});
diff --git a/ui/pages/tabs/storage.html.tmpl b/ui/pages/tabs/storage.html.tmpl
index c3a992e..84372c1 100644
--- a/ui/pages/tabs/storage.html.tmpl
+++ b/ui/pages/tabs/storage.html.tmpl
@@ -40,7 +40,13 @@
<li class="title-actions">$_("Actions")</li>
</div>
<ul id="storagepoolsList" class="list-storage empty-when-logged-off"></ul>
-</div>
+ <div id="storagepoolsLoading">
+ <div class="grid-loading">
+ <div class="grid-loading-icon"></div>
+ <div class="grid-loading-text">$_("loading")</div>
+ </div>
+ </div>
+ </div>
<script id="storageTmpl" type="html/text">
<li id="{name}">
<div class="storage-li in" data-name="{name}" data-stat="{state}">
--
1.8.3.1
10 years, 4 months
[PATCHv3 0/3] Storage pool extend support
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
v2>v3, fixed loading info cannot display when reopen,
also correct i18n for Chinese.
v1>v2, Added error msg and loading info for pool extend.(Aline's comments)
Royce Lv (3):
StoragePool Edit: Add Disk to Logical Pool
StoragePool Edit: Update json schema
Update po file
po/zh_CN.po | 5 +++-
src/kimchi/API.json | 3 +-
ui/js/src/kimchi.api.js | 12 ++++++++
ui/js/src/kimchi.storage_main.js | 47 ++++++++++++++++++++++++++++++++
ui/js/src/kimchi.storagepool_add_main.js | 2 +-
ui/pages/i18n.html.tmpl | 1 +
ui/pages/tabs/storage.html.tmpl | 15 ++++++++++
7 files changed, 82 insertions(+), 3 deletions(-)
--
1.8.3.2
10 years, 4 months
[PATCH] Remove '.iso' extension checking when create new template
by Rodrigo Trujillo
Libvirt accepts iso files with names that do not end with '.iso'
extension. Also, Kimchi discovers ISOs stored in storagepools by the
file format, it does not care about file name.
This patch removes the .iso checking from API.json schema, then files
ending with '.iso.1', '.iso.bkp' or any other, can be used.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
src/kimchi/API.json | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/API.json b/src/kimchi/API.json
index b9d371a..44a1439 100644
--- a/src/kimchi/API.json
+++ b/src/kimchi/API.json
@@ -361,7 +361,7 @@
"cdrom": {
"description": "Path for cdrom",
"type": "string",
- "pattern": "^((/)|(http)[s]?:|[t]?(ftp)[s]?:)+.*([.]iso)$",
+ "pattern": "^((/)|(http)[s]?:|[t]?(ftp)[s]?:)+.*$",
"required": true,
"error": "KCHTMPL0014E"
},
@@ -532,7 +532,7 @@
"cdrom": {
"description": "Path for cdrom",
"type": "string",
- "pattern": "^((/)|(http)[s]?:|[t]?(ftp)[s]?:)+.*([.]iso)$",
+ "pattern": "^((/)|(http)[s]?:|[t]?(ftp)[s]?:)+.*$",
"error": "KCHTMPL0014E"
},
"disks": {
--
1.9.0
10 years, 4 months
[PATCHv2 1/2] StoragePool Edit: Add Disk to Logical Pool
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
v1>v2, add loading icon before disk query finished
and display mesg when no partition is available.
Add storage pool extend dialog and choose proper disk for extension.
Signed-off-by: Yu Xin Huo <huoyuxin(a)linux.vnet.ibm.com>
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.api.js | 12 +++++++++
ui/js/src/kimchi.storage_main.js | 46 ++++++++++++++++++++++++++++++++
ui/js/src/kimchi.storagepool_add_main.js | 2 +-
ui/pages/i18n.html.tmpl | 1 +
ui/pages/tabs/storage.html.tmpl | 15 +++++++++++
5 files changed, 75 insertions(+), 1 deletion(-)
diff --git a/ui/js/src/kimchi.api.js b/ui/js/src/kimchi.api.js
index 3c6765c..d30bf10 100644
--- a/ui/js/src/kimchi.api.js
+++ b/ui/js/src/kimchi.api.js
@@ -208,6 +208,18 @@ var kimchi = {
}).done(suc).fail(err);
},
+ updateStoragePool : function(name, content, suc, err) {
+ $.ajax({
+ url : kimchi.url + "storagepools/" + encodeURIComponent(name),
+ type : 'PUT',
+ contentType : 'application/json',
+ dataType : 'json',
+ data : JSON.stringify(content)
+ }).done(suc).fail(err ? err : function(data) {
+ kimchi.message.error(data.responseJSON.reason);
+ });
+ },
+
startVM : function(vm, suc, err) {
kimchi.requestJSON({
url : kimchi.url + 'vms/' + encodeURIComponent(vm) + '/start',
diff --git a/ui/js/src/kimchi.storage_main.js b/ui/js/src/kimchi.storage_main.js
index 6052510..ef3d8f5 100644
--- a/ui/js/src/kimchi.storage_main.js
+++ b/ui/js/src/kimchi.storage_main.js
@@ -24,6 +24,7 @@ kimchi.doListStoragePools = function() {
value.usage = parseInt(value.allocated / value.capacity * 100) || 0;
value.capacity = kimchi.changetoProperUnit(value.capacity,1);
value.allocated = kimchi.changetoProperUnit(value.allocated,1);
+ value.enableExt = value.type==="logical" ? "" : "hide-content";
if ('kimchi-iso' !== value.type) {
listHtml += kimchi.template(storageHtml, value);
}
@@ -138,6 +139,11 @@ kimchi.storageBindClick = function() {
}
});
+ $('.pool-extend').on('click', function() {
+ $("#logicalPoolExtend").dialog("option", "poolName", $(this).data('name'));
+ $("#logicalPoolExtend").dialog("open");
+ });
+
$('#volume-doAdd').on('click', function() {
kimchi.window.open('storagevolume-add.html');
});
@@ -187,11 +193,51 @@ kimchi.doListVolumes = function(poolObj) {
});
}
+kimchi.initLogicalPoolExtend = function() {
+ $("#logicalPoolExtend").dialog({
+ autoOpen : false,
+ modal : true,
+ width : 600,
+ resizable : false,
+ closeText: "X",
+ open : function(){
+ $(".ui-dialog-titlebar-close", $("#logicalPoolExtend").parent()).removeAttr("title");
+ kimchi.listHostPartitions(function(data) {
+ if (data.length > 0) {
+ $('.host-partition', '#logicalPoolExtend').html('');
+ for(var i=0;i<data.length;i++){
+ if (data[i].type === 'part' || data[i].type === 'disk') {
+ $('.host-partition', '#logicalPoolExtend').append(kimchi.template($('#logicalPoolExtendTmpl').html(), data[i]));
+ }
+ }
+ } else {
+ $('.host-partition').html(i18n['KCHPOOL6011M']);
+ $('.host-partition').addClass('text-help');
+ }
+ });
+ },
+ beforeClose : function() { $('.host-partition', '#logicalPoolExtend').empty(); },
+ buttons : [{
+ class: "ui-button-primary",
+ text: i18n.KCHAPI6007M,
+ click: function(){
+ var devicePaths = [];
+ $("input[type='checkbox']:checked", "#logicalPoolExtend").each(function(){
+ devicePaths.push($(this).prop('value'));
+ })
+ kimchi.updateStoragePool($("#logicalPoolExtend").dialog("option", "poolName"),{disks: devicePaths});
+ $(this).dialog("close");
+ }
+ }]
+ });
+}
+
kimchi.storage_main = function() {
$('#storage-pool-add').on('click', function() {
kimchi.window.open('storagepool-add.html');
});
kimchi.doListStoragePools();
+ kimchi.initLogicalPoolExtend();
}
kimchi.changeArrow = function(obj) {
diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js
index 86dbe7f..bc57601 100644
--- a/ui/js/src/kimchi.storagepool_add_main.js
+++ b/ui/js/src/kimchi.storagepool_add_main.js
@@ -33,7 +33,7 @@ kimchi.initStorageAddPage = function() {
listHtml += kimchi.template(deviceHtml, value);
}
});
- $('.host-partition').html(listHtml);
+ $('.host-partition', '#form-pool-add').html(listHtml);
} else {
$('.host-partition').html(i18n['KCHPOOL6011M']);
$('.host-partition').addClass('text-help');
diff --git a/ui/pages/i18n.html.tmpl b/ui/pages/i18n.html.tmpl
index 98da828..f7977c8 100644
--- a/ui/pages/i18n.html.tmpl
+++ b/ui/pages/i18n.html.tmpl
@@ -58,6 +58,7 @@ var i18n = {
'KCHAPI6004M': "$_("Confirm")",
'KCHAPI6005M': "$_("Create")",
'KCHAPI6006M': "$_("Warning")",
+ 'KCHAPI6007M': "$_("Save")",
'KCHGRD6001M': "$_("Loading...")",
'KCHGRD6002M': "$_("An error occurs while checking for packages update.")",
diff --git a/ui/pages/tabs/storage.html.tmpl b/ui/pages/tabs/storage.html.tmpl
index c3a992e..76d2e07 100644
--- a/ui/pages/tabs/storage.html.tmpl
+++ b/ui/pages/tabs/storage.html.tmpl
@@ -41,6 +41,14 @@
</div>
<ul id="storagepoolsList" class="list-storage empty-when-logged-off"></ul>
</div>
+<div id="logicalPoolExtend" title="$_("Device path")">
+ <div class="host-partition">
+ <p class="text-help">
+ $_("Looking for available partitions ...")
+ <img src = "../images/theme-default/loading.gif" />
+ </p>
+ </div>
+</div>
<script id="storageTmpl" type="html/text">
<li id="{name}">
<div class="storage-li in" data-name="{name}" data-stat="{state}">
@@ -74,6 +82,7 @@
<div class="popover actionsheet right-side" style="width: 250px">
<button class="button-big pool-deactivate" data-stat="{state}" data-name="{name}" data-persistent="{persistent}"><span class="text">$_("Deactivate")</span></button>
<button class="button-big pool-activate" data-stat="{state}" data-name="{name}"><span class="text">$_("Activate")</span></button>
+ <button class="button-big pool-extend {enableExt}" data-stat="{state}" data-name="{name}"><span class="text">$_("Extend")</span></button>
<button class="button-big red pool-delete" data-stat="{state}" data-name="{name}"><span class="text">$_("Undefine")</span></button>
</div>
</div>
@@ -107,6 +116,12 @@
</div>
</div>
</script>
+<script id="logicalPoolExtendTmpl" type="html/text">
+ <div>
+ <input type="checkbox" value="{path}" name="devices">
+ <label for="{name}">{path}</label>
+ </div>
+</script>
<script>
kimchi.storage_main();
</script>
--
1.8.3.2
10 years, 4 months
[PATCH v2] Rename kimchi.template to kimchi.substitute
by Hongliang Wang
This function was designed to substitute variables in HTML template strings originally
so it was named as kimchi.template, and it can be used in other scenarios, e.g. we use
it when we load plugins we have a unified URL for plugin XML files:
/plugins/{plugin}/ui/config/tab-ext.xml
and after we have the plugins list, we can easily generate the corresponding URLs like
/plugins/pluginA/ui/config/tab-ext.xml,
/plugins/pluginB/ui/config/tab-ext.xml.
by list ['pluginA', 'pluginB'].
Though it is sometimes misunderstood to be related with VM templates.
Renamed it in this patch.
v1 -> v2:
2a) Configurated git to use "rename" instead of "remove"&"create"
(Thanks to Sheldon & Zheng Sheng's help)
Signed-off-by: Hongliang Wang <hlwang(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.grid.js | 2 +-
ui/js/src/kimchi.guest_add_main.js | 2 +-
ui/js/src/kimchi.guest_edit_main.js | 4 ++--
ui/js/src/kimchi.guest_media_main.js | 2 +-
ui/js/src/kimchi.host.js | 2 +-
ui/js/src/kimchi.main.js | 2 +-
ui/js/src/kimchi.network.js | 2 +-
ui/js/src/kimchi.storage_main.js | 4 ++--
ui/js/src/kimchi.storagepool_add_main.js | 2 +-
ui/js/src/{kimchi.template.js => kimchi.substitute.js} | 2 +-
ui/js/src/kimchi.template_add_main.js | 4 ++--
ui/js/src/kimchi.template_edit_main.js | 2 +-
ui/js/src/kimchi.template_main.js | 2 +-
13 files changed, 16 insertions(+), 16 deletions(-)
rename ui/js/src/{kimchi.template.js => kimchi.substitute.js} (96%)
diff --git a/ui/js/src/kimchi.grid.js b/ui/js/src/kimchi.grid.js
index 055f487..2c70969 100644
--- a/ui/js/src/kimchi.grid.js
+++ b/ui/js/src/kimchi.grid.js
@@ -375,7 +375,7 @@ kimchi.widget.Grid.prototype = (function() {
var container = $('#' + containerID);
var gridID = this['opts']['id'];
var rowSelection = this['opts']['rowSelection'] || 'single';
- var domNode = $(kimchi.template(htmlStr, {
+ var domNode = $(kimchi.substitute(htmlStr, {
id: gridID,
loading: i18n['KCHGRD6001M'],
message: i18n['KCHGRD6002M'],
diff --git a/ui/js/src/kimchi.guest_add_main.js b/ui/js/src/kimchi.guest_add_main.js
index 2113099..eefd59a 100644
--- a/ui/js/src/kimchi.guest_add_main.js
+++ b/ui/js/src/kimchi.guest_add_main.js
@@ -25,7 +25,7 @@ kimchi.guest_add_main = function() {
var html = '';
var tmpl = $('#tmpl-template').html();
$.each(result, function(index, value) {
- html += kimchi.template(tmpl, value);
+ html += kimchi.substitute(tmpl, value);
});
$('#templateTile').html(html);
return;
diff --git a/ui/js/src/kimchi.guest_edit_main.js b/ui/js/src/kimchi.guest_edit_main.js
index 0236e2d..90dcb32 100644
--- a/ui/js/src/kimchi.guest_edit_main.js
+++ b/ui/js/src/kimchi.guest_edit_main.js
@@ -42,7 +42,7 @@ kimchi.guest_edit_main = function() {
$.each(storages, function(index, storage) {
storage['vm'] = kimchi.selectedGuest;
rowHTML = $('#' + storage['type'] + '-row-tmpl').html();
- var templated = kimchi.template(rowHTML, storage);
+ var templated = kimchi.substitute(rowHTML, storage);
container.append(templated);
});
@@ -96,7 +96,7 @@ kimchi.guest_edit_main = function() {
$(".action-area", item).toggleClass("hide");
};
var addItem = function(data) {
- var itemNode = $.parseHTML(kimchi.template($('#interface-tmpl').html(),data));
+ var itemNode = $.parseHTML(kimchi.substitute($('#interface-tmpl').html(),data));
$(".body", "#form-guest-edit-interface").append(itemNode);
$("select", itemNode).append(networkOptions);
if(data.network!==""){
diff --git a/ui/js/src/kimchi.guest_media_main.js b/ui/js/src/kimchi.guest_media_main.js
index 02009ec..d6dee2e 100644
--- a/ui/js/src/kimchi.guest_media_main.js
+++ b/ui/js/src/kimchi.guest_media_main.js
@@ -28,7 +28,7 @@ kimchi.guest_media_main = function() {
$.each(storages, function(index, storage) {
storage['vm'] = kimchi.selectedGuest;
- var templated = kimchi.template(rowHTML, storage);
+ var templated = kimchi.substitute(rowHTML, storage);
container.append(templated);
});
diff --git a/ui/js/src/kimchi.host.js b/ui/js/src/kimchi.host.js
index 4c94fc1..ee59a7e 100644
--- a/ui/js/src/kimchi.host.js
+++ b/ui/js/src/kimchi.host.js
@@ -485,7 +485,7 @@ kimchi.host_main = function() {
data['memory'] = kimchi.formatMeasurement(data['memory'], {
fixed: 2
});
- var templated = kimchi.template(htmlTmpl, data);
+ var templated = kimchi.substitute(htmlTmpl, data);
$('#host-content-container').html(templated);
initPage();
diff --git a/ui/js/src/kimchi.main.js b/ui/js/src/kimchi.main.js
index 86fed5b..184029d 100644
--- a/ui/js/src/kimchi.main.js
+++ b/ui/js/src/kimchi.main.js
@@ -69,7 +69,7 @@ kimchi.main = function() {
var tabs = retrieveTabs(tabConfigUrl);
kimchi.listPlugins(function(plugins) {
$(plugins).each(function(i, p) {
- var url = kimchi.template(pluginConfigUrl, {
+ var url = kimchi.substitute(pluginConfigUrl, {
plugin: p
});
tabs.push.apply(tabs, retrieveTabs(url));
diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js
index ca6d29b..875bc08 100644
--- a/ui/js/src/kimchi.network.js
+++ b/ui/js/src/kimchi.network.js
@@ -63,7 +63,7 @@ kimchi.getNetworkItemHtml = function(network) {
}
var disable_in_use = network.in_use ? "ui-state-disabled" : "";
- var networkItem = kimchi.template($('#networkItem').html(), {
+ var networkItem = kimchi.substitute($('#networkItem').html(), {
name : network.name,
state : network.state,
type : network.type,
diff --git a/ui/js/src/kimchi.storage_main.js b/ui/js/src/kimchi.storage_main.js
index 6052510..1493124 100644
--- a/ui/js/src/kimchi.storage_main.js
+++ b/ui/js/src/kimchi.storage_main.js
@@ -25,7 +25,7 @@ kimchi.doListStoragePools = function() {
value.capacity = kimchi.changetoProperUnit(value.capacity,1);
value.allocated = kimchi.changetoProperUnit(value.allocated,1);
if ('kimchi-iso' !== value.type) {
- listHtml += kimchi.template(storageHtml, value);
+ listHtml += kimchi.substitute(storageHtml, value);
}
});
$('#storagepoolsList').html(listHtml);
@@ -172,7 +172,7 @@ kimchi.doListVolumes = function(poolObj) {
value.poolname = poolObj.data('name');
value.capacity = kimchi.changetoProperUnit(value.capacity,1);
value.allocation = kimchi.changetoProperUnit(value.allocation,1);
- listHtml += kimchi.template(volumeHtml, value);
+ listHtml += kimchi.substitute(volumeHtml, value);
});
volumeDiv.html(listHtml);
} else {
diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js
index 86dbe7f..050aa90 100644
--- a/ui/js/src/kimchi.storagepool_add_main.js
+++ b/ui/js/src/kimchi.storagepool_add_main.js
@@ -30,7 +30,7 @@ kimchi.initStorageAddPage = function() {
valid_types = ['part', 'disk', 'mpath'];
$.each(data, function(index, value) {
if (valid_types.indexOf(value.type) != -1) {
- listHtml += kimchi.template(deviceHtml, value);
+ listHtml += kimchi.substitute(deviceHtml, value);
}
});
$('.host-partition').html(listHtml);
diff --git a/ui/js/src/kimchi.template.js b/ui/js/src/kimchi.substitute.js
similarity index 96%
rename from ui/js/src/kimchi.template.js
rename to ui/js/src/kimchi.substitute.js
index 082269f..9d4dff6 100644
--- a/ui/js/src/kimchi.template.js
+++ b/ui/js/src/kimchi.substitute.js
@@ -15,7 +15,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-kimchi.template = function(templateStr, data, tag) {
+kimchi.substitute = function(templateStr, data, tag) {
tag = tag || /\{([^\}]+)\}/g;
var escapeHtml = function(html) {
diff --git a/ui/js/src/kimchi.template_add_main.js b/ui/js/src/kimchi.template_add_main.js
index dbb3952..e9adbac 100644
--- a/ui/js/src/kimchi.template_add_main.js
+++ b/ui/js/src/kimchi.template_add_main.js
@@ -152,7 +152,7 @@ kimchi.template_add_main = function() {
volume.isoId = isoId;
volume.capacity = kimchi.changetoProperUnit(volume.capacity, 1);
kimchi.isoInfo[isoId] = volume;
- html += kimchi.template(template, volume);
+ html += kimchi.substitute(template, volume);
}
});
$('#list-local-iso').append(html);
@@ -266,7 +266,7 @@ kimchi.template_add_main = function() {
if (!kimchi.isoInfo[isoId]) {
volume.isoId = isoId;
kimchi.isoInfo[isoId] = volume;
- html += kimchi.template(template, volume);
+ html += kimchi.substitute(template, volume);
}
});
$('#list-remote-iso').html(html);
diff --git a/ui/js/src/kimchi.template_edit_main.js b/ui/js/src/kimchi.template_edit_main.js
index 9ff8bcc..cffc685 100644
--- a/ui/js/src/kimchi.template_edit_main.js
+++ b/ui/js/src/kimchi.template_edit_main.js
@@ -87,7 +87,7 @@ kimchi.template_edit_main = function() {
var html = '';
var tmpl = $('#tmpl-network').html();
$.each(result, function(index, network) {
- html += kimchi.template(tmpl, network);
+ html += kimchi.substitute(tmpl, network);
});
$('#template-edit-network-list').html(html).show();
if(template.networks && template.networks.length > 0) {
diff --git a/ui/js/src/kimchi.template_main.js b/ui/js/src/kimchi.template_main.js
index 160ecc8..b90e3f3 100644
--- a/ui/js/src/kimchi.template_main.js
+++ b/ui/js/src/kimchi.template_main.js
@@ -22,7 +22,7 @@ kimchi.doListTemplates = function() {
var listHtml = '';
var templateHtml = $('#templateTmpl').html();
$.each(result, function(index, value) {
- listHtml += kimchi.template(templateHtml, value);
+ listHtml += kimchi.substitute(templateHtml, value);
});
$('#templateList').html(listHtml);
kimchi.templateBindClick();
--
1.8.1.4
10 years, 4 months