[PATCH] [Wok] Fix for filter break for numbers formatted for locale fr-FR
by pkulkark@linux.vnet.ibm.com
From: Pooja Kulkarni <pkulkark(a)linux.vnet.ibm.com>
This patch fixes the filter breaking
issue on numbers formatted as per
fr-FR locale, by replacing the
non-breaking spaces introduced by
the formatting, with breaking spaces.
Signed-off-by: Pooja Kulkarni <pkulkark(a)linux.vnet.ibm.com>
---
ui/js/src/wok.utils.js | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/ui/js/src/wok.utils.js b/ui/js/src/wok.utils.js
index 1fb3c9b..76477fd 100644
--- a/ui/js/src/wok.utils.js
+++ b/ui/js/src/wok.utils.js
@@ -263,7 +263,11 @@ wok.localeConverters = {
},
"number-locale-converter":{
to: function(number){
- return wok.numberLocaleConverter(number, wok.lang.get_locale());
+ if (number == null) {
+ return 'Unknown';
+ }
+ format_value = wok.numberLocaleConverter(number, wok.lang.get_locale());
+ return format_value.toString().replace(/\s/g,' '); //replace non-breaking space with breaking space
}
}
}
--
2.1.0
8 years, 6 months
[PATCH] [Wok] Externlise the size units such as Ki, Mi, Gi, etc.
by pkulkark@linux.vnet.ibm.com
From: Pooja Kulkarni <pkulkark(a)linux.vnet.ibm.com>
This patch externalises the size
units such as KiB, MiB, GiB, etc
that are added in wok.formatMeasurement
method, and also updates the .pot
and *.po files.
Signed-off-by: Pooja Kulkarni <pkulkark(a)linux.vnet.ibm.com>
---
po/de_DE.po | 32 +++++++++++++++++++++++++++++++-
po/en_US.po | 32 +++++++++++++++++++++++++++++++-
po/es_ES.po | 32 +++++++++++++++++++++++++++++++-
po/fr_FR.po | 32 +++++++++++++++++++++++++++++++-
po/it_IT.po | 32 +++++++++++++++++++++++++++++++-
po/ja_JP.po | 32 +++++++++++++++++++++++++++++++-
po/ko_KR.po | 32 +++++++++++++++++++++++++++++++-
po/pt_BR.po | 32 +++++++++++++++++++++++++++++++-
po/ru_RU.po | 32 +++++++++++++++++++++++++++++++-
po/wok.pot | 32 +++++++++++++++++++++++++++++++-
po/zh_CN.po | 32 +++++++++++++++++++++++++++++++-
po/zh_TW.po | 32 +++++++++++++++++++++++++++++++-
ui/js/src/wok.utils.js | 7 ++++++-
ui/pages/i18n.json.tmpl | 13 ++++++++++++-
14 files changed, 390 insertions(+), 14 deletions(-)
diff --git a/po/de_DE.po b/po/de_DE.po
index 0fb869d..c2b9a0a 100644
--- a/po/de_DE.po
+++ b/po/de_DE.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-05-19 21:30+0530\n"
+"POT-Creation-Date: 2016-05-25 15:08+0530\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -201,6 +201,36 @@ msgstr ""
msgid "Actions"
msgstr ""
+msgid "Ki"
+msgstr ""
+
+msgid "Mi"
+msgstr ""
+
+msgid "Gi"
+msgstr ""
+
+msgid "Ti"
+msgstr ""
+
+msgid "Pi"
+msgstr ""
+
+msgid "k"
+msgstr ""
+
+msgid "M"
+msgstr ""
+
+msgid "G"
+msgstr ""
+
+msgid "T"
+msgstr ""
+
+msgid "P"
+msgstr ""
+
msgid "The username or password you entered is incorrect. Please try again."
msgstr ""
"Der Benutzername oder das Kennwort, den bzw. das Sie eingegeben haben, ist "
diff --git a/po/en_US.po b/po/en_US.po
index 73d7056..b31785b 100644
--- a/po/en_US.po
+++ b/po/en_US.po
@@ -6,7 +6,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-05-19 21:30+0530\n"
+"POT-Creation-Date: 2016-05-25 15:08+0530\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -195,6 +195,36 @@ msgstr ""
msgid "Actions"
msgstr ""
+msgid "Ki"
+msgstr ""
+
+msgid "Mi"
+msgstr ""
+
+msgid "Gi"
+msgstr ""
+
+msgid "Ti"
+msgstr ""
+
+msgid "Pi"
+msgstr ""
+
+msgid "k"
+msgstr ""
+
+msgid "M"
+msgstr ""
+
+msgid "G"
+msgstr ""
+
+msgid "T"
+msgstr ""
+
+msgid "P"
+msgstr ""
+
msgid "The username or password you entered is incorrect. Please try again."
msgstr ""
diff --git a/po/es_ES.po b/po/es_ES.po
index 8acb513..d77c60e 100644
--- a/po/es_ES.po
+++ b/po/es_ES.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-05-19 21:30+0530\n"
+"POT-Creation-Date: 2016-05-25 15:08+0530\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -201,6 +201,36 @@ msgstr ""
msgid "Actions"
msgstr ""
+msgid "Ki"
+msgstr ""
+
+msgid "Mi"
+msgstr ""
+
+msgid "Gi"
+msgstr ""
+
+msgid "Ti"
+msgstr ""
+
+msgid "Pi"
+msgstr ""
+
+msgid "k"
+msgstr ""
+
+msgid "M"
+msgstr ""
+
+msgid "G"
+msgstr ""
+
+msgid "T"
+msgstr ""
+
+msgid "P"
+msgstr ""
+
msgid "The username or password you entered is incorrect. Please try again."
msgstr ""
"El nombre de usuario o contraseña que ha especificado es incorrecto. Por "
diff --git a/po/fr_FR.po b/po/fr_FR.po
index 9cc473a..065113b 100644
--- a/po/fr_FR.po
+++ b/po/fr_FR.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-05-19 21:30+0530\n"
+"POT-Creation-Date: 2016-05-25 15:08+0530\n"
"PO-Revision-Date: 2014-08-27 21:30+0000\n"
"Last-Translator: BobSynfig\n"
"Language-Team: French (http://www.transifex.com/projects/p/kimchi/language/"
@@ -204,6 +204,36 @@ msgstr ""
msgid "Actions"
msgstr ""
+msgid "Ki"
+msgstr ""
+
+msgid "Mi"
+msgstr ""
+
+msgid "Gi"
+msgstr ""
+
+msgid "Ti"
+msgstr ""
+
+msgid "Pi"
+msgstr ""
+
+msgid "k"
+msgstr ""
+
+msgid "M"
+msgstr ""
+
+msgid "G"
+msgstr ""
+
+msgid "T"
+msgstr ""
+
+msgid "P"
+msgstr ""
+
msgid "The username or password you entered is incorrect. Please try again."
msgstr ""
"Le nom d'utilisateur ou le mot de passe que vous avez entré est incorrect. "
diff --git a/po/it_IT.po b/po/it_IT.po
index ef3729d..d871172 100644
--- a/po/it_IT.po
+++ b/po/it_IT.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-05-19 21:30+0530\n"
+"POT-Creation-Date: 2016-05-25 15:08+0530\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -201,6 +201,36 @@ msgstr ""
msgid "Actions"
msgstr ""
+msgid "Ki"
+msgstr ""
+
+msgid "Mi"
+msgstr ""
+
+msgid "Gi"
+msgstr ""
+
+msgid "Ti"
+msgstr ""
+
+msgid "Pi"
+msgstr ""
+
+msgid "k"
+msgstr ""
+
+msgid "M"
+msgstr ""
+
+msgid "G"
+msgstr ""
+
+msgid "T"
+msgstr ""
+
+msgid "P"
+msgstr ""
+
msgid "The username or password you entered is incorrect. Please try again."
msgstr ""
"Il nome utente o la password immessi non sono corretti. Ripetere "
diff --git a/po/ja_JP.po b/po/ja_JP.po
index dc8926f..cde5d87 100644
--- a/po/ja_JP.po
+++ b/po/ja_JP.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-05-19 21:30+0530\n"
+"POT-Creation-Date: 2016-05-25 15:08+0530\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -199,6 +199,36 @@ msgstr ""
msgid "Actions"
msgstr ""
+msgid "Ki"
+msgstr ""
+
+msgid "Mi"
+msgstr ""
+
+msgid "Gi"
+msgstr ""
+
+msgid "Ti"
+msgstr ""
+
+msgid "Pi"
+msgstr ""
+
+msgid "k"
+msgstr ""
+
+msgid "M"
+msgstr ""
+
+msgid "G"
+msgstr ""
+
+msgid "T"
+msgstr ""
+
+msgid "P"
+msgstr ""
+
msgid "The username or password you entered is incorrect. Please try again."
msgstr "入力したユーザー名またはパスワードが誤っています。やり直してください。"
diff --git a/po/ko_KR.po b/po/ko_KR.po
index 84b4750..2ef50fb 100644
--- a/po/ko_KR.po
+++ b/po/ko_KR.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-05-19 21:30+0530\n"
+"POT-Creation-Date: 2016-05-25 15:08+0530\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -196,6 +196,36 @@ msgstr ""
msgid "Actions"
msgstr ""
+msgid "Ki"
+msgstr ""
+
+msgid "Mi"
+msgstr ""
+
+msgid "Gi"
+msgstr ""
+
+msgid "Ti"
+msgstr ""
+
+msgid "Pi"
+msgstr ""
+
+msgid "k"
+msgstr ""
+
+msgid "M"
+msgstr ""
+
+msgid "G"
+msgstr ""
+
+msgid "T"
+msgstr ""
+
+msgid "P"
+msgstr ""
+
msgid "The username or password you entered is incorrect. Please try again."
msgstr ""
"입력한 사용자 이름 또는 비밀번호가 올바르지 않습니다. 다시 시도하십시오."
diff --git a/po/pt_BR.po b/po/pt_BR.po
index a4ae451..75a6c9b 100644
--- a/po/pt_BR.po
+++ b/po/pt_BR.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 1.0\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-05-19 21:30+0530\n"
+"POT-Creation-Date: 2016-05-25 15:08+0530\n"
"PO-Revision-Date: 2015-03-23 12:57+0000\n"
"Last-Translator: Crístian Deives dos Santos Viana <cristiandeives@gmail."
"com>\n"
@@ -217,6 +217,36 @@ msgstr ""
msgid "Actions"
msgstr ""
+msgid "Ki"
+msgstr ""
+
+msgid "Mi"
+msgstr ""
+
+msgid "Gi"
+msgstr ""
+
+msgid "Ti"
+msgstr ""
+
+msgid "Pi"
+msgstr ""
+
+msgid "k"
+msgstr ""
+
+msgid "M"
+msgstr ""
+
+msgid "G"
+msgstr ""
+
+msgid "T"
+msgstr ""
+
+msgid "P"
+msgstr ""
+
msgid "The username or password you entered is incorrect. Please try again."
msgstr ""
"O usuário ou senha inseridos estão incorretos. Por favor, tente novamente."
diff --git a/po/ru_RU.po b/po/ru_RU.po
index 0e81ba4..392be6d 100644
--- a/po/ru_RU.po
+++ b/po/ru_RU.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-05-19 21:30+0530\n"
+"POT-Creation-Date: 2016-05-25 15:08+0530\n"
"PO-Revision-Date: 2014-08-28 17:32+0000\n"
"Last-Translator: Aline Manera <aline.manera(a)gmail.com>\n"
"Language-Team: Russian (http://www.transifex.com/projects/p/kimchi/language/"
@@ -197,6 +197,36 @@ msgstr ""
msgid "Actions"
msgstr ""
+msgid "Ki"
+msgstr ""
+
+msgid "Mi"
+msgstr ""
+
+msgid "Gi"
+msgstr ""
+
+msgid "Ti"
+msgstr ""
+
+msgid "Pi"
+msgstr ""
+
+msgid "k"
+msgstr ""
+
+msgid "M"
+msgstr ""
+
+msgid "G"
+msgstr ""
+
+msgid "T"
+msgstr ""
+
+msgid "P"
+msgstr ""
+
msgid "The username or password you entered is incorrect. Please try again."
msgstr "Указано неверное имя пользователя или пароль. Введите еще раз."
diff --git a/po/wok.pot b/po/wok.pot
index 01b8a28..231cd33 100755
--- a/po/wok.pot
+++ b/po/wok.pot
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-05-19 21:30+0530\n"
+"POT-Creation-Date: 2016-05-25 15:08+0530\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL(a)li.org>\n"
@@ -195,6 +195,36 @@ msgstr ""
msgid "Actions"
msgstr ""
+msgid "Ki"
+msgstr ""
+
+msgid "Mi"
+msgstr ""
+
+msgid "Gi"
+msgstr ""
+
+msgid "Ti"
+msgstr ""
+
+msgid "Pi"
+msgstr ""
+
+msgid "k"
+msgstr ""
+
+msgid "M"
+msgstr ""
+
+msgid "G"
+msgstr ""
+
+msgid "T"
+msgstr ""
+
+msgid "P"
+msgstr ""
+
msgid "The username or password you entered is incorrect. Please try again."
msgstr ""
diff --git a/po/zh_CN.po b/po/zh_CN.po
index 0a66eec..5d81cc5 100644
--- a/po/zh_CN.po
+++ b/po/zh_CN.po
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-05-19 21:30+0530\n"
+"POT-Creation-Date: 2016-05-25 15:08+0530\n"
"PO-Revision-Date: 2013-06-27 10:48+0000\n"
"Last-Translator: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>\n"
"Language-Team: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>\n"
@@ -212,6 +212,36 @@ msgstr ""
msgid "Actions"
msgstr ""
+msgid "Ki"
+msgstr ""
+
+msgid "Mi"
+msgstr ""
+
+msgid "Gi"
+msgstr ""
+
+msgid "Ti"
+msgstr ""
+
+msgid "Pi"
+msgstr ""
+
+msgid "k"
+msgstr ""
+
+msgid "M"
+msgstr ""
+
+msgid "G"
+msgstr ""
+
+msgid "T"
+msgstr ""
+
+msgid "P"
+msgstr ""
+
msgid "The username or password you entered is incorrect. Please try again."
msgstr "用户名或密码错误,请重新输入。"
diff --git a/po/zh_TW.po b/po/zh_TW.po
index fd83384..ccd1d48 100644
--- a/po/zh_TW.po
+++ b/po/zh_TW.po
@@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: kimchi 0.1\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2016-05-19 21:30+0530\n"
+"POT-Creation-Date: 2016-05-25 15:08+0530\n"
"PO-Revision-Date: 2013-07-11 17:32-0400\n"
"Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
"Language-Team: English\n"
@@ -196,6 +196,36 @@ msgstr ""
msgid "Actions"
msgstr ""
+msgid "Ki"
+msgstr ""
+
+msgid "Mi"
+msgstr ""
+
+msgid "Gi"
+msgstr ""
+
+msgid "Ti"
+msgstr ""
+
+msgid "Pi"
+msgstr ""
+
+msgid "k"
+msgstr ""
+
+msgid "M"
+msgstr ""
+
+msgid "G"
+msgstr ""
+
+msgid "T"
+msgstr ""
+
+msgid "P"
+msgstr ""
+
msgid "The username or password you entered is incorrect. Please try again."
msgstr "您輸入的使用者名稱或密碼不正確。請重試。"
diff --git a/ui/js/src/wok.utils.js b/ui/js/src/wok.utils.js
index 1fb3c9b..8eb6f08 100644
--- a/ui/js/src/wok.utils.js
+++ b/ui/js/src/wok.utils.js
@@ -150,9 +150,14 @@ wok.changetoProperUnit = function(numOrg, digits, base) {
var fixed = settings['fixed'];
var unitMapping = unitBaseMapping[base];
+ var unitmap = { 'Ki': 'WOKFMT2001M', 'Mi': 'WOKFMT2002M', 'Gi': 'WOKFMT2003M',
+ 'Ti': 'WOKFMT2004M', 'Pi': 'WOKFMT2005M', 'k': 'WOKFMT2006M',
+ 'M': 'WOKFMT2007M', 'G': 'WOKFMT2008M', 'T': 'WOKFMT2009M',
+ 'P': 'WOKFMT2010M'}
for(var i = unitMapping.length - 1; i >= 0; i--) {
var mapping = unitMapping[i];
- var suffix = mapping['us'];
+ var s_key = mapping['us'];
+ var suffix = i18n[unitmap[s_key]];
var startingValue = mapping['v'];
if(number < startingValue) {
continue;
diff --git a/ui/pages/i18n.json.tmpl b/ui/pages/i18n.json.tmpl
index ca7ae4c..94e90ac 100644
--- a/ui/pages/i18n.json.tmpl
+++ b/ui/pages/i18n.json.tmpl
@@ -49,5 +49,16 @@
"WOKSETT0009M": "$_("Showing {{ctx.start}} to {{ctx.end}} of {{ctx.total}} entries")",
"WOKSETT0010M": "$_("No results found!")",
"WOKSETT0011M": "$_("Loading...")",
- "WOKSETT0012M": "$_("Actions")"
+ "WOKSETT0012M": "$_("Actions")",
+
+ "WOKFMT2001M": "$_("Ki")",
+ "WOKFMT2002M": "$_("Mi")",
+ "WOKFMT2003M": "$_("Gi")",
+ "WOKFMT2004M": "$_("Ti")",
+ "WOKFMT2005M": "$_("Pi")",
+ "WOKFMT2006M": "$_("k")",
+ "WOKFMT2007M": "$_("M")",
+ "WOKFMT2008M": "$_("G")",
+ "WOKFMT2009M": "$_("T")",
+ "WOKFMT2010M": "$_("P")"
}
--
2.1.0
8 years, 6 months
[PATCHv2] [Kimchi] Properly display network interfaces when more than one exists
by Socorro Stoppler
v2:
Fix for showing all of the interface(s) when creating a network.
v1:
Display all of the interfaces when more than one exists when listing networks.
Tooltip is shown when hovering over the interface to show all of the interfaces.
Signed-off-by: Socorro Stoppler <socorro(a)linux.vnet.ibm.com>
---
ui/css/kimchi.css | 8 ++++++--
ui/css/src/modules/_network.scss | 9 ++++++---
ui/js/src/kimchi.network.js | 4 +++-
ui/js/src/kimchi.network_add_main.js | 2 +-
ui/pages/tabs/network.html.tmpl | 4 ++--
5 files changed, 18 insertions(+), 9 deletions(-)
diff --git a/ui/css/kimchi.css b/ui/css/kimchi.css
index 49ea39a..72f340c 100644
--- a/ui/css/kimchi.css
+++ b/ui/css/kimchi.css
@@ -2156,12 +2156,16 @@ body.wok-gallery {
#network-root-container .wok-datagrid > .wok-datagrid-header > span.column-interface,
#network-root-container .wok-datagrid > .wok-datagrid-body > .wok-datagrid-row > span.column-interface {
- width: 10.3896%;
+ width: 15.3896%;
+ padding-right: 40px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
#network-root-container .wok-datagrid > .wok-datagrid-header > span.column-space,
#network-root-container .wok-datagrid > .wok-datagrid-body > .wok-datagrid-row > span.column-space {
- width: 30%;
+ width: 25%;
}
#network-root-container .wok-datagrid > .wok-datagrid-header > span.column-action,
diff --git a/ui/css/src/modules/_network.scss b/ui/css/src/modules/_network.scss
index 4627ab5..ab47c89 100644
--- a/ui/css/src/modules/_network.scss
+++ b/ui/css/src/modules/_network.scss
@@ -93,18 +93,21 @@
}
> span.column-interface {
- width: 10.3896%;
+ width: 15.3896%;
+ padding-right: 40px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
> span.column-space {
- width: 30%;
+ width: 25%;
}
> span.column-action {
width: 25.909%;
text-align: right;
}
-
}
.wok-datagrid > .wok-datagrid-body > .wok-datagrid-row > span {
diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js
index 381449d..ac6bf74 100644
--- a/ui/js/src/kimchi.network.js
+++ b/ui/js/src/kimchi.network.js
@@ -35,6 +35,7 @@ kimchi.initNetwork = function() {
kimchi.initNetworkListView = function() {
$('.wok-mask').removeClass('hidden');
kimchi.listNetworks(function(data) {
+ $('[data-toggle="tooltip"]').tooltip();
for (var i = 0; i < data.length; i++) {
var network = {
name : data[i].name,
@@ -46,7 +47,8 @@ kimchi.initNetworkListView = function() {
} else {
network.type = data[i].connection;
}
- network.interface = data[i].interfaces ? data[i].interfaces[0] : null;
+ network.interface = data[i].interfaces ? data[i].interfaces : null;
+ network.interface.join();
network.addrSpace = data[i].subnet ? data[i].subnet : null;
network.persistent = data[i].persistent;
kimchi.addNetworkItem(network);
diff --git a/ui/js/src/kimchi.network_add_main.js b/ui/js/src/kimchi.network_add_main.js
index 85df203..fd45f34 100644
--- a/ui/js/src/kimchi.network_add_main.js
+++ b/ui/js/src/kimchi.network_add_main.js
@@ -44,7 +44,7 @@ kimchi.startNetworkCreation = function() {
kimchi.createNetwork(data, function(result) {
network.state = result.state === "active" ? "up" : "down";
- network.interface = result.interfaces ? result.interfaces[0] : i18n["KCHNET6001M"];
+ network.interface = result.interfaces ? result.interfaces : i18n["KCHNET6001M"];
network.addrSpace = result.subnet ? result.subnet : i18n["KCHNET6001M"];
network.persistent = result.persistent;
$('#networkGrid').dataGrid('addRow', kimchi.addNetworkItem(network));
diff --git a/ui/pages/tabs/network.html.tmpl b/ui/pages/tabs/network.html.tmpl
index 6ddabaa..7e2825d 100644
--- a/ui/pages/tabs/network.html.tmpl
+++ b/ui/pages/tabs/network.html.tmpl
@@ -85,11 +85,11 @@
</div>
<div id="modalWindow" class="modal fade network-modal" tabindex="-1" role="dialog" aria-labelledby="networkModalLabel" aria-hidden="true"> </div>
<script id="networkItem" type="text/html">
- <div id='{name}' class='wok-nw-grid-body remove-when-logged-off '>
+ <div id='{name}' class='wok-nw-grid-body remove-when-logged-off'>
<span class='column-state' val="{state}"><span class='network-state {state}'><i class="fa fa-power-off"></i><span class="wok-nw-loading-icon"></span></span></span><!--
--><span class='column-name' title="{name}" val="{name}">{name}</span><!--
--><span class='column-type' val="{type}">{type}</span><!--
- --><span class='column-interface' val="{interface}">{interface}</span><!--
+ --><span class='column-interface' data-placement="top" data-toggle="tooltip" title="{interface}" val="{interface}">{interface}</span><!--
--><span class='column-space' val="{addrSpace}">{addrSpace}</span><!--
--><span class='column-action' style="display:none">
<span class="pull-right">
--
2.5.0
8 years, 6 months
[PATCH] [Kimchi] Properly display network interfaces when more than one exists
by Socorro Stoppler
This patch fixes a bug in the listing of networks in that only one network
interface is being shown regardless of the number of interfaces that exist for
that network.
In addition to now displaying all of the interfaces, in the case
that there's too many to fit in the column, an ellipsis has been added to indicate
that there's more interfaces than what it being shown. A tooltip will be seen when
the user hovers over the interface(s) to show all of the interfaces.
Signed-off-by: Socorro Stoppler <socorro(a)linux.vnet.ibm.com>
---
ui/css/kimchi.css | 8 ++++++--
ui/css/src/modules/_network.scss | 9 ++++++---
ui/js/src/kimchi.network.js | 4 +++-
ui/pages/tabs/network.html.tmpl | 4 ++--
4 files changed, 17 insertions(+), 8 deletions(-)
diff --git a/ui/css/kimchi.css b/ui/css/kimchi.css
index 49ea39a..72f340c 100644
--- a/ui/css/kimchi.css
+++ b/ui/css/kimchi.css
@@ -2156,12 +2156,16 @@ body.wok-gallery {
#network-root-container .wok-datagrid > .wok-datagrid-header > span.column-interface,
#network-root-container .wok-datagrid > .wok-datagrid-body > .wok-datagrid-row > span.column-interface {
- width: 10.3896%;
+ width: 15.3896%;
+ padding-right: 40px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
#network-root-container .wok-datagrid > .wok-datagrid-header > span.column-space,
#network-root-container .wok-datagrid > .wok-datagrid-body > .wok-datagrid-row > span.column-space {
- width: 30%;
+ width: 25%;
}
#network-root-container .wok-datagrid > .wok-datagrid-header > span.column-action,
diff --git a/ui/css/src/modules/_network.scss b/ui/css/src/modules/_network.scss
index 4627ab5..ab47c89 100644
--- a/ui/css/src/modules/_network.scss
+++ b/ui/css/src/modules/_network.scss
@@ -93,18 +93,21 @@
}
> span.column-interface {
- width: 10.3896%;
+ width: 15.3896%;
+ padding-right: 40px;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
> span.column-space {
- width: 30%;
+ width: 25%;
}
> span.column-action {
width: 25.909%;
text-align: right;
}
-
}
.wok-datagrid > .wok-datagrid-body > .wok-datagrid-row > span {
diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js
index 381449d..ac6bf74 100644
--- a/ui/js/src/kimchi.network.js
+++ b/ui/js/src/kimchi.network.js
@@ -35,6 +35,7 @@ kimchi.initNetwork = function() {
kimchi.initNetworkListView = function() {
$('.wok-mask').removeClass('hidden');
kimchi.listNetworks(function(data) {
+ $('[data-toggle="tooltip"]').tooltip();
for (var i = 0; i < data.length; i++) {
var network = {
name : data[i].name,
@@ -46,7 +47,8 @@ kimchi.initNetworkListView = function() {
} else {
network.type = data[i].connection;
}
- network.interface = data[i].interfaces ? data[i].interfaces[0] : null;
+ network.interface = data[i].interfaces ? data[i].interfaces : null;
+ network.interface.join();
network.addrSpace = data[i].subnet ? data[i].subnet : null;
network.persistent = data[i].persistent;
kimchi.addNetworkItem(network);
diff --git a/ui/pages/tabs/network.html.tmpl b/ui/pages/tabs/network.html.tmpl
index 6ddabaa..7e2825d 100644
--- a/ui/pages/tabs/network.html.tmpl
+++ b/ui/pages/tabs/network.html.tmpl
@@ -85,11 +85,11 @@
</div>
<div id="modalWindow" class="modal fade network-modal" tabindex="-1" role="dialog" aria-labelledby="networkModalLabel" aria-hidden="true"> </div>
<script id="networkItem" type="text/html">
- <div id='{name}' class='wok-nw-grid-body remove-when-logged-off '>
+ <div id='{name}' class='wok-nw-grid-body remove-when-logged-off'>
<span class='column-state' val="{state}"><span class='network-state {state}'><i class="fa fa-power-off"></i><span class="wok-nw-loading-icon"></span></span></span><!--
--><span class='column-name' title="{name}" val="{name}">{name}</span><!--
--><span class='column-type' val="{type}">{type}</span><!--
- --><span class='column-interface' val="{interface}">{interface}</span><!--
+ --><span class='column-interface' data-placement="top" data-toggle="tooltip" title="{interface}" val="{interface}">{interface}</span><!--
--><span class='column-space' val="{addrSpace}">{addrSpace}</span><!--
--><span class='column-action' style="display:none">
<span class="pull-right">
--
2.5.0
8 years, 6 months
Re: [Kimchi-devel] [PATCH] [Wok] Externlise the size units such as Ki, Mi, Gi, etc.
by Pooja Kulkarni
Hi Aline,
I do not have a good example for this, but I did come across something
while searching around.
French use Ko (kilo-octet) instead of Kb as a unit of size. So this
leads me to believe there could be other such scenarios while dealing
with different locales.
Thanks,
Pooja
On 05/30/2016 08:52 PM, Aline Manera wrote:
>
> Hi Pooja,
>
> Isn't KiB, MiB, GiB, ect international units for computing ?
> Do you have any example on which language they are 'translated' to a
> different unit name?
>
> Thanks,
> Aline Manera
>
> On 05/25/2016 06:55 AM, pkulkark(a)linux.vnet.ibm.com wrote:
>> From: Pooja Kulkarni <pkulkark(a)linux.vnet.ibm.com>
>>
>> This patch externalises the size
>> units such as KiB, MiB, GiB, etc
>> that are added in wok.formatMeasurement
>> method, and also updates the .pot
>> and *.po files.
>>
>> Signed-off-by: Pooja Kulkarni <pkulkark(a)linux.vnet.ibm.com>
>> ---
>> po/de_DE.po | 32 +++++++++++++++++++++++++++++++-
>> po/en_US.po | 32 +++++++++++++++++++++++++++++++-
>> po/es_ES.po | 32 +++++++++++++++++++++++++++++++-
>> po/fr_FR.po | 32 +++++++++++++++++++++++++++++++-
>> po/it_IT.po | 32 +++++++++++++++++++++++++++++++-
>> po/ja_JP.po | 32 +++++++++++++++++++++++++++++++-
>> po/ko_KR.po | 32 +++++++++++++++++++++++++++++++-
>> po/pt_BR.po | 32 +++++++++++++++++++++++++++++++-
>> po/ru_RU.po | 32 +++++++++++++++++++++++++++++++-
>> po/wok.pot | 32 +++++++++++++++++++++++++++++++-
>> po/zh_CN.po | 32 +++++++++++++++++++++++++++++++-
>> po/zh_TW.po | 32 +++++++++++++++++++++++++++++++-
>> ui/js/src/wok.utils.js | 7 ++++++-
>> ui/pages/i18n.json.tmpl | 13 ++++++++++++-
>> 14 files changed, 390 insertions(+), 14 deletions(-)
>>
>> diff --git a/po/de_DE.po b/po/de_DE.po
>> index 0fb869d..c2b9a0a 100644
>> --- a/po/de_DE.po
>> +++ b/po/de_DE.po
>> @@ -5,7 +5,7 @@ msgid ""
>> msgstr ""
>> "Project-Id-Version: kimchi 0.1\n"
>> "Report-Msgid-Bugs-To: \n"
>> -"POT-Creation-Date: 2016-05-19 21:30+0530\n"
>> +"POT-Creation-Date: 2016-05-25 15:08+0530\n"
>> "PO-Revision-Date: 2013-07-11 17:32-0400\n"
>> "Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
>> "Language-Team: English\n"
>> @@ -201,6 +201,36 @@ msgstr ""
>> msgid "Actions"
>> msgstr ""
>>
>> +msgid "Ki"
>> +msgstr ""
>> +
>> +msgid "Mi"
>> +msgstr ""
>> +
>> +msgid "Gi"
>> +msgstr ""
>> +
>> +msgid "Ti"
>> +msgstr ""
>> +
>> +msgid "Pi"
>> +msgstr ""
>> +
>> +msgid "k"
>> +msgstr ""
>> +
>> +msgid "M"
>> +msgstr ""
>> +
>> +msgid "G"
>> +msgstr ""
>> +
>> +msgid "T"
>> +msgstr ""
>> +
>> +msgid "P"
>> +msgstr ""
>> +
>> msgid "The username or password you entered is incorrect. Please
>> try again."
>> msgstr ""
>> "Der Benutzername oder das Kennwort, den bzw. das Sie eingegeben
>> haben, ist "
>> diff --git a/po/en_US.po b/po/en_US.po
>> index 73d7056..b31785b 100644
>> --- a/po/en_US.po
>> +++ b/po/en_US.po
>> @@ -6,7 +6,7 @@ msgid ""
>> msgstr ""
>> "Project-Id-Version: kimchi 0.1\n"
>> "Report-Msgid-Bugs-To: \n"
>> -"POT-Creation-Date: 2016-05-19 21:30+0530\n"
>> +"POT-Creation-Date: 2016-05-25 15:08+0530\n"
>> "PO-Revision-Date: 2013-07-11 17:32-0400\n"
>> "Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
>> "Language-Team: English\n"
>> @@ -195,6 +195,36 @@ msgstr ""
>> msgid "Actions"
>> msgstr ""
>>
>> +msgid "Ki"
>> +msgstr ""
>> +
>> +msgid "Mi"
>> +msgstr ""
>> +
>> +msgid "Gi"
>> +msgstr ""
>> +
>> +msgid "Ti"
>> +msgstr ""
>> +
>> +msgid "Pi"
>> +msgstr ""
>> +
>> +msgid "k"
>> +msgstr ""
>> +
>> +msgid "M"
>> +msgstr ""
>> +
>> +msgid "G"
>> +msgstr ""
>> +
>> +msgid "T"
>> +msgstr ""
>> +
>> +msgid "P"
>> +msgstr ""
>> +
>> msgid "The username or password you entered is incorrect. Please
>> try again."
>> msgstr ""
>>
>> diff --git a/po/es_ES.po b/po/es_ES.po
>> index 8acb513..d77c60e 100644
>> --- a/po/es_ES.po
>> +++ b/po/es_ES.po
>> @@ -5,7 +5,7 @@ msgid ""
>> msgstr ""
>> "Project-Id-Version: kimchi 0.1\n"
>> "Report-Msgid-Bugs-To: \n"
>> -"POT-Creation-Date: 2016-05-19 21:30+0530\n"
>> +"POT-Creation-Date: 2016-05-25 15:08+0530\n"
>> "PO-Revision-Date: 2013-07-11 17:32-0400\n"
>> "Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
>> "Language-Team: English\n"
>> @@ -201,6 +201,36 @@ msgstr ""
>> msgid "Actions"
>> msgstr ""
>>
>> +msgid "Ki"
>> +msgstr ""
>> +
>> +msgid "Mi"
>> +msgstr ""
>> +
>> +msgid "Gi"
>> +msgstr ""
>> +
>> +msgid "Ti"
>> +msgstr ""
>> +
>> +msgid "Pi"
>> +msgstr ""
>> +
>> +msgid "k"
>> +msgstr ""
>> +
>> +msgid "M"
>> +msgstr ""
>> +
>> +msgid "G"
>> +msgstr ""
>> +
>> +msgid "T"
>> +msgstr ""
>> +
>> +msgid "P"
>> +msgstr ""
>> +
>> msgid "The username or password you entered is incorrect. Please
>> try again."
>> msgstr ""
>> "El nombre de usuario o contraseña que ha especificado es
>> incorrecto. Por "
>> diff --git a/po/fr_FR.po b/po/fr_FR.po
>> index 9cc473a..065113b 100644
>> --- a/po/fr_FR.po
>> +++ b/po/fr_FR.po
>> @@ -5,7 +5,7 @@ msgid ""
>> msgstr ""
>> "Project-Id-Version: kimchi 0.1\n"
>> "Report-Msgid-Bugs-To: \n"
>> -"POT-Creation-Date: 2016-05-19 21:30+0530\n"
>> +"POT-Creation-Date: 2016-05-25 15:08+0530\n"
>> "PO-Revision-Date: 2014-08-27 21:30+0000\n"
>> "Last-Translator: BobSynfig\n"
>> "Language-Team: French
>> (http://www.transifex.com/projects/p/kimchi/language/"
>> @@ -204,6 +204,36 @@ msgstr ""
>> msgid "Actions"
>> msgstr ""
>>
>> +msgid "Ki"
>> +msgstr ""
>> +
>> +msgid "Mi"
>> +msgstr ""
>> +
>> +msgid "Gi"
>> +msgstr ""
>> +
>> +msgid "Ti"
>> +msgstr ""
>> +
>> +msgid "Pi"
>> +msgstr ""
>> +
>> +msgid "k"
>> +msgstr ""
>> +
>> +msgid "M"
>> +msgstr ""
>> +
>> +msgid "G"
>> +msgstr ""
>> +
>> +msgid "T"
>> +msgstr ""
>> +
>> +msgid "P"
>> +msgstr ""
>> +
>> msgid "The username or password you entered is incorrect. Please
>> try again."
>> msgstr ""
>> "Le nom d'utilisateur ou le mot de passe que vous avez entré est
>> incorrect. "
>> diff --git a/po/it_IT.po b/po/it_IT.po
>> index ef3729d..d871172 100644
>> --- a/po/it_IT.po
>> +++ b/po/it_IT.po
>> @@ -5,7 +5,7 @@ msgid ""
>> msgstr ""
>> "Project-Id-Version: kimchi 0.1\n"
>> "Report-Msgid-Bugs-To: \n"
>> -"POT-Creation-Date: 2016-05-19 21:30+0530\n"
>> +"POT-Creation-Date: 2016-05-25 15:08+0530\n"
>> "PO-Revision-Date: 2013-07-11 17:32-0400\n"
>> "Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
>> "Language-Team: English\n"
>> @@ -201,6 +201,36 @@ msgstr ""
>> msgid "Actions"
>> msgstr ""
>>
>> +msgid "Ki"
>> +msgstr ""
>> +
>> +msgid "Mi"
>> +msgstr ""
>> +
>> +msgid "Gi"
>> +msgstr ""
>> +
>> +msgid "Ti"
>> +msgstr ""
>> +
>> +msgid "Pi"
>> +msgstr ""
>> +
>> +msgid "k"
>> +msgstr ""
>> +
>> +msgid "M"
>> +msgstr ""
>> +
>> +msgid "G"
>> +msgstr ""
>> +
>> +msgid "T"
>> +msgstr ""
>> +
>> +msgid "P"
>> +msgstr ""
>> +
>> msgid "The username or password you entered is incorrect. Please
>> try again."
>> msgstr ""
>> "Il nome utente o la password immessi non sono corretti. Ripetere "
>> diff --git a/po/ja_JP.po b/po/ja_JP.po
>> index dc8926f..cde5d87 100644
>> --- a/po/ja_JP.po
>> +++ b/po/ja_JP.po
>> @@ -5,7 +5,7 @@ msgid ""
>> msgstr ""
>> "Project-Id-Version: kimchi 0.1\n"
>> "Report-Msgid-Bugs-To: \n"
>> -"POT-Creation-Date: 2016-05-19 21:30+0530\n"
>> +"POT-Creation-Date: 2016-05-25 15:08+0530\n"
>> "PO-Revision-Date: 2013-07-11 17:32-0400\n"
>> "Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
>> "Language-Team: English\n"
>> @@ -199,6 +199,36 @@ msgstr ""
>> msgid "Actions"
>> msgstr ""
>>
>> +msgid "Ki"
>> +msgstr ""
>> +
>> +msgid "Mi"
>> +msgstr ""
>> +
>> +msgid "Gi"
>> +msgstr ""
>> +
>> +msgid "Ti"
>> +msgstr ""
>> +
>> +msgid "Pi"
>> +msgstr ""
>> +
>> +msgid "k"
>> +msgstr ""
>> +
>> +msgid "M"
>> +msgstr ""
>> +
>> +msgid "G"
>> +msgstr ""
>> +
>> +msgid "T"
>> +msgstr ""
>> +
>> +msgid "P"
>> +msgstr ""
>> +
>> msgid "The username or password you entered is incorrect. Please
>> try again."
>> msgstr "入力したユーザー名またはパスワードが誤っています。やり直し
>> てください。"
>>
>> diff --git a/po/ko_KR.po b/po/ko_KR.po
>> index 84b4750..2ef50fb 100644
>> --- a/po/ko_KR.po
>> +++ b/po/ko_KR.po
>> @@ -5,7 +5,7 @@ msgid ""
>> msgstr ""
>> "Project-Id-Version: kimchi 0.1\n"
>> "Report-Msgid-Bugs-To: \n"
>> -"POT-Creation-Date: 2016-05-19 21:30+0530\n"
>> +"POT-Creation-Date: 2016-05-25 15:08+0530\n"
>> "PO-Revision-Date: 2013-07-11 17:32-0400\n"
>> "Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
>> "Language-Team: English\n"
>> @@ -196,6 +196,36 @@ msgstr ""
>> msgid "Actions"
>> msgstr ""
>>
>> +msgid "Ki"
>> +msgstr ""
>> +
>> +msgid "Mi"
>> +msgstr ""
>> +
>> +msgid "Gi"
>> +msgstr ""
>> +
>> +msgid "Ti"
>> +msgstr ""
>> +
>> +msgid "Pi"
>> +msgstr ""
>> +
>> +msgid "k"
>> +msgstr ""
>> +
>> +msgid "M"
>> +msgstr ""
>> +
>> +msgid "G"
>> +msgstr ""
>> +
>> +msgid "T"
>> +msgstr ""
>> +
>> +msgid "P"
>> +msgstr ""
>> +
>> msgid "The username or password you entered is incorrect. Please
>> try again."
>> msgstr ""
>> "입력한 사용자 이름 또는 비밀번호가 올바르지 않습니다. 다시 시도하
>> 십시오."
>> diff --git a/po/pt_BR.po b/po/pt_BR.po
>> index a4ae451..75a6c9b 100644
>> --- a/po/pt_BR.po
>> +++ b/po/pt_BR.po
>> @@ -20,7 +20,7 @@ msgid ""
>> msgstr ""
>> "Project-Id-Version: kimchi 1.0\n"
>> "Report-Msgid-Bugs-To: \n"
>> -"POT-Creation-Date: 2016-05-19 21:30+0530\n"
>> +"POT-Creation-Date: 2016-05-25 15:08+0530\n"
>> "PO-Revision-Date: 2015-03-23 12:57+0000\n"
>> "Last-Translator: Crístian Deives dos Santos Viana
>> <cristiandeives@gmail."
>> "com>\n"
>> @@ -217,6 +217,36 @@ msgstr ""
>> msgid "Actions"
>> msgstr ""
>>
>> +msgid "Ki"
>> +msgstr ""
>> +
>> +msgid "Mi"
>> +msgstr ""
>> +
>> +msgid "Gi"
>> +msgstr ""
>> +
>> +msgid "Ti"
>> +msgstr ""
>> +
>> +msgid "Pi"
>> +msgstr ""
>> +
>> +msgid "k"
>> +msgstr ""
>> +
>> +msgid "M"
>> +msgstr ""
>> +
>> +msgid "G"
>> +msgstr ""
>> +
>> +msgid "T"
>> +msgstr ""
>> +
>> +msgid "P"
>> +msgstr ""
>> +
>> msgid "The username or password you entered is incorrect. Please
>> try again."
>> msgstr ""
>> "O usuário ou senha inseridos estão incorretos. Por favor, tente
>> novamente."
>> diff --git a/po/ru_RU.po b/po/ru_RU.po
>> index 0e81ba4..392be6d 100644
>> --- a/po/ru_RU.po
>> +++ b/po/ru_RU.po
>> @@ -5,7 +5,7 @@ msgid ""
>> msgstr ""
>> "Project-Id-Version: kimchi 0.1\n"
>> "Report-Msgid-Bugs-To: \n"
>> -"POT-Creation-Date: 2016-05-19 21:30+0530\n"
>> +"POT-Creation-Date: 2016-05-25 15:08+0530\n"
>> "PO-Revision-Date: 2014-08-28 17:32+0000\n"
>> "Last-Translator: Aline Manera <aline.manera(a)gmail.com>\n"
>> "Language-Team: Russian
>> (http://www.transifex.com/projects/p/kimchi/language/"
>> @@ -197,6 +197,36 @@ msgstr ""
>> msgid "Actions"
>> msgstr ""
>>
>> +msgid "Ki"
>> +msgstr ""
>> +
>> +msgid "Mi"
>> +msgstr ""
>> +
>> +msgid "Gi"
>> +msgstr ""
>> +
>> +msgid "Ti"
>> +msgstr ""
>> +
>> +msgid "Pi"
>> +msgstr ""
>> +
>> +msgid "k"
>> +msgstr ""
>> +
>> +msgid "M"
>> +msgstr ""
>> +
>> +msgid "G"
>> +msgstr ""
>> +
>> +msgid "T"
>> +msgstr ""
>> +
>> +msgid "P"
>> +msgstr ""
>> +
>> msgid "The username or password you entered is incorrect. Please
>> try again."
>> msgstr "Указано неверное имя пользователя или пароль. Введите еще
>> раз."
>>
>> diff --git a/po/wok.pot b/po/wok.pot
>> index 01b8a28..231cd33 100755
>> --- a/po/wok.pot
>> +++ b/po/wok.pot
>> @@ -8,7 +8,7 @@ msgid ""
>> msgstr ""
>> "Project-Id-Version: PACKAGE VERSION\n"
>> "Report-Msgid-Bugs-To: \n"
>> -"POT-Creation-Date: 2016-05-19 21:30+0530\n"
>> +"POT-Creation-Date: 2016-05-25 15:08+0530\n"
>> "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
>> "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
>> "Language-Team: LANGUAGE <LL(a)li.org>\n"
>> @@ -195,6 +195,36 @@ msgstr ""
>> msgid "Actions"
>> msgstr ""
>>
>> +msgid "Ki"
>> +msgstr ""
>> +
>> +msgid "Mi"
>> +msgstr ""
>> +
>> +msgid "Gi"
>> +msgstr ""
>> +
>> +msgid "Ti"
>> +msgstr ""
>> +
>> +msgid "Pi"
>> +msgstr ""
>> +
>> +msgid "k"
>> +msgstr ""
>> +
>> +msgid "M"
>> +msgstr ""
>> +
>> +msgid "G"
>> +msgstr ""
>> +
>> +msgid "T"
>> +msgstr ""
>> +
>> +msgid "P"
>> +msgstr ""
>> +
>> msgid "The username or password you entered is incorrect. Please
>> try again."
>> msgstr ""
>>
>> diff --git a/po/zh_CN.po b/po/zh_CN.po
>> index 0a66eec..5d81cc5 100644
>> --- a/po/zh_CN.po
>> +++ b/po/zh_CN.po
>> @@ -20,7 +20,7 @@ msgid ""
>> msgstr ""
>> "Project-Id-Version: kimchi 0.1\n"
>> "Report-Msgid-Bugs-To: \n"
>> -"POT-Creation-Date: 2016-05-19 21:30+0530\n"
>> +"POT-Creation-Date: 2016-05-25 15:08+0530\n"
>> "PO-Revision-Date: 2013-06-27 10:48+0000\n"
>> "Last-Translator: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>\n"
>> "Language-Team: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>\n"
>> @@ -212,6 +212,36 @@ msgstr ""
>> msgid "Actions"
>> msgstr ""
>>
>> +msgid "Ki"
>> +msgstr ""
>> +
>> +msgid "Mi"
>> +msgstr ""
>> +
>> +msgid "Gi"
>> +msgstr ""
>> +
>> +msgid "Ti"
>> +msgstr ""
>> +
>> +msgid "Pi"
>> +msgstr ""
>> +
>> +msgid "k"
>> +msgstr ""
>> +
>> +msgid "M"
>> +msgstr ""
>> +
>> +msgid "G"
>> +msgstr ""
>> +
>> +msgid "T"
>> +msgstr ""
>> +
>> +msgid "P"
>> +msgstr ""
>> +
>> msgid "The username or password you entered is incorrect. Please
>> try again."
>> msgstr "用户名或密码错误,请重新输入。"
>>
>> diff --git a/po/zh_TW.po b/po/zh_TW.po
>> index fd83384..ccd1d48 100644
>> --- a/po/zh_TW.po
>> +++ b/po/zh_TW.po
>> @@ -5,7 +5,7 @@ msgid ""
>> msgstr ""
>> "Project-Id-Version: kimchi 0.1\n"
>> "Report-Msgid-Bugs-To: \n"
>> -"POT-Creation-Date: 2016-05-19 21:30+0530\n"
>> +"POT-Creation-Date: 2016-05-25 15:08+0530\n"
>> "PO-Revision-Date: 2013-07-11 17:32-0400\n"
>> "Last-Translator: Crístian Viana <vianac(a)linux.vnet.ibm.com>\n"
>> "Language-Team: English\n"
>> @@ -196,6 +196,36 @@ msgstr ""
>> msgid "Actions"
>> msgstr ""
>>
>> +msgid "Ki"
>> +msgstr ""
>> +
>> +msgid "Mi"
>> +msgstr ""
>> +
>> +msgid "Gi"
>> +msgstr ""
>> +
>> +msgid "Ti"
>> +msgstr ""
>> +
>> +msgid "Pi"
>> +msgstr ""
>> +
>> +msgid "k"
>> +msgstr ""
>> +
>> +msgid "M"
>> +msgstr ""
>> +
>> +msgid "G"
>> +msgstr ""
>> +
>> +msgid "T"
>> +msgstr ""
>> +
>> +msgid "P"
>> +msgstr ""
>> +
>> msgid "The username or password you entered is incorrect. Please
>> try again."
>> msgstr "您輸入的使用者名稱或密碼不正確。請重試。"
>>
>> diff --git a/ui/js/src/wok.utils.js b/ui/js/src/wok.utils.js
>> index 1fb3c9b..8eb6f08 100644
>> --- a/ui/js/src/wok.utils.js
>> +++ b/ui/js/src/wok.utils.js
>> @@ -150,9 +150,14 @@ wok.changetoProperUnit = function(numOrg,
>> digits, base) {
>> var fixed = settings['fixed'];
>>
>> var unitMapping = unitBaseMapping[base];
>> + var unitmap = { 'Ki': 'WOKFMT2001M', 'Mi': 'WOKFMT2002M',
>> 'Gi': 'WOKFMT2003M',
>> + 'Ti': 'WOKFMT2004M', 'Pi': 'WOKFMT2005M',
>> 'k': 'WOKFMT2006M',
>> + 'M': 'WOKFMT2007M', 'G': 'WOKFMT2008M', 'T':
>> 'WOKFMT2009M',
>> + 'P': 'WOKFMT2010M'}
>> for(var i = unitMapping.length - 1; i >= 0; i--) {
>> var mapping = unitMapping[i];
>> - var suffix = mapping['us'];
>> + var s_key = mapping['us'];
>> + var suffix = i18n[unitmap[s_key]];
>> var startingValue = mapping['v'];
>> if(number < startingValue) {
>> continue;
>> diff --git a/ui/pages/i18n.json.tmpl b/ui/pages/i18n.json.tmpl
>> index ca7ae4c..94e90ac 100644
>> --- a/ui/pages/i18n.json.tmpl
>> +++ b/ui/pages/i18n.json.tmpl
>> @@ -49,5 +49,16 @@
>> "WOKSETT0009M": "$_("Showing {{ctx.start}} to {{ctx.end}} of
>> {{ctx.total}} entries")",
>> "WOKSETT0010M": "$_("No results found!")",
>> "WOKSETT0011M": "$_("Loading...")",
>> - "WOKSETT0012M": "$_("Actions")"
>> + "WOKSETT0012M": "$_("Actions")",
>> +
>> + "WOKFMT2001M": "$_("Ki")",
>> + "WOKFMT2002M": "$_("Mi")",
>> + "WOKFMT2003M": "$_("Gi")",
>> + "WOKFMT2004M": "$_("Ti")",
>> + "WOKFMT2005M": "$_("Pi")",
>> + "WOKFMT2006M": "$_("k")",
>> + "WOKFMT2007M": "$_("M")",
>> + "WOKFMT2008M": "$_("G")",
>> + "WOKFMT2009M": "$_("T")",
>> + "WOKFMT2010M": "$_("P")"
>> }
>
8 years, 6 months
[PATCH] [Kimchi] Use Wok session timeout value to configure serial console
by Aline Manera
Signed-off-by: Aline Manera <alinefm(a)linux.vnet.ibm.com>
---
kimchi.conf | 3 ---
serialconsole.py | 10 ++++++----
tests/test_config.py.in | 1 -
3 files changed, 6 insertions(+), 8 deletions(-)
diff --git a/kimchi.conf b/kimchi.conf
index c451703..239b0b4 100644
--- a/kimchi.conf
+++ b/kimchi.conf
@@ -10,8 +10,5 @@ uri = "/plugins/kimchi"
# in the same network. Check README-federation for more details.
federation = False
-# Serial console timeout (seconds)
-SERIAL_CONSOLE_TIMEOUT = 120
-
# Automatically create ISO pool on server start up
create_iso_pool = True
diff --git a/serialconsole.py b/serialconsole.py
index d290798..13ef331 100644
--- a/serialconsole.py
+++ b/serialconsole.py
@@ -27,10 +27,11 @@ import time
from multiprocessing import Process
-from wok.plugins.kimchi import model
-from wok.plugins.kimchi.config import config
+from wok.config import config as wok_config
from wok.utils import wok_log
+from wok.plugins.kimchi import model
+
SOCKET_QUEUE_BACKLOG = 0
CTRL_Q = '\x11'
@@ -207,8 +208,9 @@ class SocketServer(Process):
client console.
"""
client, client_addr = self._socket.accept()
- client.settimeout(config.get('kimchi', {}).
- get('SERIAL_CONSOLE_TIMEOUT', 120))
+
+ session_timeout = wok_config.get('server', 'session_timeout')
+ client.settimeout(int(session_timeout) * 60)
wok_log.info('[%s] Client connected to %s', self.name,
self._guest_name)
diff --git a/tests/test_config.py.in b/tests/test_config.py.in
index 48abd5b..a6728e8 100644
--- a/tests/test_config.py.in
+++ b/tests/test_config.py.in
@@ -82,7 +82,6 @@ class ConfigTests(unittest.TestCase):
'kimchi': {
'federation': False,
'create_iso_pool': True,
- 'SERIAL_CONSOLE_TIMEOUT': 120
},
'/': {
'tools.trailing_slash.on': False,
--
2.5.5
8 years, 6 months
[PATCH] [Kimchi] Add missing test dependency: bc
by Lucio Correia
Signed-off-by: Lucio Correia <luciojhc(a)linux.vnet.ibm.com>
---
docs/ubuntu-deps.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/ubuntu-deps.md b/docs/ubuntu-deps.md
index e21f6a8..b0b1562 100644
--- a/docs/ubuntu-deps.md
+++ b/docs/ubuntu-deps.md
@@ -31,4 +31,4 @@ Packages required for UI development
Packages required for tests
---------------------------
- $ sudo apt-get install pep8 pyflakes python-requests python-mock
+ $ sudo apt-get install pep8 pyflakes python-requests python-mock bc
--
1.9.1
8 years, 6 months
[PATCH][Wok 5/5] Change plugins API documentation by pluginsmanager API
by Rodrigo Trujillo
This patch creates the documentation for pluginsmanager API
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
docs/API/plugins.md | 13 ----------
docs/API/pluginsmanager.md | 61 ++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+), 13 deletions(-)
delete mode 100644 docs/API/plugins.md
create mode 100644 docs/API/pluginsmanager.md
diff --git a/docs/API/plugins.md b/docs/API/plugins.md
deleted file mode 100644
index aaa37b5..0000000
--- a/docs/API/plugins.md
+++ /dev/null
@@ -1,13 +0,0 @@
-## REST API Specification for Plugins
-
-### Collection: Plugins
-
-**URI:** /plugins
-
-**Methods:**
-
-* **GET**: Retrieve a summarized list names of all UI Plugins
-
-#### Examples
-GET /plugins
-[pluginA, pluginB, pluginC]
diff --git a/docs/API/pluginsmanager.md b/docs/API/pluginsmanager.md
new file mode 100644
index 0000000..23381d3
--- /dev/null
+++ b/docs/API/pluginsmanager.md
@@ -0,0 +1,61 @@
+## REST API Specification for Plugins Manager
+
+### Collection: Plugins
+
+**URI:** /pluginsmanager
+
+**Methods:**
+
+* **GET**: Retrieve a list of all Plugins configured in Wok, showing name and state.
+
+#### Examples
+GET /pluginsmanager
+[
+ {
+ "enabled":true,
+ "name":"gingerbase"
+ },
+ {
+ "enabled":true,
+ "name":"kimchi"
+ },
+ {
+ "enabled":false,
+ "name":"sample"
+ }
+]
+
+### Resource: Plugin
+
+**URI:** /pluginsmanager/*:name*
+
+A plugin represents a software that will make use of infrastructure provided
+by Wok. It should be installed in a directory with its <name> in Wok directory
+'plugins' and contains an <name>.conf file.
+Example: "/usr/lib/python2.7/site-packages/wok/plugins/kimchi"
+
+**Methods:**
+
+* **GET**: Retrieve the full description of the plugin.
+ * name: The plugin name
+ * enabled: State of the plugin. If not enabled, Wok will not load it
+* **POST**: *See Task Actions*
+
+**Actions (POST):**
+
+* enable: enable a disabled plugin. Also changes plugin's configuration file
+
+* disable: disable a enabled plugin. Also changes plugin's configuration file
+
+#### Examples
+GET /pluginsmanager/sample
+{
+ "enabled":false,
+ "name":"sample"
+}
+
+POST /pluginsmanager/sample/enable
+{
+ "enabled":true,
+ "name":"sample"
+}
--
2.1.0
8 years, 6 months
[PATCH][Wok 4/5] Implements control/model of new plugin API
by Rodrigo Trujillo
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
src/wok/control/plugins.py | 19 ++++++++++++++++---
src/wok/i18n.py | 3 +++
src/wok/model/plugins.py | 30 ++++++++++++++++++++++++------
3 files changed, 43 insertions(+), 9 deletions(-)
diff --git a/src/wok/control/plugins.py b/src/wok/control/plugins.py
index 57dfa1b..c7c9554 100644
--- a/src/wok/control/plugins.py
+++ b/src/wok/control/plugins.py
@@ -19,11 +19,24 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-from wok.control.base import SimpleCollection
+from wok.control.base import Collection, Resource
from wok.control.utils import UrlSubNode
-@UrlSubNode("plugins")
-class Plugins(SimpleCollection):
+@UrlSubNode("pluginsmanager")
+class Plugins(Collection):
def __init__(self, model):
super(Plugins, self).__init__(model)
+ self.resource = Plugin
+
+
+class Plugin(Resource):
+ def __init__(self, model, id):
+ super(Plugin, self).__init__(model, id)
+ self.uri_fmt = "/pluginsmanager/%s"
+ self.enable = self.generate_action_handler('enable')
+ self.disable = self.generate_action_handler('disable')
+
+ @property
+ def data(self):
+ return self.info
diff --git a/src/wok/i18n.py b/src/wok/i18n.py
index 4fc21f1..bda3949 100644
--- a/src/wok/i18n.py
+++ b/src/wok/i18n.py
@@ -60,4 +60,7 @@ messages = {
"WOKRES0001L": _("Request made on resource"),
"WOKROOT0001L": _("User '%(username)s' logged in"),
"WOKROOT0002L": _("User '%(username)s' logged out"),
+
+ "WOKPLUG0001E": _("Plugin '%(plugin_name)s' not found."),
+ "WOKPLUG0002E": _("Error updating configuration file of plugin '%(plugin)s'."),
}
diff --git a/src/wok/model/plugins.py b/src/wok/model/plugins.py
index 4beff44..1842dbc 100644
--- a/src/wok/model/plugins.py
+++ b/src/wok/model/plugins.py
@@ -19,9 +19,9 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
-import cherrypy
-from wok.utils import get_enabled_plugins
+from wok.exception import NotFoundError
+from wok.pluginsmanager import Plugins
class PluginsModel(object):
@@ -29,7 +29,25 @@ class PluginsModel(object):
pass
def get_list(self):
- # Will only return plugins that were loaded correctly by WOK and are
- # properly configured in cherrypy
- return [plugin for (plugin, config) in get_enabled_plugins()
- if config.get('wok').get('uri') in cherrypy.tree.apps.keys()]
+ return Plugins().get_all_plugins_names()
+
+
+class PluginModel(object):
+ def __init__(self, **kargs):
+ pass
+
+ def lookup(self, plugin):
+ info = Plugins().get_plugin_info(plugin)
+ if not info:
+ raise NotFoundError('WOKPLUG0001E', {'plugin_name': plugin})
+
+ return {'name': plugin,
+ 'enabled': info['enabled']}
+
+ def enable(self, plugin_name):
+ print "Enabling %s" % plugin_name
+ Plugins().enable_plugin(plugin_name)
+
+ def disable(self, plugin_name):
+ print "Disabling %s" % plugin_name
+ Plugins().disable_plugin(plugin_name)
--
2.1.0
8 years, 6 months
[PATCH][Wok 3/5] Changes server behavior to use pluginsmanager
by Rodrigo Trujillo
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
src/wok/server.py | 32 +++++++++++++++++---------------
src/wok/utils.py | 36 +++---------------------------------
2 files changed, 20 insertions(+), 48 deletions(-)
diff --git a/src/wok/server.py b/src/wok/server.py
index 902d4bf..d9f6ec5 100644
--- a/src/wok/server.py
+++ b/src/wok/server.py
@@ -21,6 +21,7 @@
#
import cherrypy
+import copy
import logging
import logging.handlers
import os
@@ -30,14 +31,15 @@ from string import Template
from wok import auth
from wok import config
from wok.config import config as configParser
-from wok.config import paths, PluginConfig, WokConfig
+from wok.config import paths, WokConfig
from wok.control import sub_nodes
from wok.model import model
+from wok.pluginsmanager import Plugins
from wok.proxy import start_proxy, terminate_proxy
from wok.reqlogger import RequestLogger
from wok.root import WokRoot
from wok.safewatchedfilehandler import SafeWatchedFileHandler
-from wok.utils import get_enabled_plugins, import_class
+from wok.utils import import_class
LOGGING_LEVEL = {"debug": logging.DEBUG,
@@ -171,6 +173,9 @@ class Server(object):
self.app = cherrypy.tree.mount(WokRoot(model_instance, dev_env),
config=self.configObj)
+
+ # Initiate and handles plugins
+ self.plugins = Plugins()
self._load_plugins(options)
# Terminate proxy when cherrypy server is terminated
@@ -179,18 +184,15 @@ class Server(object):
cherrypy.lib.sessions.init()
def _load_plugins(self, options):
- for plugin_name, plugin_config in get_enabled_plugins():
- try:
- plugin_class = ('plugins.%s.%s' %
- (plugin_name,
- plugin_name[0].upper() + plugin_name[1:]))
- script_name = plugin_config['wok']['uri']
- del plugin_config['wok']
-
- plugin_config.update(PluginConfig(plugin_name))
- except KeyError:
+ plugins_info = self.plugins.get_all_plugins_info()
+ for plugin_name in plugins_info:
+ if not plugins_info[plugin_name]['enabled']:
continue
+ plugin_class = plugins_info[plugin_name]['plugin_class']
+ script_name = plugins_info[plugin_name]['uri']
+ plugin_cfg = copy.deepcopy(plugins_info[plugin_name]['config'])
+
try:
plugin_app = import_class(plugin_class)(options)
except ImportError, e:
@@ -203,7 +205,7 @@ class Server(object):
# dynamically extend plugin config with custom data, if provided
get_custom_conf = getattr(plugin_app, "get_custom_conf", None)
if get_custom_conf is not None:
- plugin_config.update(get_custom_conf())
+ plugin_cfg.update(get_custom_conf())
# dynamically add tools.wokauth.on = True to extra plugin APIs
try:
@@ -216,7 +218,7 @@ class Server(object):
ident = "/%s" % ident
urlSubNodes[ident] = {'tools.wokauth.on': True}
- plugin_config.update(urlSubNodes)
+ plugin_cfg.update(urlSubNodes)
except ImportError, e:
cherrypy.log.error_log.error(
@@ -224,7 +226,7 @@ class Server(object):
"error: %s" % (plugin_class, e.message)
)
- cherrypy.tree.mount(plugin_app, script_name, plugin_config)
+ cherrypy.tree.mount(plugin_app, script_name, plugin_cfg)
def start(self):
# Subscribe to SignalHandler plugin
diff --git a/src/wok/utils.py b/src/wok/utils.py
index 9a29084..e46e234 100644
--- a/src/wok/utils.py
+++ b/src/wok/utils.py
@@ -35,14 +35,14 @@ import traceback
import xml.etree.ElementTree as ET
import locale
-from cherrypy.lib.reprconf import Parser
from datetime import datetime, timedelta
from multiprocessing import Process, Queue
from threading import Timer
from wok.asynctask import AsyncTask
-from wok.config import paths, PluginPaths
+from wok.config import PluginPaths
from wok.exception import InvalidParameter, TimeoutExpired
+from wok.pluginsmanager import Plugins
wok_log = cherrypy.log.error_log
@@ -76,40 +76,10 @@ def is_digit(value):
return False
-def _load_plugin_conf(name):
- plugin_conf = PluginPaths(name).conf_file
- if not os.path.exists(plugin_conf):
- cherrypy.log.error_log.error("Plugin configuration file %s"
- " doesn't exist." % plugin_conf)
- return
- try:
- return Parser().dict_from_file(plugin_conf)
- except ValueError as e:
- cherrypy.log.error_log.error("Failed to load plugin "
- "conf from %s: %s" %
- (plugin_conf, e.message))
-
-
-def get_enabled_plugins():
- plugin_dir = paths.plugins_dir
- try:
- dir_contents = os.listdir(plugin_dir)
- except OSError:
- return
- for name in dir_contents:
- if os.path.isdir(os.path.join(plugin_dir, name)):
- plugin_config = _load_plugin_conf(name)
- try:
- if plugin_config['wok']['enable']:
- yield (name, plugin_config)
- except (TypeError, KeyError):
- continue
-
-
def get_all_tabs():
files = []
- for plugin, _ in get_enabled_plugins():
+ for plugin in Plugins().get_enabled_plugins():
files.append(os.path.join(PluginPaths(plugin).ui_dir,
'config/tab-ext.xml'))
--
2.1.0
8 years, 6 months