[PATCH V2 0/2] let session expire when request access periodically
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
V1 -> V2
Address ming's comment, raise 403 http error when expire.
Send UI patch.
UI still need to improve as Adam king said.
Hong Liang will improve it.
ShaoHe Feng (2):
auth enhancement: expire the session when the request access
periodically
UI: set kimchi robot header for some request.
src/kimchi/auth.py | 13 +++++++++++++
ui/js/src/kimchi.api.js | 2 ++
2 files changed, 15 insertions(+)
--
1.8.4.2
10 years, 9 months
[PATCH v2 1/2] Add static directory configurations for plugin's ui
by Mark Wu
Plugin needs static directory configuration for ui requirements,
such as css, js, etc, as what we do for kimchi base. So this
patch refactors the server configuration to make plugin can share
the same code with kimchi. To avoid the warning messages reported from
cherrypy's path checker, it also adds empty ui directory for the
sample plugin, which also can demonstrate plugin's ui directory
sturcture. We can add actual ui files under those direcotries later.
Signed-off-by: Mark Wu <wudxw(a)linux.vnet.ibm.com>
---
plugins/sample/ui/css/.gitignore | 0
plugins/sample/ui/images/.gitignore | 0
plugins/sample/ui/js/.gitignore | 0
plugins/sample/ui/libs/.gitignore | 0
src/kimchi/config.py.in | 79 +++++++++++++++++++++++++++++++++++++
src/kimchi/server.py | 77 ++----------------------------------
6 files changed, 82 insertions(+), 74 deletions(-)
create mode 100644 plugins/sample/ui/css/.gitignore
create mode 100644 plugins/sample/ui/images/.gitignore
create mode 100644 plugins/sample/ui/js/.gitignore
create mode 100644 plugins/sample/ui/libs/.gitignore
diff --git a/plugins/sample/ui/css/.gitignore b/plugins/sample/ui/css/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/plugins/sample/ui/images/.gitignore b/plugins/sample/ui/images/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/plugins/sample/ui/js/.gitignore b/plugins/sample/ui/js/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/plugins/sample/ui/libs/.gitignore b/plugins/sample/ui/libs/.gitignore
new file mode 100644
index 0000000..e69de29
diff --git a/src/kimchi/config.py.in b/src/kimchi/config.py.in
index 2747164..f86ac57 100644
--- a/src/kimchi/config.py.in
+++ b/src/kimchi/config.py.in
@@ -127,6 +127,85 @@ class PluginPaths(Paths):
self.conf_file = os.path.join(self.conf_dir, '%s.conf' % name)
+class UIConfig(dict):
+
+ # expires is one year.
+ CACHEEXPIRES = 31536000
+
+ def __init__(self, paths):
+ ui_configs = {}
+ for sub_dir in ('css', 'js', 'libs', 'images'):
+ ui_configs['/' + sub_dir] = {
+ 'tools.staticdir.on': True,
+ 'tools.staticdir.dir': os.path.join(paths.ui_dir, sub_dir),
+ 'tools.nocache.on': False}
+ if sub_dir != 'images':
+ ui_configs['/' + sub_dir].update({
+ 'tools.expires.on': True,
+ 'tools.expires.secs': self.CACHEEXPIRES})
+ self.update(ui_configs)
+
+
+class KimchiConfig(dict):
+ kimchi_config = {
+ '/': {'tools.trailing_slash.on': False,
+ 'request.methods_with_bodies': ('POST', 'PUT'),
+ 'tools.nocache.on': True,
+ 'tools.sessions.on': True,
+ 'tools.sessions.name': 'kimchi',
+ 'tools.sessions.httponly': True,
+ 'tools.sessions.locking': 'explicit',
+ 'tools.sessions.storage_type': 'ram',
+ 'tools.kimchiauth.on': False},
+ '/data/screenshots': {
+ 'tools.staticdir.on': True,
+ 'tools.staticdir.dir': get_screenshot_path(),
+ 'tools.nocache.on': False
+ },
+ '/data/debugreports': {
+ 'tools.staticdir.on': True,
+ 'tools.staticdir.dir': get_debugreports_path(),
+ 'tools.nocache.on': False,
+ 'tools.kimchiauth.on': True,
+ 'tools.staticdir.content_types': {'xz': 'application/x-xz'}
+ },
+ '/config/ui/tabs.xml': {
+ 'tools.staticfile.on': True,
+ 'tools.staticfile.filename': '%s/config/ui/tabs.xml' %
+ paths.prefix,
+ 'tools.nocache.on': True
+ },
+ '/favicon.ico': {
+ 'tools.staticfile.on': True,
+ 'tools.staticfile.filename': '%s/images/logo.ico' % paths.ui_dir
+ },
+ '/help': {
+ 'tools.staticdir.on': True,
+ 'tools.staticdir.dir': '%s/ui/pages/help' % paths.prefix,
+ 'tools.nocache.on': False
+ }
+ }
+
+ def __init__(self):
+ super(KimchiConfig, self).__init__(self)
+ self.update(self.kimchi_config)
+ self.update(UIConfig(paths))
+
+
+class PluginConfig(dict):
+ def __init__(self, plugin_name):
+ super(PluginConfig, self).__init__(self)
+ plugin_config = {
+ '/ui/config/tab-ext.xml': {
+ 'tools.staticfile.on': True,
+ 'tools.staticfile.filename':
+ os.path.join(PluginPaths(plugin_name).ui_dir,
+ 'config/tab-ext.xml'),
+ 'tools.nocache.on': True}}
+ self.update(plugin_config)
+ self.update(UIConfig(PluginPaths(plugin_name)))
+
+
def _get_config():
config = SafeConfigParser()
config.add_section("server")
diff --git a/src/kimchi/server.py b/src/kimchi/server.py
index 5475b92..0d02868 100644
--- a/src/kimchi/server.py
+++ b/src/kimchi/server.py
@@ -29,7 +29,7 @@ from kimchi import config
from kimchi.model import model
from kimchi import mockmodel
from kimchi import vnc
-from kimchi.config import paths, PluginPaths
+from kimchi.config import paths, KimchiConfig, PluginConfig
from kimchi.control import sub_nodes
from kimchi.root import KimchiRoot
from kimchi.utils import get_enabled_plugins, import_class
@@ -57,73 +57,6 @@ def set_no_cache():
class Server(object):
- # expires is one year.
- CACHEEXPIRES = 31536000
- configObj = {
- '/': {'tools.trailing_slash.on': False,
- 'request.methods_with_bodies': ('POST', 'PUT'),
- 'tools.nocache.on': True,
- 'tools.sessions.on': True,
- 'tools.sessions.name': 'kimchi',
- 'tools.sessions.httponly': True,
- 'tools.sessions.locking': 'explicit',
- 'tools.sessions.storage_type': 'ram',
- 'tools.kimchiauth.on': False},
- '/css': {
- 'tools.staticdir.on': True,
- 'tools.staticdir.dir': '%s/ui/css' % paths.prefix,
- 'tools.expires.on': True,
- 'tools.expires.secs': CACHEEXPIRES,
- 'tools.nocache.on': False
- },
- '/js': {
- 'tools.staticdir.on': True,
- 'tools.staticdir.dir': '%s/ui/js' % paths.prefix,
- 'tools.expires.on': True,
- 'tools.expires.secs': CACHEEXPIRES,
- 'tools.nocache.on': False
- },
- '/libs': {
- 'tools.staticdir.on': True,
- 'tools.staticdir.dir': '%s/ui/libs' % paths.prefix,
- 'tools.expires.on': True,
- 'tools.expires.secs': CACHEEXPIRES,
- 'tools.nocache.on': False,
- },
- '/images': {
- 'tools.staticdir.on': True,
- 'tools.staticdir.dir': '%s/ui/images' % paths.prefix,
- 'tools.nocache.on': False
- },
- '/data/screenshots': {
- 'tools.staticdir.on': True,
- 'tools.staticdir.dir': config.get_screenshot_path(),
- 'tools.nocache.on': False
- },
- '/data/debugreports': {
- 'tools.staticdir.on': True,
- 'tools.staticdir.dir': config.get_debugreports_path(),
- 'tools.nocache.on': False,
- 'tools.kimchiauth.on': True,
- 'tools.staticdir.content_types': {'xz': 'application/x-xz'}
- },
- '/config/ui/tabs.xml': {
- 'tools.staticfile.on': True,
- 'tools.staticfile.filename': '%s/config/ui/tabs.xml' %
- paths.prefix,
- 'tools.nocache.on': True
- },
- '/favicon.ico': {
- 'tools.staticfile.on': True,
- 'tools.staticfile.filename': '%s/images/logo.ico' % paths.ui_dir
- },
- '/help': {
- 'tools.staticdir.on': True,
- 'tools.staticdir.dir': '%s/ui/pages/help' % paths.prefix,
- 'tools.nocache.on': False
- }
- }
-
def __init__(self, options):
make_dirs = [
os.path.dirname(os.path.abspath(options.access_log)),
@@ -137,6 +70,7 @@ class Server(object):
if not os.path.isdir(directory):
os.makedirs(directory)
+ self.configObj = KimchiConfig()
cherrypy.tools.nocache = cherrypy.Tool('on_end_resource', set_no_cache)
cherrypy.tools.kimchiauth = cherrypy.Tool('before_handler',
auth.kimchiauth)
@@ -214,12 +148,7 @@ class Server(object):
script_name = plugin_config['kimchi']['uri']
del plugin_config['kimchi']
- plugin_config['/ui/config/tab-ext.xml'] = {
- 'tools.staticfile.on': True,
- 'tools.staticfile.filename':
- os.path.join(PluginPaths(plugin_name).ui_dir,
- 'config/tab-ext.xml'),
- 'tools.nocache.on': True}
+ plugin_config.update(PluginConfig(plugin_name))
except KeyError:
continue
--
1.8.4.2
10 years, 9 months
[PATCHv5 0/6] Add volume reference count
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
tested:
1. sudo make check
2. from UI: list storage volumes and unrefered volume ref_cnt is 0,
ref_cnt for refered ones are 1.
Available volumes will be tracked by volume reference count.
Add this field to storage volume,
so that storage volume/pool action validation can rely on it.
Royce Lv (6):
Fix vm disk path when it does not have source element
Add volume ref_cnt: update api.md
Add volume ref_cnt: Update controller and json schema
Add volume ref_cnt: Add model and mockmodel implementation
Add volume ref_cnt: Update test
Multiple pep8 fixes
docs/API.md | 3 +++
src/kimchi/API.json | 25 +++++++++++++++++++++++++
src/kimchi/control/storagevolumes.py | 1 +
src/kimchi/i18n.py | 4 ++++
src/kimchi/isoinfo.py | 4 ++--
src/kimchi/mockmodel.py | 10 +++++++---
src/kimchi/model/debugreports.py | 2 +-
src/kimchi/model/storageservers.py | 4 ++--
src/kimchi/model/storagevolumes.py | 32 ++++++++++++++++++++++++++++++++
src/kimchi/model/templates.py | 2 +-
src/kimchi/model/vmstorages.py | 23 +++++++++++++----------
tests/test_model.py | 10 +++++++---
tests/test_rest.py | 2 ++
13 files changed, 100 insertions(+), 22 deletions(-)
--
1.8.1.2
10 years, 9 months
[PATCH] Added help for host and network tab. Edited help for guests, storage, and templates tab. Signed-off-by: Kersten Richter <kersten@us.ibm.com>
by Kersten Richter
---
ui/pages/help/guests.dita | 146 +++++++++++++++++++++++-----------
ui/pages/help/host.dita | 51 ++++++++++++
ui/pages/help/network.dita | 68 ++++++++++++++++
ui/pages/help/storage.dita | 135 +++++++++++++++++++++-----------
ui/pages/help/templates.dita | 179 ++++++++++++++++++++++++++++--------------
5 files changed, 428 insertions(+), 151 deletions(-)
create mode 100644 ui/pages/help/host.dita
create mode 100644 ui/pages/help/network.dita
diff --git a/ui/pages/help/guests.dita b/ui/pages/help/guests.dita
index cc6294c..bae98bb 100644
--- a/ui/pages/help/guests.dita
+++ b/ui/pages/help/guests.dita
@@ -1,47 +1,99 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?Pub Sty _display FontColor="red"?>
-<?Pub Inc?>
-<cshelp id="kimhvirtm" xml:lang="en-us">
- <title>Virtual machines</title>
- <shortdesc>The Virtual machines page lists the defined KVM virtual
-machines.</shortdesc>
- <csprolog>
- <csmetadata>
- <cswindowtitle>Title of window or panel associated with this help;
-for review output only.</cswindowtitle>
- <cswidgetlabel>Name of field or control associated with this help;
-for review output only</cswidgetlabel>
- </csmetadata>
- </csprolog>
- <csbody>
- <p>For each virtual machine, the following information is displayed:<dl><dlentry><dt>Name</dt><dd>Name of the virtual machine.</dd></dlentry><dlentry><dt>CPU</dt><dd>Percentage of processor utilization in the virtual machine.</dd></dlentry><dlentry><dt>Network I/O</dt><dd>Network input/output transmission rate in KB per seconds.</dd></dlentry><dlentry><dt>Disk I/O</dt><dd> Disk input/output transmission rate in KB per seconds.</dd></dlentry><dlentry><dt>Console</dt><dd>Current state of guest operating system console.</dd></dlentry></dl></p>
- <p>The following actions icons are displayed for each virtual machine:<dl><dlentry><dt>Reload</dt><dd>Click to reload the displayed data. </dd></dlentry><dlentry><dt>Power</dt><dd>Click to power on the virtual machine. If the icon is red, the
-power is off; if the icon is green, the power is on.</dd></dlentry></dl> </p>
- <p>The following actions can be selected for each virtual machine:<ul><li>Select <uicontrol>VNC</uicontrol> to connect to the remote console
-for the virtual machine.</li><li>Select <uicontrol>Delete</uicontrol> to delete the virtual machine.</li></ul>To create a virtual machine, click the <uicontrol>plus (+)</uicontrol> icon
-in the upper right of the page.</p>
- </csbody>
- <cshelp id="kimhvirtmcrt" xml:lang="en-us">
- <title>Create virtual machine</title>
- <shortdesc>Create a virtual machine using an existing template.</shortdesc>
- <csprolog>
- <csmetadata>
- <cswindowtitle>Title of window or panel associated with this help;
-for review output only.</cswindowtitle>
- <cswidgetlabel>Name of field or control associated with this help;
-for review output only</cswidgetlabel>
- </csmetadata>
- </csprolog>
- <csbody>
- <p>
- <ol>
- <li>Type the name to be used to identify the virtual machine.</li>
- <li>Click to select a template.</li>
- <li>Click <uicontrol>Create</uicontrol>.</li>
- </ol>
- </p>
- </csbody>
- </cshelp>
- <?Pub Caret -1?>
-</cshelp>
-<?Pub *0000002746?>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Arbortext, Inc., 1988-2011, v.4002-->
+<!DOCTYPE cshelp PUBLIC "-//IBM//DTD DITA CSHelp//EN"
+ "..\dtd\cshelp.dtd">
+<?Pub Sty _display FontColor="red"?>
+<?Pub Inc?>
+<!--This DITA specialized document type is not supported by the Authoring Tools development team.
+For support please see:
+https://w3.opensource.ibm.com/projects/dita-cshelp/-->
+<cshelp id="kimhvirtm" xml:lang="en-us">
+<title>Guests</title>
+<shortdesc>The <wintitle>Guests</wintitle> page lists the defined
+KVM virtual machines.</shortdesc>
+<csbody>
+<p>For each guest, the following information is displayed:<dl><dlentry>
+<dt>Name</dt>
+<dd>Name of the virtual machine.</dd>
+</dlentry><dlentry>
+<dt>CPU</dt>
+<dd>Percentage of processor utilization in the virtual machine.</dd>
+</dlentry><dlentry>
+<dt>Network I/O</dt>
+<dd>Network input/output transmission rate in KB per seconds.</dd>
+</dlentry><dlentry>
+<dt>Disk I/O</dt>
+<dd> Disk input/output transmission rate in KB per seconds.</dd>
+</dlentry><dlentry>
+<dt>Livetile</dt>
+<dd rev="rev1">State of guest operating system console, or an icon
+that represents the <tm tmtype="tm" trademark="Linux">Linux</tm> distribution
+if the guest is not active.</dd>
+</dlentry></dl></p>
+<p>The following actions icons are displayed for each guest:<dl>
+<dlentry>
+<dt rev="rev1">Reset</dt>
+<dd rev="rev1">Click to reset the guest. </dd>
+</dlentry><dlentry>
+<dt><tm tmclass="IGNORE" tmtype="reg" trademark="Power">Power</tm> (Start
+or Stop)</dt>
+<dd>Click to power on or power off the guest. If the icon is red,
+the power is off; if the icon is green, the power is on.</dd>
+</dlentry></dl> </p>
+<p>The following actions can be selected for each guest:<ul>
+<li>Select <uicontrol>VNC</uicontrol> to connect to the remote console
+for the guest operating system.</li>
+<li>Select <uicontrol>Edit</uicontrol> to edit the properties of an
+existing guest. Guests can be edited only while stopped.</li>
+<li>Select <uicontrol>Delete</uicontrol> to delete the guest.</li>
+</ul>To create a guest, or virtual machine, click the <uicontrol>plus
+(+)</uicontrol> icon in the upper right of the page.</p>
+</csbody>
+<cshelp id="kimhvirtmcrt" xml:lang="en-us">
+<title>Create virtual machine</title>
+<shortdesc>Create a virtual machine by using an existing template.</shortdesc>
+<csbody>
+<p> <ol>
+<li>Type the name to be used to identify the virtual machine.</li>
+<li rev="rev1">Select a template. <ul>
+<li>If templates exist, select from displayed templates.</li>
+<li>If no templates exist, click <uicontrol>Create a template</uicontrol> to
+create a template.</li>
+</ul></li>
+<li>Click <uicontrol>Create</uicontrol>.</li>
+</ol> </p>
+</csbody>
+</cshelp>
+<cshelp id="kimhvirtmedit" xml:lang="en-us">
+<title>Edit guest</title>
+<shortdesc rev="rev1">Edit the properties of an existing virtual machine.
+Guests can be edited only while stopped.</shortdesc>
+<csprolog><csmetadata>
+<cswindowtitle>Title of window or panel associated with this help;
+for review output only.</cswindowtitle>
+<cswidgetlabel>Name of field or control associated with this help;
+for review output only</cswidgetlabel>
+</csmetadata></csprolog>
+<csbody>
+<p>For each guest, the following information is displayed:<dl><dlentry>
+<dt>Name</dt>
+<dd>Name of the virtual machine.</dd>
+</dlentry><dlentry>
+<dt>CPUs</dt>
+<dd>Number of processors.</dd>
+</dlentry><dlentry>
+<dt>Memory</dt>
+<dd>Amount of memory in MB.</dd>
+</dlentry><dlentry>
+<dt>Icon</dt>
+<dd rev="rev2"> Graphic image representing the Linux distribution
+to be displayed in place of current status (Livetile) when the guest
+is not active.</dd>
+</dlentry></dl></p>
+<p> Fields that are not disabled can be edited. After you edit a field,
+click <uicontrol>Save</uicontrol>. </p>
+</csbody>
+</cshelp><?Pub Caret -1?>
+<?tm 1391540919 3?>
+</cshelp>
+<?Pub *0000003805?>
diff --git a/ui/pages/help/host.dita b/ui/pages/help/host.dita
new file mode 100644
index 0000000..d961edc
--- /dev/null
+++ b/ui/pages/help/host.dita
@@ -0,0 +1,51 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Arbortext, Inc., 1988-2011, v.4002-->
+<!DOCTYPE cshelp PUBLIC "-//IBM//DTD DITA CSHelp//EN"
+ "..\dtd\cshelp.dtd">
+<?Pub Sty _display FontColor="red"?>
+<?Pub Inc?>
+<!--This DITA specialized document type is not supported by the Authoring Tools development team.
+For support please see:
+https://w3.opensource.ibm.com/projects/dita-cshelp/-->
+<cshelp id="kimhhost" xml:lang="en-us">
+<title>Host</title>
+<shortdesc rev="rev1">The <wintitle>Host</wintitle> page shows information
+about the host system, and allows you to shut down, restart, and connect
+to the host.</shortdesc>
+<csbody>
+<p>You can perform the following actions on the host:<ul>
+<li>Select <uicontrol>Shut down</uicontrol> to shut down the host
+system.</li>
+<li>Select <uicontrol>Restart</uicontrol> to restart the host system.</li>
+<li rev="rev1">Select <uicontrol>Connect</uicontrol> to open a VNC
+connection to the host system, if it is not already connected.</li>
+</ul></p>
+<p>Click the following sections to display information about the host:<dl>
+<dlentry>
+<dt>Basic information</dt>
+<dd>This section displays the host operating system distribution,
+version, and code name, as well as the processor type and amount of
+memory in GB.</dd>
+</dlentry><dlentry>
+<dt>System statistics</dt>
+<dd rev="rev1">This section displays graphs to show statistics for
+CPU, memory, disk I/O, and network I/O for the host. Select <uicontrol>Collecting
+data after leaving this page</uicontrol> to continue collecting data
+when the host tab is out of view.</dd>
+</dlentry><dlentry>
+<dt>Debug reports</dt>
+<dd rev="rev1">This section displays debug reports, including name
+and file path. You can select from options to generate a new report,
+or rename, remove, or download an existing report.<p>The debug report
+is generated using the <cmdname>sosreport</cmdname> command. It is
+available for Red Hat Enterprise <tm tmtype="tm" trademark="Linux">Linux</tm>,
+Fedora, and Ubuntu distributions. The command generates a .tar file
+that contains configuration and diagnostic information, such as the
+running kernel version, loaded modules, and system and service configuration
+files. The command also runs external programs to collect further
+information and stores this output in the resulting archive.</p> </dd>
+</dlentry></dl></p>
+</csbody><?Pub Caret -2?>
+<?tm 1392659967 1?>
+</cshelp>
+<?Pub *0000002392?>
diff --git a/ui/pages/help/network.dita b/ui/pages/help/network.dita
new file mode 100644
index 0000000..4846d5b
--- /dev/null
+++ b/ui/pages/help/network.dita
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Arbortext, Inc., 1988-2011, v.4002-->
+<!DOCTYPE cshelp PUBLIC "-//IBM//DTD DITA CSHelp//EN"
+ "..\dtd\cshelp.dtd">
+<?Pub Sty _display FontColor="red"?>
+<?Pub Inc?>
+<!--This DITA specialized document type is not supported by the Authoring Tools development team.
+For support please see:
+https://w3.opensource.ibm.com/projects/dita-cshelp/-->
+<cshelp id="kimhnetw" xml:lang="en-us">
+<title>Network</title>
+<shortdesc>The <wintitle>Network</wintitle> page displays information
+about the network connection.</shortdesc>
+<csbody>
+<p><dl><dlentry>
+<dt>Network Name</dt>
+<dd>Name of the network, or <uicontrol>default</uicontrol>.</dd>
+</dlentry><dlentry>
+<dt>State</dt>
+<dd>State of the network, active (green) or inactive (red). </dd>
+</dlentry><dlentry>
+<dt>Network type</dt>
+<dd>Network type, for example, <uicontrol>NAT</uicontrol> (network
+address translation).</dd>
+</dlentry><dlentry>
+<dt>Interface</dt>
+<dd>Network interface, for example, <uicontrol>virbr0</uicontrol> (default).</dd>
+</dlentry><dlentry>
+<dt>Address space</dt>
+<dd>IP address.</dd>
+</dlentry></dl></p>
+<p>The following actions can be selected:<ul>
+<li rev="rev1">Select <uicontrol>Start</uicontrol> to begin the network
+connection.</li>
+<li>Select <uicontrol>Stop</uicontrol> to end the network connection.</li>
+<li>Select <uicontrol>Delete</uicontrol> to delete the connection
+information.</li>
+</ul>To create a network, click the <uicontrol>plus (+)</uicontrol> icon
+in the upper right of the display.</p>
+</csbody>
+<cshelp id="kimhnetwcrt" xml:lang="en-us">
+<title>Create a network</title>
+<shortdesc>Create a network.</shortdesc>
+<csbody>
+<p> <ol>
+<li>Type the name of the network.</li>
+<li>Click to select the network type. <dl rev="rev1"><dlentry>
+<dt><uicontrol>Isolated</uicontrol></dt>
+<dd>Isolated mode. Guests cannot send or receive communication to
+or from external systems.</dd>
+</dlentry><dlentry>
+<dt><uicontrol>NAT</uicontrol></dt>
+<dd>Network Address Translation mode. Communication from guests to
+external systems uses the host IP address. External systems cannot
+initiate communication to guests.</dd>
+</dlentry><dlentry>
+<dt><uicontrol>Bridged</uicontrol></dt>
+<dd>Bridged mode. Guests can communicate with external systems and
+be contacted by external systems as if they were physical systems
+on the network. For bridged mode, you must specify additional destination
+and VLAN information.</dd>
+</dlentry></dl><?Pub Caret 224?></li>
+<li>Click <uicontrol>Create</uicontrol>.</li>
+</ol> </p>
+</csbody>
+</cshelp>
+</cshelp>
+<?Pub *0000002571?>
diff --git a/ui/pages/help/storage.dita b/ui/pages/help/storage.dita
index f9ae93e..9ad0ea4 100644
--- a/ui/pages/help/storage.dita
+++ b/ui/pages/help/storage.dita
@@ -1,45 +1,90 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?xml-stylesheet href="dita.xsl" type="text/xsl" ?>
-<?Pub Sty _display FontColor="red"?>
-<?Pub Inc?>
-<cshelp id="kimhstor" xml:lang="en-us">
- <title>Storage</title>
- <shortdesc>The Storage page lists the available storage pools, including the default storage pool.</shortdesc>
- <csprolog>
- <csmetadata>
- <cswindowtitle>Title of window or panel associated with this help; for review output only.</cswindowtitle>
- <cswidgetlabel>Name of field or control associated with this help; for review output only</cswidgetlabel>
- </csmetadata>
- </csprolog>
- <csbody>
- <p>For each storage pool, the following information is displayed:<dl><dlentry><dt>Name</dt><dd>Name of the storage pool and percentage used.</dd></dlentry><dlentry><dt>State</dt><dd>State of the storage pool, active (green) or inactive (red). </dd></dlentry><dlentry><dt>Location</dt><dd>File path to the location of the storage pool.</dd></dlentry><dlentry><dt>Type</dt><dd><uicontrol>dir</uicontrol> for directory.</dd></dlentry><dlentry><dt>Capacity</dt><dd>Amount of space in the storage pool.</dd></dlentry><dlentry><dt>Allocated</dt><dd>Amount of space already allocated in the storage pool.</dd></dlentry></dl></p>
- <p>The following actions can be selected for each storage pool:<ul><li>Select <uicontrol>Activate</uicontrol> to activate the storage
-pool so that it can be used.</li><li>Select <uicontrol>Undefine</uicontrol> to remove an inactive storage
-pool.</li></ul></p>
- <p>To display storage volume details for a storage pool, click the
-arrow on the right side of the storage pool row. Details include
-the following:<dl><dlentry><dt>Type</dt><dd>The type of storage pool, for example, dir or disk.</dd></dlentry><dlentry><dt>Format</dt><dd>The format, varying dependent on the type.</dd></dlentry><dlentry><dt>Capacity</dt><dd>Size of the storage volume.</dd></dlentry><dlentry><dt>Allocated</dt><dd>Amount of space already allocated in the storage pool.</dd></dlentry></dl>To define a storage pool, click the <uicontrol>plus
-(+)</uicontrol> icon in the upper right of the display.</p>
- </csbody>
- <cshelp id="kimhdefstor" xml:lang="en-us">
- <title>Define a storage pool</title>
- <shortdesc> Define a storage pool.</shortdesc>
- <csprolog>
- <csmetadata>
- <cswindowtitle>Title of window or panel associated with this help; for review output only.</cswindowtitle>
- <cswidgetlabel>Name of field or control associated with this help; for review output only</cswidgetlabel>
- </csmetadata>
- </csprolog>
- <csbody>
- <p>
- <ol>
- <li>Type the name to be used to identify the storage pool.</li>
- <li>Type the file path to the storage pool.</li>
- <li>Click <uicontrol>Create</uicontrol>.</li>
- </ol>
- </p>
- </csbody>
- </cshelp>
- <?Pub Caret -1?>
-</cshelp>
-<?Pub *0000003013?>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Arbortext, Inc., 1988-2011, v.4002-->
+<!DOCTYPE cshelp PUBLIC "-//IBM//DTD DITA CSHelp//EN"
+ "..\dtd\cshelp.dtd">
+<?Pub Sty _display FontColor="red"?>
+<?Pub Inc?>
+<!--This DITA specialized document type is not supported by the Authoring Tools development team.
+For support please see:
+https://w3.opensource.ibm.com/projects/dita-cshelp/-->
+<cshelp id="kimhstor" xml:lang="en-us">
+<title>Storage</title>
+<shortdesc>The <wintitle>Storage</wintitle> page lists the available
+storage pools, including the default storage pool.</shortdesc>
+<csbody>
+<p>For each storage pool, the following information is displayed:<dl>
+<dlentry>
+<dt>Name</dt>
+<dd>Name of the storage pool and percentage used.</dd>
+</dlentry><dlentry>
+<dt>State</dt>
+<dd>State of the storage pool, active (green) or inactive (red). </dd>
+</dlentry><dlentry>
+<dt>Location</dt>
+<dd>File path to the location of the storage pool.</dd>
+</dlentry><dlentry>
+<dt>Type</dt>
+<dd>Type of storage pool, for example, <uicontrol>dir</uicontrol>.</dd>
+</dlentry><dlentry>
+<dt>Capacity</dt>
+<dd>Amount of space in the storage pool.</dd>
+</dlentry><dlentry>
+<dt>Allocated</dt>
+<dd>Amount of space that is already allocated in the storage pool.</dd>
+</dlentry></dl></p>
+<p>The following actions can be selected for each storage pool:<ul>
+<li>Select <uicontrol>Activate</uicontrol> to activate the storage
+pool so that it can be used.</li>
+<li>Select <uicontrol>Deactivate</uicontrol> to deactivate an active
+storage pool.</li>
+<li>Select <uicontrol>Undefine</uicontrol> to remove an inactive storage
+pool.</li>
+</ul></p>
+<p>To display storage volume details for a storage pool, click the
+arrow on the right side of the storage pool row. Details include
+the following:<dl><dlentry>
+<dt>Type</dt>
+<dd>The type of volume, for example, <uicontrol>file</uicontrol>.</dd>
+</dlentry><dlentry>
+<dt>Format</dt>
+<dd>The format, varying dependent on the type.</dd>
+</dlentry><dlentry>
+<dt>Capacity</dt>
+<dd>Size of the storage volume.</dd>
+</dlentry><dlentry>
+<dt>Allocation</dt>
+<dd>Amount of space that is already allocated in the storage pool.</dd>
+</dlentry></dl><?Pub Caret -2?>To define a storage pool, click the <uicontrol>plus
+(+)</uicontrol> icon in the upper right of the display.</p>
+</csbody>
+<cshelp id="kimhdefstor" xml:lang="en-us">
+<title>Define a storage pool</title>
+<shortdesc> Define a storage pool.</shortdesc>
+<csbody>
+<p> <ol>
+<li>In the <uicontrol>Storage pool name</uicontrol> field, type the
+name to be used to identify the storage pool.</li>
+<li>In the <uicontrol>Storage pool type</uicontrol> list, select the
+type: <dl rev="rev1"><dlentry>
+<dt><uicontrol>DIR</uicontrol></dt>
+<dd>Specifies a directory pool. When selecting <uicontrol>DIR</uicontrol>,
+type the <uicontrol>Storage path</uicontrol> (file path to the storage
+pool).</dd>
+</dlentry><dlentry>
+<dt><uicontrol>NFS</uicontrol></dt>
+<dd>Specifies a network filesystem pool. When selecting <uicontrol>NFS</uicontrol>,
+type the <uicontrol>NFS server IP</uicontrol> address and <uicontrol>NFS
+path</uicontrol> (path of the exported directory).</dd>
+</dlentry><dlentry>
+<dt><uicontrol>iSCSI</uicontrol></dt>
+<dd>Specifies a pool based on a target allocated on an iSCSI server.
+When selecting <uicontrol>iSCSI</uicontrol>, type the <uicontrol>iSCSI
+server</uicontrol> IP address and <uicontrol>Target</uicontrol> on
+the iSCSI server. You can optionally select to add iSCSI authentication.</dd>
+</dlentry></dl></li>
+<li>Click <uicontrol>Create</uicontrol>.</li>
+</ol> </p>
+</csbody>
+</cshelp>
+</cshelp>
+<?Pub *0000003580?>
diff --git a/ui/pages/help/templates.dita b/ui/pages/help/templates.dita
index 0a9bcff..5048fc8 100644
--- a/ui/pages/help/templates.dita
+++ b/ui/pages/help/templates.dita
@@ -1,59 +1,120 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?Pub Sty _display FontColor="red"?>
-<?Pub Inc?>
-<cshelp id="kimhtempl" xml:lang="en-us">
- <title>Templates</title>
- <shortdesc>The Templates page shows the defined virtual machine templates
-that can be used to create KVM virtual machines.</shortdesc>
- <csprolog>
- <csmetadata>
- <cswindowtitle>Title of window or panel associated with this help;
-for review output only.</cswindowtitle>
- <cswidgetlabel>Name of field or control associated with this help;
-for review output only</cswidgetlabel>
- </csmetadata>
- </csprolog>
- <csbody>
- <p>For each template, the following information is displayed:<dl><dlentry><dt>OS</dt><dd>Name of the operating system or distribution.</dd></dlentry><dlentry><dt>Version</dt><dd>Version of the operating system or distribution.</dd></dlentry><dlentry><dt>CPU</dt><dd>Number of processors defined for the template.</dd></dlentry><dlentry><dt>Memory</dt><dd>Amount of random access memory to be allocated, in MB.</dd></dlentry></dl></p>
- <p>The following actions can be selected for each template:<ul><li>Select <uicontrol>Edit</uicontrol> to edit the template.</li><li>Select <uicontrol>Delete</uicontrol> to delete the template.</li></ul>To add a template, click the <uicontrol>plus (+)</uicontrol> icon
-in the upper right of the display.</p>
- </csbody>
- <cshelp id="kimhedittempl" xml:lang="en-us">
- <title>Edit template</title>
- <shortdesc>Edit an existing template.</shortdesc>
- <csprolog>
- <csmetadata>
- <cswindowtitle>Title of window or panel associated with this help;
-for review output only.</cswindowtitle>
- <cswidgetlabel>Name of field or control associated with this help;
-for review output only</cswidgetlabel>
- </csmetadata>
- </csprolog>
- <csbody>
- <p><ol><li>Edit the following information for the template:<dl><dlentry><dt>Name</dt><dd>Name of the template.</dd></dlentry><dlentry><dt>CPU</dt><dd>Number of processors defined for the template.</dd></dlentry><dlentry><dt>Memory</dt><dd>Memory to be allocated to the virtual machine.</dd></dlentry></dl></li><li>Click <uicontrol>Save</uicontrol>.</li></ol>The following information is displayed but cannot be edited:<dl><dlentry><dt>Vendor</dt><dd>The name of the company that created the operating system or distribution
-that the template is configured to use.</dd></dlentry><dlentry><dt>Version</dt><dd>The version of the operating system or distribution that the template
-is configured to use.</dd></dlentry></dl></p>
- </csbody>
- </cshelp>
- <?Pub Caret -1?>
- <cshelp id="kimhaddtempl">
- <title>Add template</title>
- <shortdesc>Add a template from source media.</shortdesc>
- <csbody>
- <p>Select the location from the following options:<ol><li>Select the location of the source media from the following options:<dl><dlentry><dt>Local ISO image</dt><dd>Select to scan storage pools for installation ISO images available
-on the system.</dd></dlentry><dlentry><dt>Remote ISO image</dt><dd>Select to specify a remote location for an installation ISO image.</dd></dlentry></dl></li><li>Click <uicontrol>Create</uicontrol>.</li></ol></p>
- </csbody>
- </cshelp>
- <cshelp id="kimhaddloct">
- <title>Add template - local ISO image</title>
- <shortdesc>Add a template from a local ISO image.</shortdesc>
- <csbody>
- <p>The ISO images available on the system are displayed.<dl><dlentry><dt>OS</dt><dd>Name of the operating system or distribution.</dd></dlentry><dlentry><dt>Version</dt><dd>Version of the operating system or distribution.</dd></dlentry><dlentry><dt>Size</dt><dd>Size of the ISO image.</dd></dlentry></dl></p>
- <p>To create a template from an ISO image, complete the following
-steps:<ol><li>Choose from the following options:<ul><li>Select an ISO image from which to create a template.</li><li>Select the <uicontrol>All</uicontrol> check box to create a template
-from each listed ISO image.</li><li>Select the <uicontrol>I want to use a specific file</uicontrol> check
-box to specify a path to the ISO image.</li></ul></li><li>Click <uicontrol>Create</uicontrol>.</li></ol></p>
- </csbody>
- </cshelp>
-</cshelp>
-<?Pub *0000004376?>
+<?xml version="1.0" encoding="UTF-8"?>
+<!--Arbortext, Inc., 1988-2011, v.4002-->
+<!DOCTYPE cshelp PUBLIC "-//IBM//DTD DITA CSHelp//EN"
+ "..\dtd\cshelp.dtd">
+<?Pub Sty _display FontColor="red"?>
+<?Pub Inc?>
+<!--This DITA specialized document type is not supported by the Authoring Tools development team.
+For support please see:
+https://w3.opensource.ibm.com/projects/dita-cshelp/-->
+<cshelp id="kimhtempl" xml:lang="en-us">
+<title>Templates</title>
+<shortdesc>The <wintitle>Templates</wintitle> page shows the defined
+virtual machine templates that can be used to create KVM guests.</shortdesc>
+<csbody>
+<p>For each template, the following information is displayed:<dl>
+<dlentry>
+<dt>OS</dt>
+<dd>Name of the operating system or distribution.</dd>
+</dlentry><dlentry>
+<dt>Version</dt>
+<dd>Version of the operating system or distribution.</dd>
+</dlentry><dlentry>
+<dt>CPUs</dt>
+<dd>Number of processors that are defined for the template.</dd>
+</dlentry><dlentry>
+<dt>Memory</dt>
+<dd>Amount of random access memory to be allocated, in MB.</dd>
+</dlentry></dl></p>
+<p>The following actions can be selected for each template:<ul>
+<li>Select <uicontrol>Edit</uicontrol> to edit the template.</li>
+<li>Select <uicontrol>Delete</uicontrol> to delete the template.</li>
+</ul>To add a template, click the <uicontrol>plus (+)</uicontrol> icon
+in the upper right of the display.</p>
+</csbody>
+<cshelp id="kimhedittempl" xml:lang="en-us">
+<title>Edit template</title>
+<shortdesc>Edit an existing template.</shortdesc>
+<csbody>
+<p>For each template, the following information is displayed: <dl>
+<dlentry>
+<dt>Name</dt>
+<dd>Name of the template.</dd>
+</dlentry><dlentry>
+<dt>Vendor</dt>
+<dd>The name of the company that created the operating system or distribution
+that the template is configured to use.</dd>
+</dlentry><dlentry>
+<dt>Version</dt>
+<dd>The version of the operating system or distribution that the template
+is configured to use.</dd>
+</dlentry><dlentry>
+<dt>CPU number</dt>
+<dd>Number of processors that are defined for the template.</dd>
+</dlentry><dlentry>
+<dt>Memory</dt>
+<dd>Amount of memory in MB to be allocated to the virtual machine.</dd>
+</dlentry><dlentry>
+<dt>Disk</dt>
+<dd rev="rev1">Disk size in GB.</dd>
+</dlentry><dlentry>
+<dt>CDROM</dt>
+<dd>File path to the location of the template.</dd>
+</dlentry><dlentry>
+<dt>Storage pool</dt>
+<dd>Specific storage pool or the default storage pool.</dd>
+</dlentry><dlentry>
+<dt>Network</dt>
+<dd rev="rev1">Default network.</dd>
+</dlentry></dl><?Pub Caret 427?> Fields that are not disabled can
+be edited. After you edit a field, click <uicontrol>Save</uicontrol>. </p>
+</csbody>
+</cshelp>
+<cshelp id="kimhaddtempl">
+<title>Add template</title>
+<shortdesc>Add a template from source media.</shortdesc>
+<csbody>
+<p>Select the location of the source media from the following options:<dl>
+<dlentry>
+<dt>Local ISO image</dt>
+<dd>Select to scan storage pools for installation ISO images available
+on the system.</dd>
+</dlentry><dlentry>
+<dt>Remote ISO image</dt>
+<dd>Select to specify a remote location for an installation ISO image.</dd>
+</dlentry></dl></p>
+</csbody>
+</cshelp>
+<cshelp id="kimhaddloct">
+<title>Add template - local ISO image</title>
+<shortdesc>Add a template from a local ISO image.</shortdesc>
+<csbody>
+<p>The ISO images available on the system are displayed.<dl><dlentry>
+<dt>OS</dt>
+<dd>Name of the operating system or distribution.</dd>
+</dlentry><dlentry>
+<dt>Version</dt>
+<dd>Version of the operating system or distribution.</dd>
+</dlentry><dlentry>
+<dt>Size</dt>
+<dd>Size of the ISO image.</dd>
+</dlentry></dl></p>
+<p>To create a template from an ISO image, choose from the following
+options:<ul>
+<li>Select an ISO image from which to create a template, then click <uicontrol>Create
+Templates from Selected ISO</uicontrol>.</li>
+<li>Select <uicontrol>All</uicontrol> to create a template from each
+ listed ISO image, then click <uicontrol>Create Templates from Selected
+ISO</uicontrol>.</li>
+<li rev="rev1">If the ISO image that you want to use does not appear
+in the scan results, you can select from the following options:<ul>
+<li>Select <uicontrol>I want to use a specific ISO file</uicontrol> to
+specify a path to the ISO image.</li>
+<li>Click <uicontrol>Search more ISOs</uicontrol> to search for more
+ISO images.</li>
+</ul></li>
+</ul></p>
+</csbody>
+</cshelp>
+</cshelp>
+<?Pub *0000004366?>
--
1.7.1
10 years, 9 months
[PATCH] UI: Grid Widget - Enable/Disable Row Selection
by Hongliang Wang
Currently, grid widget will style hovered and selected rows and fire
a row selected event when user clicks a row. Though it's confused in
some cases. For example, in software update grid, we only allow user
to "Update All" software packages: user can't select one package and
only update it. So nothing will happen if user clicks one row.
In this patch, we added the feature that allows grid consumer to
determine disable or enable row selection.
Signed-off-by: Hongliang Wang <hlwang(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.grid.js | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/ui/js/src/kimchi.grid.js b/ui/js/src/kimchi.grid.js
index bb98218..20cacc5 100644
--- a/ui/js/src/kimchi.grid.js
+++ b/ui/js/src/kimchi.grid.js
@@ -19,6 +19,7 @@ kimchi.widget.Grid = function(params) {
var containerID = params['container'];
var container = $('#' + containerID);
var gridID = params['id'];
+ var rowSelection = params['rowSelection'] || 'single';
var rowListener = params['onRowSelected'];
var htmlStr = [
'<div id="', gridID, '" class="grid">',
@@ -229,19 +230,21 @@ kimchi.widget.Grid = function(params) {
var selectedIndex = -1;
var setBodyListeners = function() {
- $('tr', gridBody).on('mouseover', function(event) {
- stylingRow(this, 'hover');
- });
+ if(rowSelection != 'disabled') {
+ $('tr', gridBody).on('mouseover', function(event) {
+ stylingRow(this, 'hover');
+ });
- $('tr', gridBody).on('mouseout', function(event) {
- stylingRow(this, 'hover', false);
- });
+ $('tr', gridBody).on('mouseout', function(event) {
+ stylingRow(this, 'hover', false);
+ });
- $('tr', gridBody).on('click', function(event) {
- selectedIndex = $(this).index();
- stylingRow(this, 'selected');
- rowListener && rowListener();
- });
+ $('tr', gridBody).on('click', function(event) {
+ selectedIndex = $(this).index();
+ stylingRow(this, 'selected');
+ rowListener && rowListener();
+ });
+ }
$('.grid-body-view', gridNode).on('scroll', function(event) {
$('.grid-header .grid-header-view', gridNode)
--
1.8.1.4
10 years, 9 months
[PATCH] auth enhancement: expire the session when the request periodic access
by shaohef@linux.vnet.ibm.com
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
Now UI will periodic access the vms and host.
The will never make the session be timeout.
This patch fix this problem.
Now the UI can set "User-Agent" as "kimchi-robot" when it want to
periodic access the vms and host.
If the "User-Agent" starts with "kimchi-robot" for a long time, kimchi
will expire the session.
A UI patch will send later.
Signed-off-by: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
---
src/kimchi/auth.py | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/src/kimchi/auth.py b/src/kimchi/auth.py
index f8ccea1..b1c08db 100644
--- a/src/kimchi/auth.py
+++ b/src/kimchi/auth.py
@@ -22,6 +22,7 @@ import cherrypy
import grp
import PAM
import re
+import time
from kimchi import template
@@ -32,6 +33,7 @@ from kimchi.utils import run_command
USER_ID = 'userid'
USER_GROUPS = 'groups'
USER_SUDO = 'sudo'
+REFRESH = 'robot-refresh'
def debug(msg):
@@ -131,6 +133,13 @@ def check_auth_session():
cherrypy.session.release_lock()
if session is not None:
debug("Session authenticated for user %s" % session)
+ userAgent = cherrypy.request.headers.get('User-Agent')
+ if userAgent.startswith("kimchi-robot"):
+ if (time.time() - cherrypy.session[REFRESH] >
+ cherrypy.session.timeout * 60):
+ cherrypy.lib.sessions.expire()
+ else:
+ cherrypy.session[REFRESH] = time.time()
return True
debug("Session not found")
@@ -172,6 +181,7 @@ def login(userid, password):
cherrypy.session[USER_ID] = userid
cherrypy.session[USER_GROUPS] = user.get_groups()
cherrypy.session[USER_SUDO] = user.has_sudo()
+ cherrypy.session[REFRESH] = time.time()
cherrypy.session.release_lock()
return user.get_user()
@@ -179,6 +189,7 @@ def login(userid, password):
def logout():
cherrypy.session.acquire_lock()
cherrypy.session[USER_ID] = None
+ cherrypy.session[REFRESH] = 0
cherrypy.session.release_lock()
cherrypy.lib.sessions.expire()
--
1.8.4.2
10 years, 9 months
[V1] StoragePool Edit: Add Disk to Logical Pool
by huoyuxin@linux.vnet.ibm.com
From: Yu Xin Huo <huoyuxin(a)linux.vnet.ibm.com>
Signed-off-by: Yu Xin Huo <huoyuxin(a)linux.vnet.ibm.com>
---
ui/js/src/kimchi.api.js | 12 +++++++++
ui/js/src/kimchi.storage_main.js | 38 ++++++++++++++++++++++++++++++
ui/js/src/kimchi.storagepool_add_main.js | 2 +-
ui/pages/i18n.html.tmpl | 1 +
ui/pages/tabs/storage.html.tmpl | 10 ++++++++
5 files changed, 62 insertions(+), 1 deletions(-)
diff --git a/ui/js/src/kimchi.api.js b/ui/js/src/kimchi.api.js
index 686141b..ee7f0d8 100644
--- a/ui/js/src/kimchi.api.js
+++ b/ui/js/src/kimchi.api.js
@@ -745,5 +745,17 @@ var kimchi = {
kimchi.message.error(data.responseJSON.reason);
}
});
+ },
+
+ updateStoragePool : function(name, content, suc, err) {
+ $.ajax({
+ url : kimchi.url + "storagepools/" + encodeURIComponent(name),
+ type : 'PUT',
+ contentType : 'application/json',
+ dataType : 'json',
+ data : JSON.stringify(content)
+ }).done(suc).fail(err ? err : function(data) {
+ kimchi.message.error(data.responseJSON.reason);
+ });
}
};
diff --git a/ui/js/src/kimchi.storage_main.js b/ui/js/src/kimchi.storage_main.js
index d65da0b..40aceb7 100644
--- a/ui/js/src/kimchi.storage_main.js
+++ b/ui/js/src/kimchi.storage_main.js
@@ -27,6 +27,7 @@ kimchi.doListStoragePools = function() {
value.usage = parseInt(value.allocated / value.capacity * 100) || 0;
value.capacity = kimchi.changetoProperUnit(value.capacity,1);
value.allocated = kimchi.changetoProperUnit(value.allocated,1);
+ value.enableExt = value.type==="logical" ? "" : "hide-content";
if ('kimchi-iso' !== value.type) {
listHtml += kimchi.template(storageHtml, value);
}
@@ -140,6 +141,10 @@ kimchi.storageBindClick = function() {
}
}
});
+ $('.pool-extend').on('click', function() {
+ $("#logicalPoolExtend").dialog("option", "poolName", $(this).data('name'));
+ $("#logicalPoolExtend").dialog("open");
+ });
}
kimchi.doListVolumes = function(poolObj) {
@@ -170,11 +175,44 @@ kimchi.doListVolumes = function(poolObj) {
});
}
+kimchi.initLogicalPoolExtend = function() {
+ $("#logicalPoolExtend").dialog({
+ autoOpen : false,
+ modal : true,
+ width : 600,
+ resizable : false,
+ closeText: "X",
+ open : function(){
+ $(".ui-dialog-titlebar-close", $("#logicalPoolExtend").parent()).removeAttr("title");
+ kimchi.listHostPartitions(function(data) {
+ for(var i=0;i<data.length;i++){
+ if (data[i].type === 'part' || data[i].type === 'disk') {
+ $('.host-partition', '#logicalPoolExtend').append(kimchi.template($('#logicalPoolExtendTmpl').html(), data[i]));
+ }
+ }
+ });
+ },
+ beforeClose : function() { $('.host-partition', '#logicalPoolExtend').empty(); },
+ buttons : [{
+ class: "ui-button-primary",
+ text: i18n.KCHAPI6007M,
+ click: function(){
+ var devicePaths = [];
+ $("input[type='checkbox']:checked", "#logicalPoolExtend").each(function(){
+ devicePaths.push($(this).prop('value'));
+ })
+ kimchi.updateStoragePool($("#logicalPoolExtend").dialog("option", "poolName"),{disks: devicePaths});
+ }
+ }]
+ });
+}
+
kimchi.storage_main = function() {
$('#storage-pool-add').on('click', function() {
kimchi.window.open('storagepool-add.html');
});
kimchi.doListStoragePools();
+ kimchi.initLogicalPoolExtend();
}
kimchi.changeArrow = function(obj) {
diff --git a/ui/js/src/kimchi.storagepool_add_main.js b/ui/js/src/kimchi.storagepool_add_main.js
index 43ff31a..beb59ed 100644
--- a/ui/js/src/kimchi.storagepool_add_main.js
+++ b/ui/js/src/kimchi.storagepool_add_main.js
@@ -53,7 +53,7 @@ kimchi.initStorageAddPage = function() {
listHtml += kimchi.template(deviceHtml, value);
}
});
- $('.host-partition').html(listHtml);
+ $('.host-partition', '#form-pool-add').html(listHtml);
}
kimchi.getStorageServers('netfs', function(data) {
var serverContent = [];
diff --git a/ui/pages/i18n.html.tmpl b/ui/pages/i18n.html.tmpl
index fe8ed5b..26ac47b 100644
--- a/ui/pages/i18n.html.tmpl
+++ b/ui/pages/i18n.html.tmpl
@@ -62,6 +62,7 @@ var i18n = {
'KCHAPI6004M': "$_("Confirm")",
'KCHAPI6005M': "$_("Create")",
'KCHAPI6006M': "$_("Warning")",
+ 'KCHAPI6007M': "$_("Save")",
'KCHTMPL6001W': "$_("No iso found")",
diff --git a/ui/pages/tabs/storage.html.tmpl b/ui/pages/tabs/storage.html.tmpl
index 6930c22..d36c90e 100644
--- a/ui/pages/tabs/storage.html.tmpl
+++ b/ui/pages/tabs/storage.html.tmpl
@@ -44,6 +44,9 @@
</div>
<ul id="storagepoolsList" class="list-storage"></ul>
</div>
+<div id="logicalPoolExtend" title="$_("Device path")">
+ <div class="host-partition"></div>
+</div>
<script id="storageTmpl" type="html/text">
<li id="{name}">
<div class="storage-li in" data-name="{name}" data-stat="{state}">
@@ -78,6 +81,7 @@
<button class="button-big pool-deactivate" data-stat="{state}" data-name="{name}"><span class="text">$_("Deactivate")</span></button>
<button class="button-big pool-activate" data-stat="{state}" data-name="{name}"><span class="text">$_("Activate")</span></button>
<button class="button-big red pool-delete" data-stat="{state}" data-name="{name}"><span class="text">$_("Undefine")</span></button>
+ <button class="button-big pool-extend {enableExt}" data-stat="{state}" data-name="{name}"><span class="text">$_("Extend")</span></button>
</div>
</div>
</div>
@@ -110,6 +114,12 @@
</div>
</div>
</script>
+<script id="logicalPoolExtendTmpl" type="html/text">
+ <div>
+ <input type="checkbox" value="{path}" name="devices">
+ <label for="{name}">{path}</label>
+ </div>
+</script>
<script>
kimchi.storage_main();
</script>
--
1.7.1
10 years, 9 months
[PATCH V2 1/2] Bug Fix #282: Disable Start/Stop network buttons while wait backend lag
by Rodrigo Trujillo
When the user tries to Start/Stop (up/down) a network, there is a lag in
the backend, and it was possible to click on start/stop/delete again,
and again, generating errors. This patch disables the buttons and shows
loading gif to user, avoind this kind of error.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
ui/css/theme-default/network.css | 5 +++++
ui/js/src/kimchi.network.js | 14 ++++++++++----
2 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/ui/css/theme-default/network.css b/ui/css/theme-default/network.css
index 80640a3..67f2aa2 100644
--- a/ui/css/theme-default/network.css
+++ b/ui/css/theme-default/network.css
@@ -132,6 +132,11 @@
margin-left: 29px;
}
+.network .list .nw-loading {
+ background: #c0c0c0 url(../../images/theme-default/loading.gif)
+ center no-repeat;
+}
+
.network .list .up {
background: linear-gradient(to bottom, #BFD255 0%, #8EB92A 50%,
#72AA00 51%, #9ECB2D 100%) repeat scroll 0 0 transparent;
diff --git a/ui/js/src/kimchi.network.js b/ui/js/src/kimchi.network.js
index 91324ee..7cedc01 100644
--- a/ui/js/src/kimchi.network.js
+++ b/ui/js/src/kimchi.network.js
@@ -84,20 +84,26 @@ kimchi.addNetworkActions = function(network) {
$(".menu-container", "#" + network.name).toggle(false);
var menu = $(evt.currentTarget).parent();
if ($(evt.currentTarget).attr("nwAct") === "start") {
+ $(".network-state", $("#" + network.name)).switchClass("down", "nw-loading");
+ $("[nwAct='start']", menu).addClass("ui-state-disabled");
+ $("[nwAct='delete']", menu).addClass("ui-state-disabled");
+ $(":first-child", $("[nwAct='delete']", menu)).attr("disabled", true);
kimchi.toggleNetwork(network.name, true, function() {
$("[nwAct='start']", menu).addClass("hide-action-item");
+ $("[nwAct='start']", menu).removeClass("ui-state-disabled");
$("[nwAct='stop']", menu).removeClass("hide-action-item");
- $("[nwAct='delete']", menu).addClass("ui-state-disabled");
- $(":first-child", $("[nwAct='delete']", menu)).attr("disabled", true);
- $(".network-state", $("#" + network.name)).switchClass("down", "up");
+ $(".network-state", $("#" + network.name)).switchClass("nw-loading", "up");
});
} else if ($(evt.currentTarget).attr("nwAct") === "stop") {
+ $(".network-state", $("#" + network.name)).switchClass("up", "nw-loading");
+ $("[nwAct='stop']", menu).addClass("ui-state-disabled");
kimchi.toggleNetwork(network.name, false, function() {
$("[nwAct='start']", menu).removeClass("hide-action-item");
$("[nwAct='stop']", menu).addClass("hide-action-item");
+ $("[nwAct='stop']", menu).removeClass("ui-state-disabled");
$("[nwAct='delete']", menu).removeClass("ui-state-disabled");
$(":first-child", $("[nwAct='delete']", menu)).removeAttr("disabled");
- $(".network-state", $("#" + network.name)).switchClass("up", "down");
+ $(".network-state", $("#" + network.name)).switchClass("nw-loading", "down");
});
} else if ($(evt.currentTarget).attr("nwAct") === "delete") {
kimchi.confirm({
--
1.8.5.3
10 years, 9 months
[PATCHv3 0/3]Fix validation on readonly pool type
by lvroyce@linux.vnet.ibm.com
From: Royce Lv <lvroyce(a)linux.vnet.ibm.com>
Some pool types (scsi, iscsi, mpath) do not allow create/delete
storage volume, so it is wrong to delete these volumes when vm delete.
Fix it by just delete non read only pool types.
Royce Lv (3):
Fix vm creation storage rollback clean
Prevent volume create and delete for certain pool types
Clear pep8 failure in make check
src/kimchi/config.py.in | 3 +++
src/kimchi/control/base.py | 2 ++
src/kimchi/i18n.py | 1 +
src/kimchi/isoinfo.py | 4 ++--
src/kimchi/model/storageservers.py | 4 ++--
src/kimchi/model/storagevolumes.py | 18 +++++++++++++++---
src/kimchi/model/vms.py | 16 +++++++++++-----
tests/test_model.py | 6 +++---
8 files changed, 39 insertions(+), 15 deletions(-)
--
1.8.1.2
10 years, 9 months
[PATCH v2 0/5] Add users and groups to VMs
by Crístian Viana
Here are the differences between the previous patchset (v1) and this one:
- New patch "Use proper term "user name" instead of "user id"" has been added.
- Patch "Return users and groups when fetching VM info" has been updated to log
the exception message when there is an invalid metadata value in a VM. Notice
that an invalid metadata value can only be written to the VM XML by external
access; users from within Kimchi will always store correct value through
the app.
- Rebased to 5d82241.
Crístian Viana (5):
Override only the updated "User" methods in "patch_auth"
Use proper term "user name" instead of "user id"
Add functions to check if a user/group exists
Return users and groups when fetching VM info
Add/remove users and groups to VMs
docs/API.md | 6 ++++
po/en_US.po | 2 +-
po/kimchi.pot | 2 +-
po/pt_BR.po | 2 +-
po/zh_CN.po | 2 +-
src/kimchi/API.json | 22 ++++++++++++++
src/kimchi/auth.py | 60 ++++++++++++++++++++++++++------------
src/kimchi/control/vms.py | 6 ++--
src/kimchi/i18n.py | 8 +++++-
src/kimchi/mockmodel.py | 4 ++-
src/kimchi/model/vms.py | 62 ++++++++++++++++++++++++++++++++++++----
src/kimchi/root.py | 4 +--
tests/test_authorization.py | 19 ++++++++++++
tests/test_mockmodel.py | 2 +-
tests/test_model.py | 44 +++++++++++++++++++++++++++-
tests/test_rest.py | 10 ++++---
tests/utils.py | 26 +++++------------
ui/js/src/kimchi.login_window.js | 16 +++++------
ui/js/src/kimchi.user.js | 14 ++++-----
ui/pages/login-window.html.tmpl | 4 +--
20 files changed, 239 insertions(+), 76 deletions(-)
--
1.8.5.3
10 years, 9 months