[RFC] discover Kimchi peers
by Sheldon
I'd like to talk about how to discover Kimchi peers.
Now I just talk about discover a peer in a same network here.
I will use a local multicast subnetwork address
<http://en.wikipedia.org/wiki/Multicast_address#Local_subnetwork> to
find peers in one network.
Choose 224.0.0.132 as the kimchi multicast address, and 8000 as the port.
For cross network that need the router support multicast, so I give up
discover a peer cross network.
I will let user add the remote peers manully.
In the whole system all peers are equal. There will not be a center
discover service.
We will define two kinds of multicast message Notify and Search.
the format as follow.
# ____________________________________________
# | head | message body | tail |
# |___________________|_________________|______|
# |sizeof(messageBody)| json message | EOL |
# |___________________|_________________|______|
the flow of discover Kimchi peers:
1. one host multicast a "search" message. in this message it tell
himself information, and ask others tell their information.
Like this:
{"search": {"domain": "kimchi-host1", "IP": "192.168.0.3", "httpport":
"8000", "httpsport": "8001"}}
this means "hello, I'm a kimchi host, this is my information, can
you tell me who you are?"
2. others received a search will response an "notify" message.
Like this:
{"notify": {"domain": "kimchi-host1", "IP": "192.168.0.3",
"httpport": "8000", "httpsport": "8001"}}
this tells others that "hi, I'm a kimchi host, I'm alive and this
is my information"
o (user) 1 is "search"
/\ --------> 2 is "notify"
| 1 _____ ________________
kimchi-host1 ------2-<---| DB |<----2-----|multicast listen |<--2--
| |____| |_______________|
|
----------------------1-------------------------------> |
|
_____ |_____
| |
| switch |
| |
|___________|
o (user) |
/\ --------- -----------------------------2----------------------- --->|
| | _____ ________________ |
kimchi-host3 ------1<---| DB |<---1------|multicast listen |<---1--|
|____| |_______________|
we need to discuss:
1. should we support beat heart?
every kimchi host will send periodic notify to tell others himself
information?
2. should we support a "quit" message?
"quit" message tell other peers, that this kimchi quit normally. others
can remove this from peers list.
But the kimchi can not send "quit" when aborting abnormally.
3. Do we store the local peers information in DB?
we can collection the local peers and send them immediately when user
need to discover the peers.
We will extend to support remote peers, these information need to be
stored in DB.
--
Thanks and best regards!
Sheldon Feng(???)<shaohef(a)linux.vnet.ibm.com>
IBM Linux Technology Center
10 years, 5 months
[PATCH] Put focus on form's first field
by Crístian Viana
A good usability practice is to leave the focus on the first editable
field on a form. That way, the user can start typing immediately what
they want without having to use the mouse to click on the
input element.
Explicitely request focus to every form's first field. Some input
elements did not have an ID; in those cases, the IDs were also added
to the HTML code.
Signed-off-by: Crístian Viana <vianac(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.guest_add_main.js | 1 +
ui/js/src/kimchi.guest_edit_main.js | 1 +
ui/js/src/kimchi.report_add_main.js | 1 +
ui/js/src/kimchi.repository_add_main.js | 1 +
ui/js/src/kimchi.repository_edit_main.js | 1 +
ui/js/src/kimchi.storagepool_add_main.js | 1 +
ui/js/src/kimchi.template_edit_main.js | 2 ++
ui/pages/guest-add.html.tmpl | 2 +-
ui/pages/repository-add.html.tmpl | 2 +-
9 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/ui/js/src/kimchi.guest_add_main.js b/ui/js/src/kimchi.guest_add_main.js
index 2113099..0a4f5e6 100644
--- a/ui/js/src/kimchi.guest_add_main.js
+++ b/ui/js/src/kimchi.guest_add_main.js
@@ -77,6 +77,7 @@ kimchi.guest_add_main = function() {
$('#form-vm-add').on('submit', addGuest);
$('#vm-doAdd').on('click', addGuest);
+ $('#guest-add-id-textbox').focus();
showTemplates();
};
diff --git a/ui/js/src/kimchi.guest_edit_main.js b/ui/js/src/kimchi.guest_edit_main.js
index 0236e2d..3588dcc 100644
--- a/ui/js/src/kimchi.guest_edit_main.js
+++ b/ui/js/src/kimchi.guest_edit_main.js
@@ -225,4 +225,5 @@ kimchi.guest_edit_main = function() {
$(guestEditForm).on('submit', submitForm);
$(saveButton).on('click', submitForm);
+ $('#guest-edit-id-textbox').focus();
};
diff --git a/ui/js/src/kimchi.report_add_main.js b/ui/js/src/kimchi.report_add_main.js
index 8759c2b..f7f1b4b 100644
--- a/ui/js/src/kimchi.report_add_main.js
+++ b/ui/js/src/kimchi.report_add_main.js
@@ -43,4 +43,5 @@ kimchi.report_add_main = function() {
addReportForm.on('submit', submitForm);
submitButton.on('click', submitForm);
+ nameTextbox.focus();
};
diff --git a/ui/js/src/kimchi.repository_add_main.js b/ui/js/src/kimchi.repository_add_main.js
index 5dc84e5..4ee7a62 100644
--- a/ui/js/src/kimchi.repository_add_main.js
+++ b/ui/js/src/kimchi.repository_add_main.js
@@ -97,4 +97,5 @@ kimchi.repository_add_main = function() {
};
$(addForm).on('submit', addRepository);
+ $('#repo_id').focus();
};
diff --git a/ui/js/src/kimchi.repository_edit_main.js b/ui/js/src/kimchi.repository_edit_main.js
index 26d6c66..0b562ee 100644
--- a/ui/js/src/kimchi.repository_edit_main.js
+++ b/ui/js/src/kimchi.repository_edit_main.js
@@ -72,4 +72,5 @@ kimchi.repository_edit_main = function() {
$(editForm).on('submit', editRepository);
$(saveButton).on('click', editRepository);
+ $('#repository-edit-name-textbox').focus();
};
diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js
index 86dbe7f..d37a37d 100644
--- a/ui/js/src/kimchi.storagepool_add_main.js
+++ b/ui/js/src/kimchi.storagepool_add_main.js
@@ -20,6 +20,7 @@ kimchi.storagepool_add_main = function() {
kimchi.initStorageAddPage();
$('#form-pool-add').on('submit', kimchi.addPool);
$('#pool-doAdd').on('click', kimchi.addPool);
+ $('#poolId').focus();
};
kimchi.initStorageAddPage = function() {
diff --git a/ui/js/src/kimchi.template_edit_main.js b/ui/js/src/kimchi.template_edit_main.js
index f0f4718..a0e9e28 100644
--- a/ui/js/src/kimchi.template_edit_main.js
+++ b/ui/js/src/kimchi.template_edit_main.js
@@ -177,4 +177,6 @@ kimchi.template_edit_main = function() {
kimchi.message.error(err.responseJSON.reason);
});
});
+
+ $('#template-edit-id-textbox').focus();
};
diff --git a/ui/pages/guest-add.html.tmpl b/ui/pages/guest-add.html.tmpl
index 84a1994..e478b2e 100644
--- a/ui/pages/guest-add.html.tmpl
+++ b/ui/pages/guest-add.html.tmpl
@@ -37,7 +37,7 @@
<p class="text-help">
$_("The name used to identify the virtual machine. If omitted, a name will be chosen based on the template used.")
</p>
- <input type="text" class="text" style="width: 300px" name="name">
+ <input type="text" class="text" style="width: 300px" name="name" id="guest-add-id-textbox">
</div>
</section>
<section class="form-section">
diff --git a/ui/pages/repository-add.html.tmpl b/ui/pages/repository-add.html.tmpl
index 05b4de9..9a8a037 100644
--- a/ui/pages/repository-add.html.tmpl
+++ b/ui/pages/repository-add.html.tmpl
@@ -39,7 +39,7 @@
$_("Single word, unique identifier for the repository.")
</p>
<div class="textbox-wrapper">
- <input type="text" class="text" name="repo_id" />
+ <input type="text" class="text" name="repo_id" id="repo_id" />
</div>
</div>
</div>
--
1.9.0
10 years, 6 months
[PATCHv2] 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>
v1>v2, Improve feedback msg according to Hongliang's comments.
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..b033b36 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">
+ $_("Trying to mount NFS export path. It may take several seconds.")
+ <img src = "../images/theme-default/loading.gif" />
+ </p>
+ </div>
</div>
</section>
</div>
--
1.8.3.2
10 years, 6 months
[PATCH V4] Issue#305: Redesign bridged network UI section
by Wen Wang
Finished align vlan fields. Redesigned the pattern of the label positions
V3 -> V4:
Address to Hongliang Wang: Assigned "for" attribute for label to associate it with text box accordingly
V2 -> V3:
Address to Hongliang Wang: Have the additional margin place removed.
v1 -> v2:
Address to Hongliang Wang: Have the unrelated lines removed & Have the display format changed from table to div.
Address to Yuxin Huo: Have the unused IDs removed.
Signed-off-by: Wen Wang <wenwang(a)linux.vnet.ibm.com>
---
ui/css/theme-default/network.css | 21 ++++++++++++++++-----
ui/js/src/kimchi.network.js | 8 ++++----
ui/pages/tabs/network.html.tmpl | 34 +++++++++++++++++++++-------------
3 files changed, 41 insertions(+), 22 deletions(-)
diff --git a/ui/css/theme-default/network.css b/ui/css/theme-default/network.css
index 67f2aa2..176b277 100644
--- a/ui/css/theme-default/network.css
+++ b/ui/css/theme-default/network.css
@@ -209,19 +209,30 @@
vertical-align: top;
}
-.network-config .destination {
- margin-left: 28px;
+.bridge-option-column {
+ display: inline-block;
+ margin-left: 56px;
+ vertical-align: middle;
+}
+
+.bridge-option-column > div {
+ height: 25px;
+ line-height: 25px;
}
-.network-config .VLAN {
- margin-left: 28px;
+.bridge-option-column select {
+ height: 26px;
}
-.network-config .VLAN input[type="text"] {
+.bridge-option-column input[type="text"] {
height: 25px;
width: 60px;
}
+#labelNetworkVlanID {
+ margin-left: 26px;
+}
+
.network-config .input-hint-icon {
margin: -1px 1px 0 0;
display: inline-block;
diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js
index 7a331be..ca6d29b 100644
--- a/ui/js/src/kimchi.network.js
+++ b/ui/js/src/kimchi.network.js
@@ -275,13 +275,14 @@ kimchi.enableBridgeOptions = function(enable) {
$("#networkVlanID").prop("disabled", true);
$("#networkVlanID").val("");
$("#networkInterface").val("");
- $("#bridge-options").slideUp(100);
+ $("#bridgeOptions").slideUp(100);
} else if (!$("#networkInterface").val()){
$("#networkInterface").prop("selectedIndex", 0);
- $("#bridge-options").slideDown(100);
+ $("#bridgeOptions").slideDown(100);
}
};
+
kimchi.setDefaultNetworkType = function(isInterfaceAvail) {
$("#networkTypeBri").prop("checked", isInterfaceAvail);
$("#networkTypeBri").prop("disabled", !isInterfaceAvail);
@@ -289,7 +290,7 @@ kimchi.setDefaultNetworkType = function(isInterfaceAvail) {
if (!isInterfaceAvail) {
kimchi.enableBridgeOptions(false);
} else {
- $("#bridge-options").slideDown(100);
+ $("#bridgeOptions").slideDown(100);
}
};
@@ -318,7 +319,6 @@ kimchi.cleanNetworkDialog = function() {
$("#networkVlanID").prop("disabled", true);
$("#enableVlan").prop("checked", false);
};
-
kimchi.setupNetworkFormEvent = function() {
$("#networkName").on("keyup", function(event) {
$("#networkName").toggleClass("invalid-field", !$("#networkName").val().match(/^[a-zA-Z0-9_]+$/));
diff --git a/ui/pages/tabs/network.html.tmpl b/ui/pages/tabs/network.html.tmpl
index e49b257..aedf7e8 100644
--- a/ui/pages/tabs/network.html.tmpl
+++ b/ui/pages/tabs/network.html.tmpl
@@ -46,7 +46,7 @@
<div class="section-container">
<div class="section-header">1. $_("Network Name")</div>
<div class="section-content">
- <input type="text" id="networkName">
+ <input type="text" id="networkName" />
<div class="input-hint">
<span class="ui-icon ui-icon-info input-hint-icon"></span>
<span class="input-hint-text">$_("Alphanumeric and '_' characters only.")</span>
@@ -57,27 +57,35 @@
<div class="section-header">2. $_("Network Type")</div>
<div class="section-content">
<div class="input-container">
- <input type="radio" id="networkTypeIso" name="networkType" value="isolated">
+ <input type="radio" id="networkTypeIso" name="networkType" value="isolated" />
<label for="networkTypeIso">$_("Isolated: no physical network connection")</label>
</div>
<div class="input-container">
- <input type="radio" id="networkTypeNat" name="networkType" value="nat">
+ <input type="radio" id="networkTypeNat" name="networkType" value="nat" />
<label for="networkTypeNat">$_("NAT: outbound physical network connection only")</label>
</div>
<div class="input-container">
- <input type="radio" id="networkTypeBri" name="networkType" value="bridged">
+ <input type="radio" id="networkTypeBri" name="networkType" value="bridged" />
<label for="networkTypeBri">$_("Bridged: Virtual machines are connected to physical network directly")</label>
</div>
- <div id="bridge-options">
- <div class="destination">
- <label for="networkInterface">$_("Destination"): </label>
- <select id="networkInterface"></select>
+ <div id="bridgeOptions">
+ <div class="bridge-option-column">
+ <div>
+ <label for="networkInterface">$_("Destination"): </label>
+ </div>
+ <div>
+ <select id="networkInterface"></select>
+ </div>
</div>
- <div class="VLAN">
- <label for="enableVlan">$_("Enable VLAN"): </label>
- <input id="enableVlan" type="checkbox" value=""/>
- <label for="networkVlanID">$_("VLAN ID"): </label>
- <input type="text" id="networkVlanID" disabled>
+ <div class="bridge-option-column">
+ <div>
+ <input id="enableVlan" type="checkbox" value="" />
+ <label for="enableVlan">$_("Enable VLAN"): </label>
+ </div>
+ <div>
+ <label for="networkVlanID" id="labelNetworkVlanID">$_("VLAN ID"): </label>
+ <input type="text" id="networkVlanID" disabled />
+ </div>
</div>
</div>
</div>
--
1.9.1
10 years, 6 months
[PATCH 1/2] List iSCSI server for initiator while creating iSCSI Pool
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
The server should be already used in an existed iSCSI Pool.
Test this patch by:
$ curl -k -u shhfeng:123456 -H "Content-Type: application/json" \
> -H "Accept: application/json" \
> http://localhost:8000/storageservers?_target_type=iscsi
[
{
"host":"127.0.0.1"
}
]
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
src/kimchi/API.json | 2 +-
src/kimchi/model/storagepools.py | 4 +++-
src/kimchi/model/storageservers.py | 3 +--
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/src/kimchi/API.json b/src/kimchi/API.json
index 76c94ab..05a5866 100644
--- a/src/kimchi/API.json
+++ b/src/kimchi/API.json
@@ -416,7 +416,7 @@
"_target_type": {
"description": "List storage servers of given type",
"type": "string",
- "pattern": "^netfs$"
+ "pattern": "^netfs|iscsi$"
}
},
"additionalProperties": false,
diff --git a/src/kimchi/model/storagepools.py b/src/kimchi/model/storagepools.py
index c0f2c58..c699fc6 100644
--- a/src/kimchi/model/storagepools.py
+++ b/src/kimchi/model/storagepools.py
@@ -37,9 +37,11 @@ POOL_STATE_MAP = {0: 'inactive',
4: 'inaccessible'}
# Types of pools supported
-# FIXME: Addd 'iscsi'
STORAGE_SOURCES = {'netfs': {'addr': '/pool/source/host/@name',
'path': '/pool/source/dir/@path'},
+ 'iscsi': {'addr': '/pool/source/host/@name',
+ 'port': '/pool/source/host/@port',
+ 'path': '/pool/source/device/@path'},
'scsi': {'adapter_type': '/pool/source/adapter/@type',
'adapter_name': '/pool/source/adapter/@name',
'wwnn': '/pool/source/adapter/@wwnn',
diff --git a/src/kimchi/model/storageservers.py b/src/kimchi/model/storageservers.py
index c9dfb25..6259b92 100644
--- a/src/kimchi/model/storageservers.py
+++ b/src/kimchi/model/storageservers.py
@@ -21,8 +21,7 @@ from kimchi.exception import NotFoundError
from kimchi.model.storagepools import StoragePoolModel, StoragePoolsModel
# Types of remote storage servers supported
-# FIXME: Add iscsi?
-STORAGE_SERVERS = ['netfs']
+STORAGE_SERVERS = ['netfs', 'iscsi']
class StorageServersModel(object):
--
1.9.3
10 years, 6 months
[PATCH V3 0/7] Issue #342: load i18n.html of the plugin
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
V2 -> V3:
change "enable-plugins" to "enable-sample"
remove nls
improve the Portuguese translation.
V1 -> V2:
The improvement concept here is to directly generate JSON on the server
and assign it to the i18n variable, rather than inserting nodes into the DOM.
Plugins would use a plugin1.i18n= structure to keep plugin strings from
colliding with each other, or with the kimchi variables.
ShaoHe Feng (6):
Update root.py to make Cheetah render the JSON template.
Update the i18n tmpl to produce JSON
Add JS API for fetching i18n JSON
Issue #342: load i18n.html of the plugin
add an optional to toggle the sample plugin
generate the translation files for plugins/sample
Zhou Zheng Sheng (1):
Add Minimal UI Page for the Sample Plugin
configure.ac | 11 +++
plugins/sample/Makefile.am | 26 ++++-
plugins/sample/__init__.py | 3 +-
plugins/sample/config.status | 1 +
plugins/sample/po/LINGUAS | 1 +
plugins/sample/po/Makefile.in.in | 1 +
plugins/sample/po/Makevars | 1 +
plugins/sample/po/POTFILES.in | 2 +
plugins/sample/po/en_US.po | 21 ++++
plugins/sample/po/gen-pot | 1 +
plugins/sample/po/pt_BR.po | 24 +++++
plugins/sample/po/zh_CN.po | 24 +++++
plugins/sample/sample.conf | 7 --
plugins/sample/sample.conf.in | 12 +++
plugins/sample/ui/config/tab-ext.xml | 8 +-
plugins/sample/ui/pages/i18n.json.tmpl | 9 ++
plugins/sample/ui/pages/tab.html.tmpl | 6 ++
src/kimchi/root.py | 5 +
src/kimchi/template.py | 34 ++++---
ui/js/src/kimchi.api.js | 18 +++-
ui/js/src/kimchi.main.js | 24 ++++-
ui/pages/i18n.html.tmpl | 176 ---------------------------------
ui/pages/i18n.json.tmpl | 163 ++++++++++++++++++++++++++++++
23 files changed, 367 insertions(+), 211 deletions(-)
create mode 120000 plugins/sample/config.status
create mode 120000 plugins/sample/po/LINGUAS
create mode 120000 plugins/sample/po/Makefile.in.in
create mode 120000 plugins/sample/po/Makevars
create mode 100644 plugins/sample/po/POTFILES.in
create mode 100644 plugins/sample/po/en_US.po
create mode 120000 plugins/sample/po/gen-pot
create mode 100644 plugins/sample/po/pt_BR.po
create mode 100644 plugins/sample/po/zh_CN.po
delete mode 100644 plugins/sample/sample.conf
create mode 100644 plugins/sample/sample.conf.in
create mode 100644 plugins/sample/ui/pages/i18n.json.tmpl
create mode 100644 plugins/sample/ui/pages/tab.html.tmpl
delete mode 100644 ui/pages/i18n.html.tmpl
create mode 100644 ui/pages/i18n.json.tmpl
--
1.9.0
10 years, 6 months
[PATCH] Adjust Guest Edit Storage Tab Styles
by Hongliang Wang
Keep consistent with interface setup tab.
Signed-off-by: Hongliang Wang <hlwang(a)linux.vnet.ibm.com>
---
ui/css/theme-default/guest-edit.css | 92 ++++++++++---------------------------
ui/js/src/kimchi.guest_edit_main.js | 23 ++++++++--
ui/pages/guest-edit.html.tmpl | 39 ++++++++--------
3 files changed, 63 insertions(+), 91 deletions(-)
diff --git a/ui/css/theme-default/guest-edit.css b/ui/css/theme-default/guest-edit.css
index 36f7f75..52c53eb 100644
--- a/ui/css/theme-default/guest-edit.css
+++ b/ui/css/theme-default/guest-edit.css
@@ -89,74 +89,7 @@
width: 400px;
}
-.guest-edit-cdrom-button {
- background: url("../images/theme-default/guest-icon-sprite.png") no-repeat left top transparent;
- border: none;
- height: 25px;
- vertical-align: middle;
- width: 25px;
-}
-
-.guest-edit-cdrom-button.attach {
- margin: 15px 0 0 521px;
-}
-
-.guest-edit-cdrom-button.attach:hover {
- background-position: 0 -27px;
-}
-
-.guest-edit-cdrom-button.attach:focus {
- background-position: 0 -54px;
-}
-
-.guest-edit-cdrom-button.attach:active {
- background-position: 0 -81px;
-}
-
-.guest-edit-cdrom-button.attach[disabled] {
- background-position: 0 -108px;
-}
-
-.guest-edit-cdrom-button.replace {
- background-position: -27px 0;
-}
-
-.guest-edit-cdrom-button.replace:hover {
- background-position: -27px -27px;
-}
-
-.guest-edit-cdrom-button.replace:focus {
- background-position: -27px -54px;
-}
-
-.guest-edit-cdrom-button.replace:active {
- background-position: -27px -81px;
-}
-
-.guest-edit-cdrom-button.replace[disabled] {
- background-position: -27px -108px;
-}
-
-.guest-edit-cdrom-button.detach {
- background-position: -54px 0;
-}
-
-.guest-edit-cdrom-button.detach:hover {
- background-position: -54px -27px;
-}
-
-.guest-edit-cdrom-button.detach:focus {
- background-position: -54px -54px;
-}
-
-.guest-edit-cdrom-button.detach:active {
- background-position: -54px -81px;
-}
-
-.guest-edit-cdrom-button.detach[disabled] {
- background-position: -54px -108px;
-}
-
+#form-guest-edit-storage .header,
.guest-edit-interface .header {
margin-bottom: 8px;
padding-bottom: 2px;
@@ -165,33 +98,56 @@
overflow: hidden;
}
+#form-guest-edit-storage .body .item,
.guest-edit-interface .body .item {
margin: 5px 0;
}
+#form-guest-edit-storage .cell,
.guest-edit-interface .cell {
display: inline-block;
width: 250px;
}
+#form-guest-edit-storage .cell.dev {
+ width: 60px;
+}
+
+#form-guest-edit-storage .cell.path {
+ width: 440px;
+}
+
+#form-guest-edit-storage .cell.path input {
+ box-sizing: border-box;
+ width: 100%;
+}
+
.guest-edit-interface .body select {
width: 180px;
padding: 0px;
}
+#form-guest-edit-storage .action-area,
.guest-edit-interface .action-area {
float: right;
}
+#form-guest-edit-storage .action-area {
+ line-height: 24px;
+}
+
+#form-guest-edit-storage button,
.guest-edit-interface button {
width: 20px;
height: 20px;
}
+#form-guest-edit-storage .header button,
.guest-edit-interface .header button {
margin-bottom: 1px;
}
+#form-guest-edit-storage .body button:not(:last-child),
.guest-edit-interface .body button:not(:last-child) {
margin-right: 2px;
}
diff --git a/ui/js/src/kimchi.guest_edit_main.js b/ui/js/src/kimchi.guest_edit_main.js
index 0236e2d..ba5fef5 100644
--- a/ui/js/src/kimchi.guest_edit_main.js
+++ b/ui/js/src/kimchi.guest_edit_main.js
@@ -36,7 +36,7 @@ kimchi.guest_edit_main = function() {
kimchi.listVMStorages({
vm: kimchi.selectedGuest
}, function(storages) {
- var container = $('#guest-edit-cdrom-row-container');
+ var container = $('#form-guest-edit-storage .body');
$(container).empty();
$.each(storages, function(index, storage) {
@@ -53,9 +53,19 @@ kimchi.guest_edit_main = function() {
};
$('input[type="text"][name="cdrom"]', container).on('click', replaceCDROM);
- $('.replace', container).on('click', replaceCDROM);
+ $('.replace', container).button({
+ icons: {
+ primary: 'ui-icon-pencil'
+ },
+ text: false
+ }).click(replaceCDROM);
- $('.detach', container).on('click', function(e) {
+ $('.detach', container).button({
+ icons: {
+ primary: 'ui-icon-trash'
+ },
+ text: false
+ }).click(function(e) {
e.preventDefault();
var settings = {
title : i18n['KCHAPI6004M'],
@@ -172,7 +182,12 @@ kimchi.guest_edit_main = function() {
refreshCDROMs();
- $('#guest-edit-attach-cdrom-button').on('click', function(event) {
+ $('#guest-edit-attach-cdrom-button').button({
+ icons: {
+ primary: "ui-icon-plusthick"
+ },
+ text: false
+ }).click(function(event) {
event.preventDefault();
kimchi.window.open("guest-storage-add.html");
});
diff --git a/ui/pages/guest-edit.html.tmpl b/ui/pages/guest-edit.html.tmpl
index 96d907e..3b7291a 100644
--- a/ui/pages/guest-edit.html.tmpl
+++ b/ui/pages/guest-edit.html.tmpl
@@ -94,15 +94,12 @@
</fieldset>
</form>
<form id="form-guest-edit-storage">
- <fieldset class="guest-edit-fieldset">
- <div id="guest-edit-cdrom-row-container" class="guest-edit-cdrom-row-container"></div>
- <div>
- <button id="guest-edit-attach-cdrom-button"
- class="guest-edit-cdrom-button attach"
- title='$_("Attach")'>
- </button>
- </div>
- </fieldset>
+ <div class="header">
+ <span class="cell">$_("Device")</span>
+ <span class="cell">$_("Path")</span>
+ <button id="guest-edit-attach-cdrom-button" class="action-area attach"></button>
+ </div>
+ <div class="body"></div>
</form>
<form id="form-guest-edit-interface" class="guest-edit-interface">
<div class="header">
@@ -123,14 +120,16 @@
</footer>
</div>
<script id="cdrom-row-tmpl" type="text/html">
- <div>
- <div class="guest-edit-wrapper-label">
+ <div class="item" id="cdrom-{dev}">
+ <span class="cell dev">
<label for="cdrom-{dev}">{dev}</label>
- </div>
- <div class="guest-edit-wrapper-controls">
+ </span>
+ <span class="cell path">
<input id="cdrom-{dev}" name="cdrom" type="text"
data-vm="{vm}" data-dev="{dev}"
value="{path}" readonly="readonly" />
+ </span>
+ <span class="action-area">
<button class="guest-edit-cdrom-button replace"
data-vm="{vm}" data-dev="{dev}"
title='$_("Replace")'>
@@ -139,7 +138,7 @@
data-vm="{vm}" data-dev="{dev}"
title='$_("Detach")'>
</button>
- </div>
+ </span>
</div>
</script>
<script id="interface-tmpl" type="text/html">
@@ -160,19 +159,21 @@
<div>
</script>
<script id="disk-row-tmpl" type="text/html">
- <div>
- <div class="guest-edit-wrapper-label">
+ <div class="item" id="cdrom-{dev}">
+ <span class="cell dev">
<label for="disk-{dev}">{dev}</label>
- </div>
- <div class="guest-edit-wrapper-controls">
+ </span>
+ <span class="cell path">
<input id="disk-{dev}" name="disk" type="text"
data-vm="{vm}" data-dev="{dev}"
value="{path}" readonly="readonly" />
+ </span>
+ <span class="action-area">
<button class="guest-edit-cdrom-button detach"
data-vm="{vm}" data-dev="{dev}"
title="$_("Detach")">
</button>
- </div>
+ </span>
</div>
</script>
<script type="text/javascript">
--
1.8.1.4
10 years, 6 months
[PATCH v2 0/8] Debug Report Rename Feature
by Hongliang Wang
Enable debug report rename feature in this patch set.
v1 -> v2:
2a) Retrieved the Right Generated Time for Debug Report
(Wen Wang's comment)
2b) Sorted debug reports by Generated Time Descendingly
(Wen Wang's comment)
2c) Enabled Form Fields after Request Processed
(Yuxin's comment)
Hongliang Wang (8):
Debug Report Rename: Update API.json
Debug Report Rename: Update API.md
Debug Report Rename: Implement Back-end
Debug Report: Use Generated Time instead of Most Changed Time
Debug Report: Sort Reports by Generated Time Descendingly
Debug Report Rename UI: Add API in kimchi.api.js
Debug Report Rename UI: Add Rename Page
Debug Report Rename UI: Enable Rename in Host Tab
docs/API.md | 3 ++
src/kimchi/API.json | 11 +++++++
src/kimchi/control/debugreports.py | 8 ++++-
src/kimchi/model/debugreports.py | 15 +++++++++-
ui/css/theme-default/report-rename.css | 22 ++++++++++++++
ui/js/src/kimchi.api.js | 12 ++++++++
ui/js/src/kimchi.host.js | 12 ++++++++
ui/js/src/kimchi.report_rename_main.js | 41 ++++++++++++++++++++++++++
ui/pages/report-rename.html.tmpl | 53 ++++++++++++++++++++++++++++++++++
9 files changed, 175 insertions(+), 2 deletions(-)
create mode 100644 ui/css/theme-default/report-rename.css
create mode 100644 ui/js/src/kimchi.report_rename_main.js
create mode 100644 ui/pages/report-rename.html.tmpl
--
1.8.1.4
10 years, 6 months
[PATCH v2] 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..e837599 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, 6 months
[PATCH] bug fix: decode volume name in IsoVolumesModel.
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
commit c53b3eab just fix volume name in StorageVolumeModel.
reproduce this bug:
1. create a iso pool
2. put a iso with name αβγ.iso in it
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
src/kimchi/model/storagevolumes.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/kimchi/model/storagevolumes.py b/src/kimchi/model/storagevolumes.py
index d58fd0b..fd7e24d 100644
--- a/src/kimchi/model/storagevolumes.py
+++ b/src/kimchi/model/storagevolumes.py
@@ -239,7 +239,7 @@ class IsoVolumesModel(object):
continue
for volume in volumes:
- res = self.storagevolume.lookup(pool_name, volume)
+ res = self.storagevolume.lookup(pool_name, volume.decode("utf-8"))
if res['format'] == 'iso':
res['name'] = '%s' % volume
iso_volumes.append(res)
--
1.9.3
10 years, 6 months