[PATCH] Fix Kimchi UI issues on IE11
by Adam King
I discovered that the Kimchi UI would not render in IE11 due to some
Javascript syntax sensitivity. This patch corrects those issues.
Signed-off-by: Adam King <rak(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.main.js | 4 ++--
ui/js/src/kimchi.network.js | 18 +++++++++---------
ui/pages/kimchi-ui.html.tmpl | 1 +
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/ui/js/src/kimchi.main.js b/ui/js/src/kimchi.main.js
index 5387495..f652b46 100644
--- a/ui/js/src/kimchi.main.js
+++ b/ui/js/src/kimchi.main.js
@@ -197,7 +197,7 @@ kimchi.getDefaultPage = function(url) {
if (path) {
defautLocation = path.substring(0, path.length - 5);
}
- },
+ }
});
return defautLocation;
};
@@ -215,7 +215,7 @@ kimchi.getTabHtml = function(url) {
var path = $tab.find('path').text();
tabsHtml += "<li><a class='item' href=" + path + ">" + title + "</a></li>";
});
- },
+ }
});
return tabsHtml;
};
diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js
index c1f87ce..faf1285 100644
--- a/ui/js/src/kimchi.network.js
+++ b/ui/js/src/kimchi.network.js
@@ -135,7 +135,7 @@ kimchi.initNetworkCreation = function() {
var network = kimchi.getNetworkDialogValues();
var data = {
name : network.name,
- connection: network.type,
+ connection: network.type
};
if (network.type === kimchi.NETWORK_TYPE_BRIDGE) {
data.connection = "bridge";
@@ -160,6 +160,13 @@ kimchi.initNetworkCreation = function() {
};
kimchi.initNetworkDialog = function() {
+
+ buttonsObj= {};
+ buttonsObj['id'] = "networkFormOk";
+ buttonsObj['text'] = i18n.KCHAPI6005M;
+ buttonsObj['class'] = "ui-button-primary";
+ buttonsObj['disabled'] = true;
+ buttonsObj['click'] = function() { };
$("#networkConfig").dialog({
autoOpen : false,
modal : true,
@@ -174,14 +181,7 @@ kimchi.initNetworkDialog = function() {
beforeClose : function() {
kimchi.cleanNetworkDialog();
},
- buttons : [ {
- id : "networkFormOk",
- text : i18n.KCHAPI6005M,
- class: "ui-button-primary",
- disabled: true,
- click : function() {
- }
- } ]
+ buttons : [buttonsObj]
});
kimchi.setupNetworkFormEvent();
};
diff --git a/ui/pages/kimchi-ui.html.tmpl b/ui/pages/kimchi-ui.html.tmpl
index eebe886..31b46eb 100644
--- a/ui/pages/kimchi-ui.html.tmpl
+++ b/ui/pages/kimchi-ui.html.tmpl
@@ -30,6 +30,7 @@
<head>
<meta charset="UTF-8">
<title>Kimchi</title>
+<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<link rel="shortcut icon" href="images/logo.ico">
<link rel="stylesheet" href="$href('libs/themes/base/jquery-ui.min.css')">
--
1.8.1.4
10 years, 10 months
Fwd: [PATCH] Fix Kimchi UI issues on IE11
by Adam King
I discovered that the Kimchi UI would not render in IE11 due to some
Javascript syntax sensitivity. This patch corrects those issues.
Signed-off-by: Adam King <rak(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.main.js | 4 ++--
ui/js/src/kimchi.network.js | 18 +++++++++---------
ui/pages/kimchi-ui.html.tmpl | 1 +
3 files changed, 12 insertions(+), 11 deletions(-)
diff --git a/ui/js/src/kimchi.main.js b/ui/js/src/kimchi.main.js
index 5387495..f652b46 100644
--- a/ui/js/src/kimchi.main.js
+++ b/ui/js/src/kimchi.main.js
@@ -197,7 +197,7 @@ kimchi.getDefaultPage = function(url) {
if (path) {
defautLocation = path.substring(0, path.length - 5);
}
- },
+ }
});
return defautLocation;
};
@@ -215,7 +215,7 @@ kimchi.getTabHtml = function(url) {
var path = $tab.find('path').text();
tabsHtml += "<li><a class='item' href=" + path + ">" + title + "</a></li>";
});
- },
+ }
});
return tabsHtml;
};
diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js
index c1f87ce..faf1285 100644
--- a/ui/js/src/kimchi.network.js
+++ b/ui/js/src/kimchi.network.js
@@ -135,7 +135,7 @@ kimchi.initNetworkCreation = function() {
var network = kimchi.getNetworkDialogValues();
var data = {
name : network.name,
- connection: network.type,
+ connection: network.type
};
if (network.type === kimchi.NETWORK_TYPE_BRIDGE) {
data.connection = "bridge";
@@ -160,6 +160,13 @@ kimchi.initNetworkCreation = function() {
};
kimchi.initNetworkDialog = function() {
+
+ buttonsObj= {};
+ buttonsObj['id'] = "networkFormOk";
+ buttonsObj['text'] = i18n.KCHAPI6005M;
+ buttonsObj['class'] = "ui-button-primary";
+ buttonsObj['disabled'] = true;
+ buttonsObj['click'] = function() { };
$("#networkConfig").dialog({
autoOpen : false,
modal : true,
@@ -174,14 +181,7 @@ kimchi.initNetworkDialog = function() {
beforeClose : function() {
kimchi.cleanNetworkDialog();
},
- buttons : [ {
- id : "networkFormOk",
- text : i18n.KCHAPI6005M,
- class: "ui-button-primary",
- disabled: true,
- click : function() {
- }
- } ]
+ buttons : [buttonsObj]
});
kimchi.setupNetworkFormEvent();
};
diff --git a/ui/pages/kimchi-ui.html.tmpl b/ui/pages/kimchi-ui.html.tmpl
index eebe886..31b46eb 100644
--- a/ui/pages/kimchi-ui.html.tmpl
+++ b/ui/pages/kimchi-ui.html.tmpl
@@ -30,6 +30,7 @@
<head>
<meta charset="UTF-8">
<title>Kimchi</title>
+<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<link rel="shortcut icon" href="images/logo.ico">
<link rel="stylesheet" href="$href('libs/themes/base/jquery-ui.min.css')">
--
1.8.1.4
10 years, 10 months
[PATCH] Fix messages in guest UI
by Rodrigo Trujillo
In the guest UI, some messages were missed to add to i18n file.
This patch fixes this.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.guest_main.js | 16 ++++++++--------
ui/pages/i18n.html.tmpl | 8 ++++++++
2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/ui/js/src/kimchi.guest_main.js b/ui/js/src/kimchi.guest_main.js
index b5e7af3..d43b62f 100644
--- a/ui/js/src/kimchi.guest_main.js
+++ b/ui/js/src/kimchi.guest_main.js
@@ -31,7 +31,7 @@ kimchi.vmstart = function(event) {
kimchi.listVmsAuto();
}, function() {
startButton.removeClass('loading');
- kimchi.message.error(i18n['msg.fail.start']);
+ kimchi.message.error(i18n['KCHVM6002M']);
}
);
} else {
@@ -51,7 +51,7 @@ kimchi.vmstop = function(event) {
button.removeClass('loading');
kimchi.listVmsAuto();
}, function() {
- kimchi.message.error(i18n['msg.fail.stop']);
+ kimchi.message.error(i18n['KCHVM6003M']);
});
} else {
event.preventDefault();
@@ -65,7 +65,7 @@ kimchi.vmreset = function(event){
kimchi.resetVM(vm_id, function(result) {
kimchi.listVmsAuto();
}, function() {
- kimchi.message.error(i18n['msg.fail.reset']);
+ kimchi.message.error(i18n['KCHVM6004M']);
}
);
};
@@ -74,16 +74,16 @@ kimchi.vmdelete = function(event) {
var vm = $(this).closest('li[name=guest]');
var vm_id=vm.attr("id");
var settings = {
- title : i18n['msg.confirm.delete.title'],
- content : i18n['msg.vm.confirm.delete'],
- confirm : i18n['msg.confirm.delete.confirm'],
- cancel : i18n['msg.confirm.delete.cancel']
+ title : i18n['KCHVM6005M'],
+ content : i18n['KCHVM6006M'],
+ confirm : i18n['KCHAPI6002M'],
+ cancel : i18n['KCHAPI6003M']
};
kimchi.confirm(settings, function() {
kimchi.deleteVM(vm_id, function(result) {
kimchi.listVmsAuto();
}, function() {
- kimchi.message.error(i18n['msg.fail.delete']);
+ kimchi.message.error(i18n['KCHVM6007M']);
});
}, function() {
});
diff --git a/ui/pages/i18n.html.tmpl b/ui/pages/i18n.html.tmpl
index 613b707..cd48029 100644
--- a/ui/pages/i18n.html.tmpl
+++ b/ui/pages/i18n.html.tmpl
@@ -95,6 +95,14 @@ var i18n = {
'KCHVM6001M': "$_("This will delete the virtual machine and its virtual disks. This operation cannot be undone. Would you like to continue?")",
+ 'KCHVM6002M': "$_("Failed to start")",
+ 'KCHVM6003M': "$_("Failed to stop")",
+ 'KCHVM6004M': "$_("Failed to reset")",
+ 'KCHVM6005M': "$_("Delete Confirmation")",
+ 'KCHVM6006M': "$_("This will delete the VM and its virtual disks. "
+ "This operation cannot be undone. "
+ "Would you like to continue?")",
+ 'KCHVM6007M': "$_("Failed to delete")",
'KCHNET6001E': "$_("The VLAN id must be between 1 and 4094.")",
--
1.8.5.3
10 years, 10 months
[PATCH 0/2] cdrom: Fix cdrom update
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Cdrom update should be able to operated when vm is running,
and do no change to the device target.
Fix formal implementation.
Royce Lv (2):
cdrom: fix cdrom change media
cdrom: update model test for media update
src/kimchi/model/vmstorages.py | 116 ++++++++++++++++++++---------------------
tests/test_model.py | 14 +++--
2 files changed, 68 insertions(+), 62 deletions(-)
--
1.8.1.2
10 years, 10 months
[PATCH] Fix typo on API.json and add missing error messages
by Aline Manera
From: Aline Manera <alinefm(a)br.ibm.com>
Instead of storages_create and storages_update they should be
vmstorages_create and vmstorages_update.
Fix it in order to use jsonschema to validate data while adding/updating
vm cdrom.
Signed-off-by: Aline Manera <alinefm(a)br.ibm.com>
---
src/kimchi/API.json | 6 ++++--
src/kimchi/i18n.py | 5 +++--
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/kimchi/API.json b/src/kimchi/API.json
index d3a8e64..1189c01 100644
--- a/src/kimchi/API.json
+++ b/src/kimchi/API.json
@@ -352,8 +352,9 @@
"additionalProperties": false,
"error": "KCHAPI0001E"
},
- "storages_create": {
+ "vmstorages_create": {
"type": "object",
+ "error": "KCHCDROM0012E",
"properties": {
"dev": {
"description": "The storage (cd-rom) device name",
@@ -377,8 +378,9 @@
}
}
},
- "storage_update": {
+ "vmstorage_update": {
"type": "object",
+ "error": "KCHCDROM0013E",
"properties": {
"path": {
"description": "Path of iso image file or disk mount point",
diff --git a/src/kimchi/i18n.py b/src/kimchi/i18n.py
index 43acd71..dfc1b2b 100644
--- a/src/kimchi/i18n.py
+++ b/src/kimchi/i18n.py
@@ -197,15 +197,16 @@ messages = {
"KCHCDROM0001E": _("Invalid CDROM device name"),
"KCHCDROM0002E": _("Invalid storage type. Types supported: 'cdrom'"),
- "KCHCDROM0003E": _("The path %(value)s is not valid local/remote path for the device"),
+ "KCHCDROM0003E": _("The path '%(value)s' is not valid local/remote path for the device"),
"KCHCDROM0004E": _("Device name %(dev_name)s already exists in vm %(vm_name)s"),
- "KCHCDROM0005E": _("Must specify a device name"),
"KCHCDROM0006E": _("Can't specify a directory for a CDROM device path"),
"KCHCDROM0007E": _("The storage device %(dev_name)s does not exist in the guest %(vm_name)s"),
"KCHCDROM0008E": _("Error while creating new storage device: %(error)s"),
"KCHCDROM0009E": _("Error while updating storage device: %(error)s"),
"KCHCDROM0010E": _("Error while removing storage device: %(error)s"),
"KCHCDROM0011E": _("Do not support guest CDROM hot plug attachment"),
+ "KCHCDROM0012E": _("Specify type and path to add a new virtual machine disk"),
+ "KCHCDROM0013E": _("Specify path to update virtual machine disk"),
"KCHREPOS0001E": _("Repository ID must be one word only string."),
"KCHREPOS0002E": _("Repository URL must be an http://, ftp:// or file:// URL."),
--
1.7.10.4
10 years, 10 months
[PATCH] Issue #315: edit/delete templates that contains slashes in their names
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
we should unquote the resource name when it contains special characters.
issue:
https://github.com/kimchi-project/kimchi/issues/315
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
src/kimchi/control/base.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/kimchi/control/base.py b/src/kimchi/control/base.py
index e8f03ae..048dd34 100644
--- a/src/kimchi/control/base.py
+++ b/src/kimchi/control/base.py
@@ -54,6 +54,7 @@ class Resource(object):
"""
def __init__(self, model, ident=None):
self.model = model
+ ident = ident if ident is None else urllib2.unquote(ident)
self.ident = ident
self.model_args = (ident,)
self.update_params = []
@@ -61,7 +62,7 @@ class Resource(object):
def _redirect(self, ident, code=303):
if ident is not None and ident != self.ident:
uri_params = list(self.model_args[:-1])
- uri_params += [urllib2.quote(ident.encode('utf-8'))]
+ uri_params += [urllib2.quote(ident.encode('utf-8'), safe="")]
raise cherrypy.HTTPRedirect(self.uri_fmt % tuple(uri_params), code)
def generate_action_handler(self, action_name, action_args=None):
--
1.8.4.2
10 years, 10 months
[PATCH] Issue 316: allow dir storage directory path ending with '/'
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Allow dir storage directory path ending with '/'
issue:
https://github.com/kimchi-project/kimchi/issues/316
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.storagepool_add_main.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js
index ac97e1a..b634ca6 100644
--- a/ui/js/src/kimchi.storagepool_add_main.js
+++ b/ui/js/src/kimchi.storagepool_add_main.js
@@ -167,7 +167,7 @@ kimchi.validateDirForm = function () {
kimchi.message.error.code('KCHPOOL6002E');
return false;
}
- if (!/((\/([0-9a-zA-Z-_\.]+)))$/.test(path)) {
+ if (!/((\/([0-9a-zA-Z-_\.]+)\/*?))$/.test(path)) {
kimchi.message.error.code('KCHAPI6003E');
return false;
}
--
1.8.4.2
10 years, 10 months
[PATCH V2 0/4] Implement integrity verification: verify template integrity
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
V1 -> V2
rename invalid_integrity to validate_integrity
change list to array in API.md
list is the python semantic, array is json semantic.
Implement integrity verification: verify template integrity, update API.md
Sometimes, user create a template, but networks, cdrom, disks or
storagepool will change later.
So users can not create a vm from this template successfully.
It is necessary to check some paramenters of template.
ShaoHe Feng (4):
Implement integrity verification: verify template integrity, update
API.md
add a new method to get iso info for VMTemplate class
Implement integrity verification: verify template integrity in backend
Implement integrity verification: update test case
docs/API.md | 4 +++
src/kimchi/control/templates.py | 1 +
src/kimchi/mockmodel.py | 5 +++-
src/kimchi/model/templates.py | 7 +++++-
src/kimchi/vmtemplate.py | 54 ++++++++++++++++++++++++++++++++---------
tests/test_model.py | 33 +++++++++++++++++++++++++
tests/test_rest.py | 40 ++++++++++++++++++++++++++++++
7 files changed, 131 insertions(+), 13 deletions(-)
--
1.8.4.2
10 years, 10 months
[PATCH] Fix ui/js/Makefile.am
by Aline Manera
From: Aline Manera <alinefm(a)br.ibm.com>
kimchi-min.js is generated during build process so we need to explicit
list it on Makefile.
Signed-off-by: Aline Manera <alinefm(a)br.ibm.com>
---
ui/js/Makefile.am | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/js/Makefile.am b/ui/js/Makefile.am
index ed75ea2..aae9b9c 100644
--- a/ui/js/Makefile.am
+++ b/ui/js/Makefile.am
@@ -24,7 +24,7 @@ EXTRA_DIST = src widgets
jsdir = $(datadir)/kimchi/ui/js
-dist_js_DATA = $(wildcard *.js) $(NULL)
+dist_js_DATA = kimchi.min.js $(wildcard *.js) $(NULL)
kimchi.min.js: widgets/*.js src/*.js
cat $(sort $^) > $@
--
1.7.10.4
10 years, 10 months