[PATCH] Applying new ui to Admin New Custom Backup
by sguimaraes943@gmail.com
From: Andre Teodoro <andreteodoro.work(a)gmail.com>
Signed-off-by: Andre Teodoro <andreteodoro.work(a)gmail.com>
---
ui/css/src/modules/_administration.scss | 30 ++++++++++++----
ui/js/host-admin.js | Bin 35177 -> 34874 bytes
ui/pages/host-admin.html.tmpl | 62 ++++++++++++++++++++------------
3 files changed, 63 insertions(+), 29 deletions(-)
diff --git a/ui/css/src/modules/_administration.scss b/ui/css/src/modules/_administration.scss
index 2a79dce..84479f1 100644
--- a/ui/css/src/modules/_administration.scss
+++ b/ui/css/src/modules/_administration.scss
@@ -17,13 +17,12 @@
// See the License for the specific language governing permissions and
// limitations under the License.
//
-
#administration-root-container {
- .fa {
- margin-left: 20px;
- font-size: 20px;
- color: #5a595b;
- }
+ // .fa {
+ // margin-left: 20px;
+ // font-size: 20px;
+ // color: #5a595b;
+ // }
h3 {
height: 32px;
padding: 10px 15px;
@@ -369,4 +368,23 @@
width: 10%;
height: auto;
}
+}
+
+#newBakDialog {
+ .del-label {
+ color: #9e9e9e;
+ font-size: 14px;
+ }
+ .fa {
+ padding: 1px 3px;
+ font-size: 18px;
+ margin-left: 0;
+ }
+ .fa-plus-circle {
+ margin-bottom: 5px;
+ }
+ .path-item {
+ display: flex;
+ margin-bottom: 10px;
+ }
}
\ No newline at end of file
diff --git a/ui/js/host-admin.js b/ui/js/host-admin.js
index f34fafd05a11a2f0e7e22f2b9c50f1c980bb8d79..d43bd3c9326be081be832fb3c41d0a0e4a43b460 100644
GIT binary patch
delta 1259
zcmZ`(O>Em_7-p5bIL@Errb*g$tK+0~yvz-q1RZOVZVU$MAV615{7u4%zffzAoyJZ#
zeySeeunTJG!v!t~G$Fx-qV9m;01_8Y{M@)8CO9D>F(jlODt<mYiP~+dCF}j($M5(0
z{hsH2zuz|pzStPpxOM2h&u(2Bh{{=uTzy!(@`$0C_REMaPva_6z<)D?h#n8(CNmc@
z8e-mXE@`Hr<AZh@y9|$amf|RP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KjL(Uz#=5g?cTgXx9O(x_)=sf818JR1@e~6Dp|^8x!?jfi0zwM
V`H;=kS=F+${bXhOu`&L%_zJe6&u;(#
diff --git a/ui/pages/host-admin.html.tmpl b/ui/pages/host-admin.html.tmpl
index 7f4ceda..7e197bf 100644
--- a/ui/pages/host-admin.html.tmpl
+++ b/ui/pages/host-admin.html.tmpl
@@ -87,7 +87,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<a href="#" id="newDefaultBakBtn"><i class="fa fa-file"></i>$_("Generate Default Backup")</a>
</li>
<li role="presentation">
- <a href="#" id="newCustomBakBtn"><i class="fa fa-file"></i>$_("New Custom Backup")</a>
+ <a href="#" id="newCustomBakBtn" data-toggle="modal" data-target="#newBakDialog"><i class="fa fa-file"></i>$_("New Custom Backup")</a>
</li>
<li role="presentation">
<a href="#" id="batDelBtn" data-toggle="modal" data-target="#batDelDialog"><i class="fa fa-minus-circle"></i>$_("Batch Delete")</a>
@@ -262,21 +262,43 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
</div>
<!-- Configuration Backup Modal - Create Custom Backup -->
-<div id="newBakDialog" title='$_("Create a backup")' class="ginger-dialog">
- <div>$_("Description")</div>
- <div class="crt-bak-section"><input type="text" class="desc"></div>
- <div class="crt-bak-section">
- <div class="path-pick">
- <div>$_("Path Included")</div>
- <div class="box" id="includeBox"></div>
- </div>
- <div class="path-pick">
- <div>$_("Path Excluded")</div>
- <div class="box" id="excludeBox"></div>
+<div class="modal fade host-modal" id="newBakDialog" tabindex="-1" role="dialog" labelledby="newBakLabel" aria-hidden="true">
+ <div class="modal-dialog" role="document">
+ <div class="modal-content" >
+ <div class="modal-header">
+ <h4 class="modal-title">$_("Create a backup")</h4>
+ </div>
+ <div class="modal-body">
+ <form id="form-backup-add">
+ <div class="form-group">
+ <label for="description-textbox">$_("Description")</label>
+ <input type="text" class="form-control input" id="description-textbox" name="description" />
+ </div>
+ </form>
+ <div class="row">
+ <div class="col-md-12">
+ <div class="col-md-6" >
+ <label class="col-md-12">$_("Paths Included")</label>
+ <span class='add-path-to-include'><a class="add btn btn-link" href="#"><i class="fa fa-plus-circle"></i> $_("Add a Path")</a></span>
+ <div id="includeBox"></div>
+ </div>
+ <div class="col-md-6">
+ <label class="col-md-12">$_("Paths Excluded")</label>
+ <span class='add-path-to-exclude'><a class="add btn btn-link" href="#"><i class="fa fa-plus-circle"></i> $_("Add a Path")</a></span>
+ <div id="excludeBox"></div>
+ </div>
+ </div>
+ </div>
+ </div>
+ <div class="modal-footer">
+ <button type="button" id="newBakFormBtn" class="btn btn-default" data-dismiss="modal" disabled>$_("Generate Backup")</button>
+ <button type="button" id="newBakFormCancelBtn" class="btn btn-default" data-dismiss="modal">$_("Cancel")</button>
+ </div>
</div>
</div>
</div>
+
<!-- Configuration Backup Modal - Batch Delete -->
<div class="modal fade host-modal" id="batDelDialog" tabindex="-1" role="dialog" labelledby="batDelLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
@@ -314,15 +336,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
</div>
</div>
-<!-- <div id="batDelDialog" class="window modal-content">
- <div class="del-option">
- <input type="radio" name="batDelType" value="counts_ago" checked>$_("Preserve the latest") <input type="text" class=""> $_("backups")
- </div>
- <div class="del-option">
- <input type="radio" name="batDelType" value="days_ago">$_("Preserve the latest") <input type="text" class="" disabled> $_("days of backups")
- </div>
-</div> -->
-
<!-- SEP Configuration Modal - Add Subscription -->
<div class="modal fade host-modal" id="subscriptionAdd" tabindex="-1" role="dialog" labelledby="hostsModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
@@ -416,7 +429,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
<span class="column-file">{file}</span><!--
--><span class="column-timestamp">{timestamp}</span><!--
--><span class="column-download btn btn-link btn-download"><i class="fa fa-download"></i>$_("Download")</span><!--
- --><span class="column-delete btn btn-link btn-delete"><i class="fa fa-minus-circle"></i>$_("Remove")</span>
+ --><span class="column-delete btn btn-link btn-delete "><i class="fa fa-minus-circle"></i>$_("Remove")</span>
</li>
</script>
<script id="backupTooltip" type="text/html">
@@ -428,7 +441,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
</div>
</script>
<script id="pathItem" type="text/html">
- <div class="path-item"><input type="text"><button class="add"></button><button class="delete"></button></div>
+ <div class="path-item">
+ <input type="text" class="form-control input" />
+ <span class="column-delete btn btn-link delete del-label"><i class="fa fa-minus-circle"></i>$_("Remove")</span>
+ </div>
</script>
<script id="nicItem" type="text/html">
<form class="form-inline">
--
1.9.3
8 years, 11 months
[PATCH] [Kimchi] Reverting model/config.py deleted on last commit
by Ramon Medeiros
The file was wrongly removed on last commit. Restore it to the correct
location.
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
---
model/config.py | 155 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 155 insertions(+)
create mode 100644 model/config.py
diff --git a/model/config.py b/model/config.py
new file mode 100644
index 0000000..e552edb
--- /dev/null
+++ b/model/config.py
@@ -0,0 +1,155 @@
+#
+# Project Kimchi
+#
+# Copyright IBM, Corp. 2014-2015
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# 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 multiprocessing.pool import ThreadPool
+
+from wok.basemodel import Singleton
+from wok.config import config as kconfig
+from wok.config import get_version
+from wok.exception import NotFoundError
+from wok.utils import run_command, wok_log
+
+from wok.plugins.kimchi.config import find_qemu_binary
+from wok.plugins.kimchi.distroloader import DistroLoader
+from wok.plugins.kimchi.model.featuretests import FeatureTests
+from wok.plugins.kimchi.model.featuretests import FEATURETEST_POOL_NAME
+from wok.plugins.kimchi.model.featuretests import FEATURETEST_VM_NAME
+from wok.plugins.kimchi.screenshot import VMScreenshot
+from wok.plugins.kimchi.utils import check_url_path
+
+
+class ConfigModel(object):
+ def __init__(self, **kargs):
+ pass
+
+ def lookup(self, name):
+ proxy_port = kconfig.get('display', 'display_proxy_port')
+ return {'display_proxy_port': proxy_port,
+ 'version': get_version()}
+
+
+class CapabilitiesModel(object):
+ __metaclass__ = Singleton
+
+ def __init__(self, **kargs):
+ self.conn = kargs['conn']
+ self.qemu_stream = False
+ self.libvirt_stream_protocols = []
+ self.fc_host_support = False
+ self.kernel_vfio = False
+ self.mem_hotplug_support = False
+
+ # Subscribe function to set host capabilities to be run when cherrypy
+ # server is up
+ # It is needed because some features tests depends on the server
+ cherrypy.engine.subscribe('start', self._set_capabilities)
+
+ # Subscribe function to clean any Kimchi leftovers
+ cherrypy.engine.subscribe('stop', self._clean_leftovers)
+
+ def _clean_leftovers(self):
+ conn = self.conn.get()
+ FeatureTests.disable_libvirt_error_logging()
+ try:
+ dom = conn.lookupByName(FEATURETEST_VM_NAME)
+ dom.undefine()
+ except Exception:
+ # Any exception can be ignored here
+ pass
+
+ try:
+ pool = conn.storagePoolLookupByName(FEATURETEST_POOL_NAME)
+ pool.undefine()
+ except Exception:
+ # Any exception can be ignored here
+ pass
+
+ FeatureTests.enable_libvirt_error_logging()
+
+ def _set_capabilities(self):
+ wok_log.info("*** Running feature tests ***")
+ conn = self.conn.get()
+ self.qemu_stream = FeatureTests.qemu_supports_iso_stream()
+ self.nfs_target_probe = FeatureTests.libvirt_support_nfs_probe(conn)
+ self.fc_host_support = FeatureTests.libvirt_support_fc_host(conn)
+ self.kernel_vfio = FeatureTests.kernel_support_vfio()
+ self.mem_hotplug_support = FeatureTests.has_mem_hotplug_support(conn)
+
+ self.libvirt_stream_protocols = []
+ for p in ['http', 'https', 'ftp', 'ftps', 'tftp']:
+ if FeatureTests.libvirt_supports_iso_stream(conn, p):
+ self.libvirt_stream_protocols.append(p)
+
+ wok_log.info("*** Feature tests completed ***")
+ _set_capabilities.priority = 90
+
+ def _qemu_support_spice(self):
+ qemu_path = find_qemu_binary(find_emulator=True)
+ out, err, rc = run_command(['ldd', qemu_path])
+ if rc != 0:
+ wok_log.error('Failed to find qemu binary dependencies: %s',
+ err)
+ return False
+ for line in out.split('\n'):
+ if line.lstrip().startswith('libspice-server.so'):
+ return True
+ return False
+
+ def lookup(self, *ident):
+ return {'libvirt_stream_protocols': self.libvirt_stream_protocols,
+ 'qemu_spice': self._qemu_support_spice(),
+ 'qemu_stream': self.qemu_stream,
+ 'screenshot': VMScreenshot.get_stream_test_result(),
+ 'federation': kconfig.get("server", "federation"),
+ 'auth': kconfig.get("authentication", "method"),
+ 'kernel_vfio': self.kernel_vfio,
+ 'nm_running': FeatureTests.is_nm_running(),
+ 'mem_hotplug_support': self.mem_hotplug_support
+ }
+
+
+class DistrosModel(object):
+ def __init__(self, **kargs):
+ distroloader = DistroLoader()
+ self.distros = distroloader.get()
+
+ def get_list(self):
+ def validate_distro(distro):
+ if check_url_path(distro['path']):
+ return distro['name']
+
+ n_processes = len(self.distros.keys())
+ pool = ThreadPool(processes=n_processes)
+ map_res = pool.map_async(validate_distro, self.distros.values())
+ pool.close()
+ pool.join()
+ res = list(set(map_res.get()) - set([None]))
+ return sorted(res)
+
+
+class DistroModel(object):
+ def __init__(self, **kargs):
+ self._distros = DistrosModel()
+
+ def lookup(self, name):
+ try:
+ return self._distros.distros[name]
+ except KeyError:
+ raise NotFoundError("KCHDISTRO0001E", {'name': name})
--
2.1.0
8 years, 11 months
Wok has its own repository!
by Aline Manera
Hi all,
Wok has its own repository now:
https://github.com/kimchi-project/wok.git \o/
Please, use this repository as the base for your development.
All the plugins, Kimchi, Ginger Base and Ginger are listed as
git-submodule in the Wok repository to make the development easy.
You can follow the instruction below to have all the code available in
your system:
# Clone the Wok code and all its plugins
git clone --recursive https://github.com/kimchi-project/wok.git
As part of this effort, Kimchi repository now only contains the Kimchi
source code.
We will use the same mailing list (kimchi-devel(a)ovirt.org) for Wok and
Kimchi projects.
So please, add a tag [<project-name>] while sending patches, RFCs and
anything else to the mailing list.
I will properly update the github wiki page to add more details on how
to contribute to both projects.
Please, let me know on any problem with that.
Regards,
Aline Manera
8 years, 11 months