[PATCH v3] [UI] Grid Loading Mask - Some Elements are Missing
by Hongliang Wang
Some elements were lost and add them back here:
1) Show a message under the icon
2) Put the icon and text in the center both horizontally and vertically
3) Give the mask a opacity value
4) Hide the mask initially
v2 -> v3:
3a) Put toolbar under mask
(Adam King's comment)
v1 -> v2:
2a) Rebased.
Signed-off-by: Hongliang Wang <hlwang(a)linux.vnet.ibm.com>
---
ui/css/theme-default/grid.css | 13 +++++++------
ui/js/src/kimchi.grid.js | 6 ++++--
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/ui/css/theme-default/grid.css b/ui/css/theme-default/grid.css
index 958bdb0..44ae614 100644
--- a/ui/css/theme-default/grid.css
+++ b/ui/css/theme-default/grid.css
@@ -214,27 +214,28 @@
}
.grid-mask {
+ background: rgba(190, 190, 190, .9);
bottom: 0;
left: 0;
position: absolute;
right: 0;
- top: 48px;
+ z-index: 5;
}
.grid-loading {
bottom: 0;
- height: 100%;
+ height: 68px;
left: 0;
margin: auto;
+ position: absolute;
right: 0;
text-align: center;
top: 0;
- width: 100%;
+ width: 49px;
}
.grid-loading-icon {
background: url("../images/theme-default/kimchi-loading.gif") no-repeat left top;
- height: 100%;
- width: 100%;
- background-position: center;
+ height: 48px;
+ width: 49px;
}
diff --git a/ui/js/src/kimchi.grid.js b/ui/js/src/kimchi.grid.js
index e5892ff..540f1ba 100644
--- a/ui/js/src/kimchi.grid.js
+++ b/ui/js/src/kimchi.grid.js
@@ -57,7 +57,9 @@ kimchi.widget.Grid = function(params) {
'<div class="grid-mask hidden">',
'<div class="grid-loading">',
'<div class="grid-loading-icon"></div>',
- '<div class="grid-loading-text"></div>',
+ '<div class="grid-loading-text">',
+ i18n['KCHGRD6001M'],
+ '</div>',
'</div>',
'</div>',
'</div>'
@@ -157,7 +159,7 @@ kimchi.widget.Grid = function(params) {
gridContentNode.css('top', (captionHeight + toolbarHeight) + 'px');
var maskNode = $('.grid-mask', gridNode);
- maskNode.css('top', (captionHeight + toolbarHeight) + 'px');
+ maskNode.css('top', captionHeight + 'px');
var fillBody = function(container, fields, data) {
var tbody = ($('tbody', container).length && $('tbody', container))
--
1.8.1.4
10 years, 9 months
[PATCH] [UI] Fix Bug - Text Overlapped in Template Add Window
by Hongliang Wang
Aline found the bug which is caused by commit 23b5850.
Fix it in this patch.
Signed-off-by: Hongliang Wang <hlwang(a)linux.vnet.ibm.com>
---
ui/css/theme-default/window.css | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/ui/css/theme-default/window.css b/ui/css/theme-default/window.css
index 3d6d563..22e6327 100644
--- a/ui/css/theme-default/window.css
+++ b/ui/css/theme-default/window.css
@@ -49,7 +49,8 @@
max-height: 100%;
}
-.window header {
+.window>header,
+.window>form>header {
position: absolute;
left: 0;
right: 0;
@@ -99,12 +100,14 @@
cursor: pointer;
}
-.window header>.close:HOVER {
+.window>header>.close:HOVER,
+.window>form>header>.close:HOVER {
border: 2px solid #444;
color: #444;
}
-.window header>.title {
+.window>header>.title,
+.window>form>header>.title {
font-size: 18px;
height: 48px;
line-height: 48px;
--
1.8.1.4
10 years, 9 months
[PATCH] Fix multiple pep8
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Make check fails with pep8 version 1.3.3.
Fix files revolve to comply with pep8.
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
src/kimchi/auth.py | 2 +-
src/kimchi/model/networks.py | 2 +-
src/kimchi/osinfo.py | 2 +-
src/kimchi/root.py | 4 ++--
4 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/kimchi/auth.py b/src/kimchi/auth.py
index b042d73..501afb2 100644
--- a/src/kimchi/auth.py
+++ b/src/kimchi/auth.py
@@ -136,7 +136,7 @@ def check_auth_session():
kimchiRobot = cherrypy.request.headers.get('Kimchi-Robot')
if kimchiRobot == "kimchi-robot":
if (time.time() - cherrypy.session[REFRESH] >
- cherrypy.session.timeout * 60):
+ cherrypy.session.timeout * 60):
cherrypy.session[USER_ID] = None
cherrypy.lib.sessions.expire()
raise cherrypy.HTTPError(401)
diff --git a/src/kimchi/model/networks.py b/src/kimchi/model/networks.py
index 0242156..b7096e5 100644
--- a/src/kimchi/model/networks.py
+++ b/src/kimchi/model/networks.py
@@ -64,7 +64,7 @@ class NetworksModel(object):
# FIXME we can not distinguish this error from other internal
# error by error code.
if ("network is already in use by interface"
- in e.message.lower()):
+ in e.message.lower()):
# libvirt do not support update IP element, so delete the
# the network and create new one.
net.undefine()
diff --git a/src/kimchi/osinfo.py b/src/kimchi/osinfo.py
index 02dbabf..c5f889b 100644
--- a/src/kimchi/osinfo.py
+++ b/src/kimchi/osinfo.py
@@ -113,7 +113,7 @@ def lookup(distro, version):
if distro in modern_version_bases[arch]:
if LooseVersion(version) >= LooseVersion(
- modern_version_bases[arch][distro]):
+ modern_version_bases[arch][distro]):
params.update(template_specs[arch]['modern'])
else:
params.update(template_specs[arch]['old'])
diff --git a/src/kimchi/root.py b/src/kimchi/root.py
index 5bad9b4..9bae34a 100644
--- a/src/kimchi/root.py
+++ b/src/kimchi/root.py
@@ -51,7 +51,7 @@ class Root(Resource):
data = {'code': status, 'reason': message}
res = template.render('error.html', data)
if (type(res) is unicode and
- LooseVersion(cherrypy.__version__) < LooseVersion('3.2.5')):
+ LooseVersion(cherrypy.__version__) < LooseVersion('3.2.5')):
res = res.encode("utf-8")
return res
@@ -60,7 +60,7 @@ class Root(Resource):
'call_stack': cherrypy._cperror.format_exc()}
res = template.render('error.html', data)
if (type(res) is unicode and
- LooseVersion(cherrypy.__version__) < LooseVersion('3.2.5')):
+ LooseVersion(cherrypy.__version__) < LooseVersion('3.2.5')):
res = res.encode("utf-8")
return res
--
1.8.1.2
10 years, 9 months
[PATCH] Skip 'screendump' for vms no video device configured
by Mark Wu
It's observed that if a vm is created by external tool and doesn't
have video device, libivrt will keep reporting the following error
message:
"internal error: unable to execute QEMU command 'screendump':
There is no QemuConsole I can screendump from."
This patch skips screendump for that kinds of vms to avoid the error
message and repeately sending the black images. On UI side, it changes
to display vm's icon instead of the black image if it doesn't have
video device.
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
---
src/kimchi/model/vms.py | 6 +++++-
ui/js/src/kimchi.guest_main.js | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/model/vms.py b/src/kimchi/model/vms.py
index 3b8a666..79b335c 100644
--- a/src/kimchi/model/vms.py
+++ b/src/kimchi/model/vms.py
@@ -275,6 +275,10 @@ class VMModel(object):
def _live_vm_update(self, dom, params):
pass
+ def _has_video(self, dom):
+ dom = ElementTree.fromstring(dom.XMLDesc(0))
+ return dom.find('devices/video') is not None
+
def lookup(self, name):
dom = self.get_vm(name, self.conn)
info = dom.info()
@@ -284,7 +288,7 @@ class VMModel(object):
graphics_type, graphics_listen, graphics_port = graphics
graphics_port = graphics_port if state == 'running' else None
try:
- if state == 'running':
+ if state == 'running' and self._has_video(dom):
screenshot = self.vmscreenshot.lookup(name)
elif state == 'shutoff':
# reset vm stats when it is powered off to avoid sending
diff --git a/ui/js/src/kimchi.guest_main.js b/ui/js/src/kimchi.guest_main.js
index bdd5a69..8a20d07 100644
--- a/ui/js/src/kimchi.guest_main.js
+++ b/ui/js/src/kimchi.guest_main.js
@@ -186,7 +186,7 @@ kimchi.createGuestLi = function(vmObject, prevScreenImage, openMenu) {
guestTitle.html(vmObject.name);
//Setup the VM console thumbnail display
- var curImg = vmObject.state == 'running' ? vmObject.screenshot : vmObject.icon;
+ var curImg = vmObject.screenshot || vmObject.icon;
var load_src = curImg || 'images/icon-vm.png';
var tile_src = prevScreenImage || vmObject['load-src'];
var liveTile=result.find('div[name=guest-tile] > .tile');
--
1.8.4.2
10 years, 9 months
[RFC] create a vm on a lun directly
by Sheldon
Now we have support iSCSI or SCSI pool.
But we do not make use of the iSCSI or SCSI pool at present.
Here we want to create volumes for VM in those pools.
The best way to do it is on template level - and not on vm level
For if we create a template just assign a iSCSI or SCSI pool, the user
still need to choose
a volume for his VM.
in the edit template page, we list the storage pool and the volume
like:
dir-pool-1
nfs-pool-2
iscsi-pool-1/lun-1
iscsi-pool-1/lun-2
iscsi-pool-1/lun-3
scsi-pool-1/lun-1
scsi-pool-1/lun-2
when selecting the storage pool with type iSCSI or SCSI the user also
select the volume.
The user can create a VM with this volume.
But we should let user know it is dangerous to avoid user mistake when
he choose the volume.
1. Now we only use the volume to create the vm not support shareable volume.
use the same volume in multiples vms, a new install will overwrite the
current content.
We can check the volume ref_cnt to avoid this.
2. even this lun is not used buy vm, maybe the Adam has added a lun to a
VG or use it on other purpose
Should we check the lun is is used external kimchi?
If a lun is added to a VG, need to check it?
If adam format a lun and create a files system on, need to check it?
Or we just prompt the data on this volume will destroyed.
--
Thanks and best regards!
Sheldon Feng(冯少合)<shaohef(a)linux.vnet.ibm.com>
IBM Linux Technology Center
10 years, 9 months
[PATCH] [PATCH] bug fix: instantiate the apt-get manager when update the apt-get packages list
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
I have not test this patch on ubuntu.
I just test the yum patch.
We should make sure:
1. apt-get packages list can be updated after apt-get update a package.
2. there should not be a apt-get lock conflict when get apt-get packages list and
update apt-get packages.
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
src/kimchi/swupdate.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/kimchi/swupdate.py b/src/kimchi/swupdate.py
index dc48153..6ab968f 100644
--- a/src/kimchi/swupdate.py
+++ b/src/kimchi/swupdate.py
@@ -170,16 +170,17 @@ class AptUpdate(object):
"""
def __init__(self):
self._pkgs = {}
- self._apt_cache = getattr(__import__('apt'), 'Cache')()
+ self._apt_cache = getattr(__import__('apt'), 'Cache')
self.update_cmd = ['apt-get', 'upgrade', '-y']
def _refreshUpdateList(self):
"""
Update the list of packages to be updated in the system.
"""
- self._apt_cache.update()
- self._apt_cache.upgrade()
- self._pkgs = self._apt_cache.get_changes()
+ apt_cache = self._apt_cache()
+ apt_cache.update()
+ apt_cache.upgrade()
+ self._pkgs = apt_cache.get_changes()
def getPackagesList(self):
"""
--
1.8.5.3
10 years, 9 months
[PATCH 0/3] check the python code with pyflakes
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Pyflakes analyzes programs and detects various errors. It works by
parsing the source file, not importing it, so it is safe to use on
modules with side effects. It's also much faster.
This is important to improve the code quality.
ShaoHe Feng (3):
make pyflakes happly
add template_delete to rollback after create a template
run pyflakes when make check
Makefile.am | 7 +++++++
configure.ac | 7 +++++++
contrib/DEBIAN/control.in | 1 +
contrib/kimchi.spec.fedora.in | 1 +
docs/README.md | 6 +++---
src/kimchi/control/plugins.py | 2 +-
src/kimchi/featuretests.py | 2 --
src/kimchi/mockmodel.py | 6 +++---
src/kimchi/model/storagepools.py | 2 +-
src/kimchi/screenshot.py | 1 -
src/kimchi/template.py | 1 -
tests/test_model.py | 1 +
tests/test_server.py | 1 -
ui/pages/help/gen-index.py | 1 -
14 files changed, 25 insertions(+), 14 deletions(-)
--
1.8.4.2
10 years, 9 months
[PATCH] [API Docs] Keep Document Consistent with Code Logic
by Hongliang Wang
is_mirror field is not allowed to update so remove the lines in
API document.
Signed-off-by: Hongliang Wang <hlwang(a)linux.vnet.ibm.com>
---
docs/API.md | 2 --
1 file changed, 2 deletions(-)
diff --git a/docs/API.md b/docs/API.md
index fc39c65..c24af9e 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -891,8 +891,6 @@ repository.
* baseurl *(optional)*: URL to the repodata directory when
"is_mirror" is false. Otherwise, it can be URL to the mirror system for
YUM. Can be an http://, ftp:// or file:// URL.
- * is_mirror *(optional)*: Set the given URI of baseurl as a mirror
-list, instead of use baseurl in repository configuration.
* url_args *(optional)*: Arguments to be passed to baseurl, like the
list of APT repositories provided by the same baseurl.
* gpgcheck *(optional)*: Indicates if a GPG signature check on the
--
1.8.1.4
10 years, 9 months
[PATCH v2] Report debug report's file path instead of uri path.
by Mark Wu
Now the file path displayed on UI is "/data/debugreports/<reportname>/",
It's misleading because people could assume it's path on file system,
but it's the uri path in fact. We don't need expose the URI path because
the download button can help user to get the file.
---
docs/API.md | 3 ++-
src/kimchi/control/debugreports.py | 1 +
src/kimchi/model/debugreports.py | 6 ++++--
ui/js/src/kimchi.host.js | 2 +-
4 files changed, 8 insertions(+), 4 deletions(-)
diff --git a/docs/API.md b/docs/API.md
index b3b6c49..6f4f03a 100644
--- a/docs/API.md
+++ b/docs/API.md
@@ -668,7 +668,8 @@ specific to the low level collection tool being used.
* **GET**: Retrieve the full description of Debug Report
* name: The debug report name used to identify the report
- * file: The debug report file name used to identify the report
+ * file: The debug report's file path on kimchi host
+ * uri: The URI path to download this debug report
* time: The time when the debug report is created
* **DELETE**: Remove the Debug Report
diff --git a/src/kimchi/control/debugreports.py b/src/kimchi/control/debugreports.py
index 9922cfa..d6ca620 100644
--- a/src/kimchi/control/debugreports.py
+++ b/src/kimchi/control/debugreports.py
@@ -38,6 +38,7 @@ class DebugReport(Resource):
def data(self):
return {'name': self.ident,
'file': self.info['file'],
+ 'uri': self.info['uri'],
'time': self.info['ctime']}
diff --git a/src/kimchi/model/debugreports.py b/src/kimchi/model/debugreports.py
index c6e698b..b144496 100644
--- a/src/kimchi/model/debugreports.py
+++ b/src/kimchi/model/debugreports.py
@@ -161,8 +161,10 @@ class DebugReportModel(object):
ctime = os.stat(file_target).st_ctime
ctime = time.strftime("%Y-%m-%d-%H:%M:%S", time.localtime(ctime))
file_target = os.path.split(file_target)[-1]
- file_target = os.path.join("/data/debugreports", file_target)
- return {'file': file_target,
+ file_path = os.path.join(path, file_target)
+ uri_path = os.path.join("/data/debugreports", file_target)
+ return {'file': file_path,
+ 'uri': uri_path,
'ctime': ctime}
def delete(self, name):
diff --git a/ui/js/src/kimchi.host.js b/ui/js/src/kimchi.host.js
index 7974054..0aaf2f0 100644
--- a/ui/js/src/kimchi.host.js
+++ b/ui/js/src/kimchi.host.js
@@ -87,7 +87,7 @@ kimchi.host_main = function() {
}
kimchi.downloadReport({
- file: report['file']
+ file: report['uri']
});
}
}],
--
1.8.4.2
10 years, 9 months
[PATCH] Grid widget presently interprets displays null values as null strings
by Adam King
Update the fillBody function to translate null to '' for display purposes.
Signed-off-by: Adam King <rak(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.grid.js | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/js/src/kimchi.grid.js b/ui/js/src/kimchi.grid.js
index 2e3d0ed..e5892ff 100644
--- a/ui/js/src/kimchi.grid.js
+++ b/ui/js/src/kimchi.grid.js
@@ -167,7 +167,7 @@ kimchi.widget.Grid = function(params) {
var rowNode = $('<tr></tr>').appendTo(tbody);
$.each(fields, function(fi, field) {
var fieldName = field['name'];
- var value = row[fieldName];
+ var value = (row[fieldName]==null) ? '' : row[fieldName];
$('<td><div class="cell-text-wrapper"' +
(field['makeTitle'] === true
? ' title="' + value + '"'
--
1.8.1.4
10 years, 9 months