[v2 0/2] UI: Grid Widget(with sample)
by huoyuxin@linux.vnet.ibm.com
From: Yu Xin Huo <huoyuxin(a)linux.vnet.ibm.com>
v2: add license statements and sample html
Yu Xin Huo (2):
UI: Grid Widget
ui: grid sample
ui/css/theme-default/datagrid.css | 63 +++++++++++++++++++++
ui/js/widgets/grid.js | 111 +++++++++++++++++++++++++++++++++++++
ui/js/widgets/samples/grid.html | 80 ++++++++++++++++++++++++++
3 files changed, 254 insertions(+), 0 deletions(-)
create mode 100644 ui/css/theme-default/datagrid.css
create mode 100644 ui/js/widgets/grid.js
create mode 100644 ui/js/widgets/samples/grid.html
9 years, 10 months
[PATCH V2 0/2] Dialog widget with sample
by Wen Wang
Dialog widget with sample
Wen Wang (2):
UI; Add widget of dialog
UI: Sample of dialog widget
ui/css/theme-default/dialog-flat.css | 67 +++++++++++++++++++
ui/js/widgets/dialog-flat.js | 120 +++++++++++++++++++++++++++++++++++
ui/js/widgets/samples/dialog.html | 51 +++++++++++++++
3 files changed, 238 insertions(+)
create mode 100644 ui/css/theme-default/dialog-flat.css
create mode 100644 ui/js/widgets/dialog-flat.js
create mode 100644 ui/js/widgets/samples/dialog.html
--
2.1.0
9 years, 10 months
[PATCH V3 0/2] Adding widget of list with sample
by Wen Wang
Adding widget of list with sample
Wen Wang (2):
UI: Adding new widget of list
UI: Sample of list widget
ui/css/theme-default/list-flat.css | 83 ++++++++++++++++++++++++++++++++++++++
ui/js/widgets/list-flat.js | 76 ++++++++++++++++++++++++++++++++++
ui/js/widgets/samples/list.html | 45 +++++++++++++++++++++
3 files changed, 204 insertions(+)
create mode 100644 ui/css/theme-default/list-flat.css
create mode 100644 ui/js/widgets/list-flat.js
create mode 100644 ui/js/widgets/samples/list.html
--
2.1.0
9 years, 10 months
[PATCH V2 0/2] Add list widget with sample
by Wen Wang
Add list widget with sample
Wen Wang (2):
UI: Adding new widget of list
UI: Sample of list widget
ui/css/theme-default/list-flat.css | 83 ++++++++++++++++++++++++++++++++++++++
ui/js/widgets/list-flat.js | 76 ++++++++++++++++++++++++++++++++++
ui/js/widgets/samples/list.html | 45 +++++++++++++++++++++
3 files changed, 204 insertions(+)
create mode 100644 ui/css/theme-default/list-flat.css
create mode 100644 ui/js/widgets/list-flat.js
create mode 100644 ui/js/widgets/samples/list.html
--
2.1.0
9 years, 10 months
[PATCH V3] UI: Sample of menu/button/radio/checkbox/seletmenu/textbox
by Wen Wang
V2 -> V3:
Change the date of the lincense.
V1 -> V2:
Add lincense.
Signed-off-by: Wen Wang <wenwang(a)linux.vnet.ibm.com>
---
...u-button-radio-checkbox-text-select-sample.html | 101 +++++++++++++++++++++
1 file changed, 101 insertions(+)
create mode 100644 ui/js/widgets/samples/menu-button-radio-checkbox-text-select-sample.html
diff --git a/ui/js/widgets/samples/menu-button-radio-checkbox-text-select-sample.html b/ui/js/widgets/samples/menu-button-radio-checkbox-text-select-sample.html
new file mode 100644
index 0000000..ec92dbe
--- /dev/null
+++ b/ui/js/widgets/samples/menu-button-radio-checkbox-text-select-sample.html
@@ -0,0 +1,101 @@
+<!--
+/*
+ * Project Kimchi
+ *
+ * Copyright IBM, Corp. 2015
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <title>Demo</title>
+ <script src="../../../libs/jquery-1.10.0.min.js"></script>
+ <script src="../../../libs/jquery-ui.min.js"></script>
+ <script src="../menu-flat.js"></script>
+ <script src="../button-flat.js"></script>
+ <script src="../radio-flat.js"></script>
+ <script src="../checkbox-flat.js"></script>
+ <script src="../textbox-flat.js"></script>
+ <script src="../selectmenu-flat.js"></script>
+ <link rel="stylesheet" href="../../../libs/themes/base/jquery-ui.min.css">
+ <link rel="stylesheet" href="../../../css/theme-default/menu-flat.css">
+ <link rel="stylesheet" href="../../../css/theme-default/button-flat.css">
+ <link rel="stylesheet" href="../../../css/theme-default/radio-flat.css">
+ <link rel="stylesheet" href="../../../css/theme-default/checkbox-flat.css">
+ <link rel="stylesheet" href="../../../css/theme-default/textbox-flat.css">
+ <link rel="stylesheet" href="../../../css/theme-default/selectmenu-flat.css">
+ <link rel="stylesheet" href="../../../css/fontello/css/animation.css">
+ <link rel="stylesheet" href="../../../css/fontello/css/fontello.css">
+ </head>
+ <body>
+ <div id="menu"></div>
+ <div style="height:50px"><div id="select"></div></div>
+ <div class="radio-demo"></div>
+ <div class="checkbox-demo"></div>
+ <input class="text-demo">
+ <button class="button-demo">submit</button>
+ <script>
+ $(document).ready(function() {
+ $("#menu").menuFlat({
+ content: [1,2,3,4,5,6], //Set content of the menu.
+ icon: "icon-edit-alt", //Set icon of the menu button.
+ listIconList: ["icon-edit-alt","icon-edit-alt","icon-edit-alt","icon-edit-alt","icon-edit-alt","icon-user"]
+ //Set icons of the menu list.
+ // name is optional which set the name of the menu list.
+ });
+ $("#menu0").on("click", function() {
+ alert("hello");
+ });
+ $("#menu1").on("click", function() {
+ console.log("hello");
+ });
+ $("#select").selectmenuFlat({
+ content: [1,2,3,4,5,6], //Set content of the select menu
+ selected: 2 // set the selected option, starts from "1"
+ });
+ $("#select").selectmenuFlat("value", "4"); //Set value.
+ var t = $("#select").selectmenuFlat("value"); //Get value
+ console.log(t);
+ $(".radio-demo").radioFlat({
+ id: "t", //Base id of the radio set.
+ name: "test", //name of the radio.
+ whichChecked: 2, //First selected position, starts from 1.
+ content: ["apple", "banana", "orange", "cherry"] //set the content array.
+ });
+ $(".radio-demo").click(function() {
+ console.log($(".radio-demo").radioFlat("value")); //this is how to get the value of selected radio value
+ });
+ $(".checkbox-demo").checkboxFlat({
+ id: "t", //Checkbox base id.
+ name: "test", //Checkbox name.
+ content: ["apple", "banana", "orange", "cherry"], //Contents of the checkbox set.
+ checked: [1,3] //Set the checked item, which starts with number 1.
+ });
+ $(".checkbox-demo").click(function() {
+ console.log($(".selector").checkboxFlat("value")); //Get value of the checked checkbox.
+ });
+ $(".text-demo").textboxFlat({
+ hint: "hint"
+ });
+ $(".text-demo").css({
+ "height": "30px",
+ "width": "200px"
+ });
+ $(".button-demo").buttonFlat();
+ });
+ </script>
+ </body>
+</html>
\ No newline at end of file
--
2.1.0
9 years, 10 months
[PATCH V2] UI: Sample of menu/button/radio/checkbox/seletmenu/textbox
by Wen Wang
V1 -> V2:
Add lincense.
Signed-off-by: Wen Wang <wenwang(a)linux.vnet.ibm.com>
---
...u-button-radio-checkbox-text-select-sample.html | 101 +++++++++++++++++++++
1 file changed, 101 insertions(+)
create mode 100644 ui/js/widgets/samples/menu-button-radio-checkbox-text-select-sample.html
diff --git a/ui/js/widgets/samples/menu-button-radio-checkbox-text-select-sample.html b/ui/js/widgets/samples/menu-button-radio-checkbox-text-select-sample.html
new file mode 100644
index 0000000..2b97073
--- /dev/null
+++ b/ui/js/widgets/samples/menu-button-radio-checkbox-text-select-sample.html
@@ -0,0 +1,101 @@
+<!--
+/*
+ * Project Kimchi
+ *
+ * Copyright IBM, Corp. 2014
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+-->
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <title>Demo</title>
+ <script src="../../../libs/jquery-1.10.0.min.js"></script>
+ <script src="../../../libs/jquery-ui.min.js"></script>
+ <script src="../menu-flat.js"></script>
+ <script src="../button-flat.js"></script>
+ <script src="../radio-flat.js"></script>
+ <script src="../checkbox-flat.js"></script>
+ <script src="../textbox-flat.js"></script>
+ <script src="../selectmenu-flat.js"></script>
+ <link rel="stylesheet" href="../../../libs/themes/base/jquery-ui.min.css">
+ <link rel="stylesheet" href="../../../css/theme-default/menu-flat.css">
+ <link rel="stylesheet" href="../../../css/theme-default/button-flat.css">
+ <link rel="stylesheet" href="../../../css/theme-default/radio-flat.css">
+ <link rel="stylesheet" href="../../../css/theme-default/checkbox-flat.css">
+ <link rel="stylesheet" href="../../../css/theme-default/textbox-flat.css">
+ <link rel="stylesheet" href="../../../css/theme-default/selectmenu-flat.css">
+ <link rel="stylesheet" href="../../../css/fontello/css/animation.css">
+ <link rel="stylesheet" href="../../../css/fontello/css/fontello.css">
+ </head>
+ <body>
+ <div id="menu"></div>
+ <div style="height:50px"><div id="select"></div></div>
+ <div class="radio-demo"></div>
+ <div class="checkbox-demo"></div>
+ <input class="text-demo">
+ <button class="button-demo">submit</button>
+ <script>
+ $(document).ready(function() {
+ $("#menu").menuFlat({
+ content: [1,2,3,4,5,6], //Set content of the menu.
+ icon: "icon-edit-alt", //Set icon of the menu button.
+ listIconList: ["icon-edit-alt","icon-edit-alt","icon-edit-alt","icon-edit-alt","icon-edit-alt","icon-user"]
+ //Set icons of the menu list.
+ // name is optional which set the name of the menu list.
+ });
+ $("#menu0").on("click", function() {
+ alert("hello");
+ });
+ $("#menu1").on("click", function() {
+ console.log("hello");
+ });
+ $("#select").selectmenuFlat({
+ content: [1,2,3,4,5,6], //Set content of the select menu
+ selected: 2 // set the selected option, starts from "1"
+ });
+ $("#select").selectmenuFlat("value", "4"); //Set value.
+ var t = $("#select").selectmenuFlat("value"); //Get value
+ console.log(t);
+ $(".radio-demo").radioFlat({
+ id: "t", //Base id of the radio set.
+ name: "test", //name of the radio.
+ whichChecked: 2, //First selected position, starts from 1.
+ content: ["apple", "banana", "orange", "cherry"] //set the content array.
+ });
+ $(".radio-demo").click(function() {
+ console.log($(".radio-demo").radioFlat("value")); //this is how to get the value of selected radio value
+ });
+ $(".checkbox-demo").checkboxFlat({
+ id: "t", //Checkbox base id.
+ name: "test", //Checkbox name.
+ content: ["apple", "banana", "orange", "cherry"], //Contents of the checkbox set.
+ checked: [1,3] //Set the checked item, which starts with number 1.
+ });
+ $(".checkbox-demo").click(function() {
+ console.log($(".selector").checkboxFlat("value")); //Get value of the checked checkbox.
+ });
+ $(".text-demo").textboxFlat({
+ hint: "hint"
+ });
+ $(".text-demo").css({
+ "height": "30px",
+ "width": "200px"
+ });
+ $(".button-demo").buttonFlat();
+ });
+ </script>
+ </body>
+</html>
\ No newline at end of file
--
2.1.0
9 years, 10 months
[kimchi-devel][RFC] Snapshot mockmodel tests fail for RHEL7 and fedora20
by Royce Lv
Latest added snapshots mockmodel tests fails at RHEL7 and fedora20
because libvirt test model lacks of related support:
======================================================================
ERROR: test_vm_lifecycle (test_rest.RestTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "test_rest.py", line 92, in setUp
model.reset()
File "/home/royce/kimchi-2/kimchi/src/kimchi/mockmodel.py", line 133,
in reset
getattr(self, '%s_delete' % res[:-1])(i)
File "/home/royce/kimchi-2/kimchi/src/kimchi/model/vms.py", line 847,
in delete
snapshot_names = self.vmsnapshots.get_list(name)
File "/home/royce/kimchi-2/kimchi/src/kimchi/model/vmsnapshots.py",
line 117, in get_list
{'vm': vm_name, 'err': e.message})
OperationFailed: KCHSNAP0005E: Unable to list snapshots on virtual
machine 'kimchi-test'. Details: this function is not supported by the
connection driver: virDomainListAllSnapshots
I suggest probe the libvirt version or add feature probe as we do for
qemu stream to make sure tests run well on these systems.
9 years, 10 months
[PATCH] UI: Adding new textbox widget to new kimchi UI
by Wen Wang
Signed-off-by: Wen Wang <wenwang(a)linux.vnet.ibm.com>
---
ui/css/theme-default/textbox-flat.css | 22 ++++++++++++++++++++
ui/js/widgets/textbox-flat.js | 39 +++++++++++++++++++++++++++++++++++
2 files changed, 61 insertions(+)
create mode 100644 ui/css/theme-default/textbox-flat.css
create mode 100644 ui/js/widgets/textbox-flat.js
diff --git a/ui/css/theme-default/textbox-flat.css b/ui/css/theme-default/textbox-flat.css
new file mode 100644
index 0000000..39d5ffb
--- /dev/null
+++ b/ui/css/theme-default/textbox-flat.css
@@ -0,0 +1,22 @@
+/*
+ * Project Kimchi
+ *
+ * Copyright IBM, Corp. 2015
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ .textbox-container {
+ border: 1px solid #CCC;
+ border-radius: 3px;
+ }
\ No newline at end of file
diff --git a/ui/js/widgets/textbox-flat.js b/ui/js/widgets/textbox-flat.js
new file mode 100644
index 0000000..80192ef
--- /dev/null
+++ b/ui/js/widgets/textbox-flat.js
@@ -0,0 +1,39 @@
+/*
+ * Project Kimchi
+ *
+ * Copyright IBM, Corp. 2015
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+// How to use:
+// $(".selector").textboxFlat({
+// hint: "hint"
+// });
+
+ (function($) {
+ $.widget("kimchi.textboxFlat", {
+ optons: {
+ hint: ""
+ },
+
+ _create: function() {
+ this.element.addClass("textbox-container");
+ this.element.attr("placeholder", this.options.hint);
+ },
+
+ destroy:function() {
+ this.element.remove();
+ }
+ });
+ })(jQuery);
\ No newline at end of file
--
2.1.0
9 years, 10 months
[PATCH] UI: Adding new radio widget of new kimchi UI
by Wen Wang
Signed-off-by: Wen Wang <wenwang(a)linux.vnet.ibm.com>
---
ui/css/theme-default/radio-flat.css | 30 +++++++++++++
ui/js/widgets/radio-flat.js | 86 +++++++++++++++++++++++++++++++++++++
2 files changed, 116 insertions(+)
create mode 100644 ui/css/theme-default/radio-flat.css
create mode 100644 ui/js/widgets/radio-flat.js
diff --git a/ui/css/theme-default/radio-flat.css b/ui/css/theme-default/radio-flat.css
new file mode 100644
index 0000000..0c03485
--- /dev/null
+++ b/ui/css/theme-default/radio-flat.css
@@ -0,0 +1,30 @@
+/*
+ * Project Kimchi
+ *
+ * Copyright IBM, Corp. 2015
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+ .radio-label {
+ position: relative;
+ cursor: pointer;
+ }
+
+ .radio-content {
+ margin-right: 10px;
+ }
+
+ .inline-radio {
+ display: inline-block;
+ }
\ No newline at end of file
diff --git a/ui/js/widgets/radio-flat.js b/ui/js/widgets/radio-flat.js
new file mode 100644
index 0000000..7be55f7
--- /dev/null
+++ b/ui/js/widgets/radio-flat.js
@@ -0,0 +1,86 @@
+/*
+ * Project Kimchi
+ *
+ * Copyright IBM, Corp. 2015
+ *
+ * Licensed under the Apache License, Version 2.0 (the 'License');
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an 'AS IS' BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * //How to use:
+ * $(".selector").radioFlat({
+ * id: "t", //Base id of the radio set.
+ * name: "test", //name of the radio.
+ * whichChecked: 2, //First selected position, starts from 1.
+ * content: ["apple", "banana", "orange", "cherry"] //set the content array.
+ * });
+ *
+ *
+ * $(".test-bar").click(function() {
+ * console.log($(".test-bar").radioFlat("value")); //this is how to get the value of selected radio value
+ * });
+ *
+ *
+ *
+ */
+
+ (function($) {
+
+ $.widget("kimchi.radioFlat", {
+ options: {
+ id: "",
+ name: "",
+ whichChecked: "",
+ content:[],
+ },
+
+ _create: function() {
+ var that = this;
+ var radioName = this.options.name;
+ var labelID = this.options.id;
+ var checked = this.options.whichChecked;
+ var num = Number(this.options.content.length);
+ var html ="";
+ if(num >0) {
+ for(var i=1;i < num+1;i++) {
+ var tmpLabelID = labelID + i;
+ html += "<div class='icon-circle-empty inline-radio radio-label' id='" + tmpLabelID + "'></div>" +
+ "<label class='radio-content inline-radio' for='" + tmpLabelID + "'>" + that.options.content[i-1] + "</label>";
+ }
+ $(html).appendTo(that.element);
+ $("#" + labelID + checked).attr("checked", "true");
+ $("#" + labelID + checked).removeClass("icon-circle-empty");
+ $("#" + labelID + checked).addClass("icon-dot-circled");
+ }
+ $(".radio-label").on("click", function() {
+ $(".radio-label").removeClass("icon-dot-circled");
+ $(".radio-label").addClass("icon-circle-empty");
+ $(".radio-label").removeAttr("checked");
+ $(this).removeClass("icon-circle-empty");
+ $(this).addClass("icon-dot-circled");
+ $(this).attr("checked", "true");
+ var thisID = $(this).attr("id");
+ that.options.whichChecked = thisID.substring(labelID.length,thisID.length);
+ });
+ },
+
+ value: function() {
+ var value = Number(this.options.whichChecked) -1;
+ return this.options.content[value];
+ },
+
+ _destroy: function() {
+ this.element.remove();
+ }
+ });
+ })(jQuery);
\ No newline at end of file
--
2.1.0
9 years, 10 months
[PATCH] UI: Sample of dialog widget
by Wen Wang
Signed-off-by: Wen Wang <wenwang(a)linux.vnet.ibm.com>
---
ui/js/widgets/samples/dialog-sample.html | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
create mode 100644 ui/js/widgets/samples/dialog-sample.html
diff --git a/ui/js/widgets/samples/dialog-sample.html b/ui/js/widgets/samples/dialog-sample.html
new file mode 100644
index 0000000..65b77fb
--- /dev/null
+++ b/ui/js/widgets/samples/dialog-sample.html
@@ -0,0 +1,32 @@
+<!--Sample code of dialog-->
+<!DOCTYPE html>
+<html>
+ <head>
+ <meta charset="UTF-8">
+ <title>Dialog Demo</title>
+ <script src="../../../libs/jquery-1.10.0.min.js"></script>
+ <script src="../../../libs/jquery-ui.min.js"></script>
+ <script src="../dialog-flat.js"></script>
+ <link rel="stylesheet" href="../../../libs/themes/base/jquery-ui.min.css">
+ <link rel="stylesheet" href="../../../css/theme-default/dialog-flat.css">
+ <link rel="stylesheet" href="../../../css/fontello/css/animation.css">
+ <link rel="stylesheet" href="../../../css/fontello/css/fontello.css">
+ </head>
+ <body>
+ <div class="dialog-demo"></div>
+ <script>
+ $(document).ready(function() {
+ $(".dialog-demo").dialogFlat({
+ title: "Demo", //Title of the dialog.
+ confirmText: "Ok", //Text of the confirm button, "Ok" is the default value.
+ cancelText: "Cancel", //Text of the cancel button.
+ width: "600", //Width of the dialog, "px" is the default unit.
+ height: "500", //Height of the dialog, "px" is the default unit.
+ confirmFunc: function() {
+ alert("success");//Function after confirm
+ }
+ });
+ });
+ </script>
+ </body>
+</html>
\ No newline at end of file
--
2.1.0
9 years, 10 months