[PATCH 0/3] Update button labels
by Crístian Viana
Crístian Viana (3):
Add missing closing quote in HTML code
Use the verb "Create" in all create operations
Use action verb as the main button's label
po/en_US.po | 11 ++++-------
po/kimchi.pot | 7 ++-----
po/pt_BR.po | 11 ++++-------
po/zh_CN.po | 11 ++++-------
ui/js/src/kimchi.guest_edit_main.js | 8 ++++----
ui/js/src/kimchi.repository_edit_main.js | 6 +++---
ui/js/src/kimchi.template_edit_main.js | 2 +-
ui/pages/guest-edit.html.tmpl | 4 ++--
ui/pages/repository-edit.html.tmpl | 4 ++--
ui/pages/storagepool-add.html.tmpl | 2 +-
ui/pages/template-add.html.tmpl | 2 +-
ui/pages/template-edit.html.tmpl | 2 +-
12 files changed, 29 insertions(+), 41 deletions(-)
--
1.9.0
10 years, 6 months
[PATCH] use LibvirtConnection instead of libivrt open directily to to get connection
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
On my F20, the kimchi can not start. It report:
$ sudo PYTHONPATH=src ./src/kimchid
*** Running feature tests ***
[21/May/2014:19:41:48] ENGINE Error in 'start' listener <bound method
CapabilitiesModel._set_capabilities of
<kimchi.model.config.CapabilitiesModel object at 0x314ac10>>
Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/cherrypy/process/wspbus.py",
line 197, in publish
output.append(listener(*args, **kwargs))
File "/home/shhfeng/work/workdir/kimchi/src/kimchi/model/config.py",
line 69, in _set_capabilities
self.metadata_support = FeatureTests.has_metadata_support()
File "/home/shhfeng/work/workdir/kimchi/src/kimchi/featuretests.py",
line 197, in has_metadata_support
conn = libvirt.open('qemu:///system')
File "/usr/lib64/python2.7/site-packages/libvirt.py", line 247, in
open
if ret is None:raise libvirtError('virConnectOpen() failed')
libvirtError: Failed to connect socket to
'/var/run/libvirt/libvirt-sock': Connection refused
[21/May/2014:19:41:48] ENGINE Shutting down due to error in start
listener:
[21/May/2014:19:41:48] ENGINE Bus STOPPING
Now use LibvirtConnection to get connection, kimchi can work well.
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
src/kimchi/featuretests.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/kimchi/featuretests.py b/src/kimchi/featuretests.py
index 5192361..df833e1 100644
--- a/src/kimchi/featuretests.py
+++ b/src/kimchi/featuretests.py
@@ -28,6 +28,7 @@
from lxml.builder import E
+from kimchi.model.libvirtconnection import LibvirtConnection
from kimchi.rollbackcontext import RollbackContext
from kimchi.utils import kimchi_log
@@ -104,7 +105,7 @@ def libvirt_supports_iso_stream(protocol):
conn = None
try:
FeatureTests.disable_screen_error_logging()
- conn = libvirt.open('qemu:///system')
+ conn = LibvirtConnection('qemu:///system').get()
dom = conn.defineXML(xml)
dom.undefine()
return True
@@ -122,7 +123,7 @@ def _get_xml():
xml = ET.tostring(obj)
return xml
try:
- conn = libvirt.open('qemu:///system')
+ conn = LibvirtConnection('qemu:///system').get()
FeatureTests.disable_screen_error_logging()
conn.findStoragePoolSources('netfs', _get_xml(), 0)
except libvirt.libvirtError as e:
@@ -174,7 +175,7 @@ def qemu_iso_stream_dns():
def libvirt_support_fc_host():
try:
FeatureTests.disable_screen_error_logging()
- conn = libvirt.open('qemu:///system')
+ conn = LibvirtConnection('qemu:///system').get()
pool = None
pool = conn.storagePoolDefineXML(SCSI_FC_XML, 0)
except libvirt.libvirtError as e:
@@ -194,7 +195,7 @@ def has_metadata_support():
with RollbackContext() as rollback:
FeatureTests.disable_screen_error_logging()
rollback.prependDefer(FeatureTests.enable_screen_error_logging)
- conn = libvirt.open('qemu:///system')
+ conn = LibvirtConnection('qemu:///system').get()
rollback.prependDefer(conn.close)
dom = conn.defineXML(SIMPLE_VM_XML)
rollback.prependDefer(dom.undefine)
--
1.9.0
10 years, 6 months
[PATCH] novnc does not work in IE
by Adam King
vnc_auto.html has 2 meta tags for X-UA-Compatible preventing the IE mode from taking effect. Combine them so they are both effective.
Signed-off-by: Adam King <rak(a)linux.vnet.ibm.com>
---
ui/pages/vnc_auto.html.tmpl | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/ui/pages/vnc_auto.html.tmpl b/ui/pages/vnc_auto.html.tmpl
index f295019..bd96d60 100644
--- a/ui/pages/vnc_auto.html.tmpl
+++ b/ui/pages/vnc_auto.html.tmpl
@@ -12,8 +12,7 @@
-->
<head>
<title>noVNC</title>
- <meta http-equiv="X-UA-Compatible" content="chrome=1">
- <meta http-equiv="X-UA-Compatible" content="IE=edge"/>
+ <meta http-equiv="X-UA-Compatible" content="chrome=1, IE=Edge">
<link rel="stylesheet" href="$href("/css/novnc/base.css")" title="plain">
<script type='text/javascript'>
var INCLUDE_URI = "/js/novnc/";
--
1.9.0
10 years, 6 months
[PATCH] Code Refector: Extract Variables in kimchi.login_window.js
by Hongliang Wang
1. Refactor code.
2. Put focus on log-in button instead of password box when browser
automatically fill in log-in form.
Signed-off-by: Hongliang Wang <hlwang(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.login_window.js | 17 ++++++++++-------
1 file changed, 10 insertions(+), 7 deletions(-)
diff --git a/ui/js/src/kimchi.login_window.js b/ui/js/src/kimchi.login_window.js
index 9c06a50..c562159 100644
--- a/ui/js/src/kimchi.login_window.js
+++ b/ui/js/src/kimchi.login_window.js
@@ -50,6 +50,9 @@ kimchi.login_main = function() {
return true;
};
+ var userNameBox = $('#username');
+ var passwordBox = $('#password');
+ var loginButton = $('#btn-login');
var placeCursor = function(id) {
if (id && $('#' + id).size() > 0) {
$('#' + id).focus();
@@ -57,10 +60,10 @@ kimchi.login_main = function() {
}
var userName = kimchi.user.getUserName();
- userName && $('#username').val(userName);
+ userName && !userNameBox.val() && userNameBox.val(userName);
+ var password = passwordBox.val();
- var nodeToFocus = ! $('#username').val() ? $('#username') :
- (! $('#password').val() ? $('#password') : $('#btn-login'));
+ var nodeToFocus = !userName ? userNameBox : !password ? passwordBox : loginButton;
$(nodeToFocus).focus();
};
@@ -71,13 +74,13 @@ kimchi.login_main = function() {
return false;
}
- $('#btn-login').text(i18n['KCHAUTH6002M']).prop('disabled', true);
+ loginButton.text(i18n['KCHAUTH6002M']).prop('disabled', true);
- var userName = $('#username').val();
+ var userName = userNameBox.val();
userName && kimchi.user.setUserName(userName);
var settings = {
username: userName,
- password: $("#password").val()
+ password: passwordBox.val()
};
kimchi.login(settings, function() {
@@ -121,5 +124,5 @@ kimchi.login_main = function() {
$('#form-login').on('submit', login);
- placeCursor();
+ setTimeout(placeCursor, 0);
};
--
1.8.1.4
10 years, 6 months
[PATCH] Disable metadata log output in every guest refresh
by Crístian Viana
The libvirt function "metadata" always displays an error message when
the VM does not have a metadata section in its XML descriptor. Kimchi
refreshes the VM information every few seconds and a lot of error output
is printed on the console. The real exception can still be logged by the
"try/except" block, so the error itself is not being silenced, only its
output.
Even though this patch has no relation to feature tests, the functions which
enable/disable the libvirt error messages are located inside the class
FeatureTests so we need to import them.
Silence the metadata error output when trying to read the metadata
information from a VM.
Signed-off-by: Crístian Viana <vianac(a)linux.vnet.ibm.com>
---
src/kimchi/model/utils.py | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/kimchi/model/utils.py b/src/kimchi/model/utils.py
index a94c7f8..c9ab1d4 100644
--- a/src/kimchi/model/utils.py
+++ b/src/kimchi/model/utils.py
@@ -19,6 +19,7 @@
import re
from kimchi.exception import OperationFailed
+from kimchi.featuretests import FeatureTests
from kimchi.model.config import CapabilitiesModel
import libvirt
from lxml import etree
@@ -84,6 +85,7 @@ def _kimchi_set_metadata_node(dom, node):
def libvirt_get_kimchi_metadata_node(dom, mode="current"):
+ FeatureTests.disable_screen_error_logging()
try:
xml = dom.metadata(libvirt.VIR_DOMAIN_METADATA_ELEMENT,
KIMCHI_META_URL,
@@ -91,6 +93,8 @@ def libvirt_get_kimchi_metadata_node(dom, mode="current"):
return etree.fromstring(xml)
except libvirt.libvirtError:
return None
+ finally:
+ FeatureTests.enable_screen_error_logging()
def set_metadata_node(dom, node, mode="all"):
--
1.9.0
10 years, 6 months
[PATCH] Repository Grid Column Resizing Issue
by Hongliang Wang
Last commit was reverted because it failed for Ubuntu system.
Added it back and made it work for Ubuntu with this patch.
Signed-off-by: Hongliang Wang <hlwang(a)linux.vnet.ibm.com>
---
ui/css/theme-default/host.css | 24 ++++++++++++++++++++++++
ui/js/src/kimchi.host.js | 8 ++++----
2 files changed, 28 insertions(+), 4 deletions(-)
diff --git a/ui/css/theme-default/host.css b/ui/css/theme-default/host.css
index 6a1a308..dc7fccf 100644
--- a/ui/css/theme-default/host.css
+++ b/ui/css/theme-default/host.css
@@ -258,4 +258,28 @@
height: 200px;
width: 850px;
}
+
+.host-panel #repositories-grid .repository-id {
+ width: 120px;
+}
+
+.host-panel #repositories-grid .repository-name {
+ width: 640px;
+}
+
+.host-panel #repositories-grid .repository-enabled {
+ width: 92px;
+}
+
+.host-panel #repositories-grid .repository-baseurl.deb {
+ width: 400px;
+}
+
+.host-panel #repositories-grid .repository-enabled.deb {
+ width: 100px;
+}
+
+.host-panel #repositories-grid .repository-gpgcheck.deb {
+ width: 150px;
+}
/* End of Repository */
diff --git a/ui/js/src/kimchi.host.js b/ui/js/src/kimchi.host.js
index 4c94fc1..3b0adec 100644
--- a/ui/js/src/kimchi.host.js
+++ b/ui/js/src/kimchi.host.js
@@ -47,19 +47,19 @@ kimchi.host_main = function() {
name: 'baseurl',
label: i18n['KCHREPO6006M'],
makeTitle: true,
- 'class': 'repository-baseurl'
+ 'class': 'repository-baseurl deb'
}, {
name: 'enabled',
label: i18n['KCHREPO6009M'],
- 'class': 'repository-enabled'
+ 'class': 'repository-enabled deb'
}, {
name: 'config[dist]',
label: "dist",
- 'class': 'repository-gpgcheck'
+ 'class': 'repository-gpgcheck deb'
}, {
name: 'config[comps]',
label: "comps",
- 'class': 'repository-gpgcheck'
+ 'class': 'repository-gpgcheck deb'
}];
}
else {
--
1.8.1.4
10 years, 6 months
[PATCH] Issue #100: do not delete the VM when storage volume not found
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
The VM may not be in a certain pool for some reasons.
Or the pool may not be active for some reasons.
We do not allow to delete this VM in this case.
And report the detail message to user.
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Signed-off-by: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
---
src/kimchi/model/vms.py | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/model/vms.py b/src/kimchi/model/vms.py
index 17bda04..3201fdd 100644
--- a/src/kimchi/model/vms.py
+++ b/src/kimchi/model/vms.py
@@ -426,14 +426,25 @@ class VMModel(object):
if info['state'] == 'running':
self.poweroff(name)
+ vols = []
+ for path in paths:
+ try:
+ vols.append(conn.storageVolLookupByPath(path))
+ except libvirt.libvirtError as e:
+ if e.get_error_code() == libvirt.VIR_ERR_NO_STORAGE_VOL:
+ raise OperationFailed(
+ "KCHVM0021E",
+ {'name': name, 'err': e.get_error_message()})
+ else:
+ raise
+
try:
dom.undefine()
except libvirt.libvirtError as e:
raise OperationFailed("KCHVM0021E",
{'name': name, 'err': e.get_error_message()})
- for path in paths:
- vol = conn.storageVolLookupByPath(path)
+ for vol in vols:
pool = vol.storagePoolLookupByVolume()
xml = pool.XMLDesc(0)
pool_type = xmlutils.xpath_get_text(xml, "/pool/@type")[0]
--
1.9.0
10 years, 6 months
[PATCH] Fix Text Truncated Problem of Login Button
by Hongliang Wang
Long text in some languages of login button is truncated. Fix it in this patch.
Signed-off-by: Hongliang Wang <hlwang(a)linux.vnet.ibm.com>
---
ui/css/theme-default/login-window.css | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui/css/theme-default/login-window.css b/ui/css/theme-default/login-window.css
index 8a21090..f4ad5f8 100644
--- a/ui/css/theme-default/login-window.css
+++ b/ui/css/theme-default/login-window.css
@@ -69,7 +69,7 @@
#login-window .login-panel button {
font-size: 18px;
height: 40px;
- width: 160px;
+ min-width: 160px;
float: right;
}
--
1.8.1.4
10 years, 6 months
[PATCH v2] Fix text alignment on storage pool type combo boxes
by Crístian Viana
The storage pool type list does not have a left padding like the
other combo boxes in Kimchi, bringing the text very close to the UI
component's border.
The SCSI device list on the same window has the same alignment problem.
Apply a common CSS class to the combo boxes so they look like the other
objects in the application.
Signed-off-by: Crístian Viana <vianac(a)linux.vnet.ibm.com>
---
ui/pages/storagepool-add.html.tmpl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ui/pages/storagepool-add.html.tmpl b/ui/pages/storagepool-add.html.tmpl
index 977db66..ba85e6e 100644
--- a/ui/pages/storagepool-add.html.tmpl
+++ b/ui/pages/storagepool-add.html.tmpl
@@ -44,7 +44,7 @@
<div class="storage-type-wrapper-controls">
<div id="poolTypeId">
<input id="poolTypeInputId" name="type" type="hidden" value="dir"/>
- <span id="pool-type-label"></span><span class="arrow"></span>
+ <span id="pool-type-label" class="text"></span><span class="arrow"></span>
<div>
<ul id="storagePool-list">
</ul>
@@ -142,7 +142,7 @@
<div class="storage-type-wrapper-controls">
<div id="scsiAdapter">
<input type="hidden"/>
- <span></span><span class="arrow"></span>
+ <span class="text"></span><span class="arrow"></span>
<div><ul></ul></div>
</div>
</div>
--
1.9.0
10 years, 6 months
[PATCH] Remove button "Cancel" from modal dialog
by Crístian Viana
Only one of the modal dialogs in Kimchi has a "Cancel" button along with
the form submit button. That button layout is inconsistent with the rest of
the application and it provides the same functionality as the "X" button
present at the top of every dialog.
Remove the button "Cancel" from the dialog "Edit template".
Signed-off-by: Crístian Viana <vianac(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.template_edit_main.js | 4 ----
ui/pages/template-edit.html.tmpl | 1 -
2 files changed, 5 deletions(-)
diff --git a/ui/js/src/kimchi.template_edit_main.js b/ui/js/src/kimchi.template_edit_main.js
index f0f4718..9ff8bcc 100644
--- a/ui/js/src/kimchi.template_edit_main.js
+++ b/ui/js/src/kimchi.template_edit_main.js
@@ -104,10 +104,6 @@ kimchi.template_edit_main = function() {
});
});
- $('#tmpl-edit-button-cancel').on('click', function() {
- kimchi.window.close();
- });
-
$('#template-edit-storagePool').change(function() {
storagepool = $(this).val();
var storageArray = storagepool.split("/");
diff --git a/ui/pages/template-edit.html.tmpl b/ui/pages/template-edit.html.tmpl
index 434d938..8a4f0e4 100644
--- a/ui/pages/template-edit.html.tmpl
+++ b/ui/pages/template-edit.html.tmpl
@@ -141,7 +141,6 @@
</div>
<footer>
<div class="btn-group">
- <a id="tmpl-edit-button-cancel" class="btn-normal" href="javascript:void(0);"><span class="text">$_("Cancel")</span></a>
<a id="tmpl-edit-button-save" class="btn-normal" href="javascript:void(0);"><span class="text">$_("Save")</span></a>
</div>
</footer>
--
1.9.0
10 years, 6 months