job view redesign
authorvasary.daniel <TFS\vasary.daniel>
Wed, 13 Apr 2022 21:57:16 +0000 (21:57 +0000)
committervasary.daniel <TFS\vasary.daniel>
Wed, 13 Apr 2022 21:57:16 +0000 (21:57 +0000)
git-tfs-id: [http://tfs.userrendszerhaz.hu:8080/tfs/DefaultCollection]$/MediaCube;C33158

server/user.mediacube.gui/css/toast.css [new file with mode: 0644]
server/user.mediacube.gui/js/toast.js [new file with mode: 0644]
server/user.mediacube.gui/js/toast.min.js [new file with mode: 0644]
server/user.mediacube.gui/pages/index.zul
server/user.mediacube.gui/pages/jobeditor.zul [new file with mode: 0644]
server/user.mediacube.gui/pages/joblist.zul
server/user.mediacube.gui/pages/jobs.zul [new file with mode: 0644]
server/user.mediacube.gui/pages/jobselector.zul
server/user.mediacube.gui/src/user/jobengine/zk/model/IndexModel.java
server/user.mediacube.gui/src/user/jobengine/zk/model/JobEditorModel.java [moved from server/user.mediacube.gui/src/user/jobengine/zk/model/JobSelectorModel.java with 83% similarity]
server/user.mediacube.gui/src/user/jobengine/zk/model/MaestroJobListModel.java

diff --git a/server/user.mediacube.gui/css/toast.css b/server/user.mediacube.gui/css/toast.css
new file mode 100644 (file)
index 0000000..79d6580
--- /dev/null
@@ -0,0 +1,73 @@
+.toastjs-container {
+       position: absolute; /* Fallback */
+       position: fixed;
+       top: 200px;
+       left: 30px;
+       width: calc(100% - 60px);
+       max-width: 400px;
+
+       transform: translateX(-150%);
+       transition: transform 0.3s;
+
+       z-index: 100; /* */
+}
+
+.toastjs-container[aria-hidden="false"] {
+       transform: translateX(0%);
+}
+
+.toastjs {
+       background: #fff;
+       padding: 10px 15px 0; /* No bottom padding because the buttons have a margin-bottom */
+       border-left-style: solid;
+       border-left-width: 5px;
+       border-radius: 4px;
+       box-shadow: 0 2px 5px 0 rgba(0,0,0,0.2);
+}
+
+.toastjs.default {
+       border-left-color: #AAAAAA;
+}
+
+.toastjs.success {
+       border-left-color: #2ECC40;
+}
+.toastjs.warning {
+       border-left-color: #FF851B;
+}
+.toastjs.danger {
+       border-left-color: #FF4136;
+}
+
+
+.toastjs-btn {
+       background: rgb(240,240,240);
+       padding: 5px 10px;
+       border: 0;
+       border-radius: 4px;
+
+       font-family: 'Source Sans Pro', sans-serif;
+       font-size: 14px;
+
+       display: inline-block;
+       margin-right: 10px;
+       margin-bottom: 10px;
+       cursor: pointer;
+}
+
+.toastjs-btn--custom {
+       background: rgb(50,50,50);
+       color: #fff;
+}
+
+
+.toastjs-btn:hover,
+.toastjs-btn:focus {
+       outline: none;
+       box-shadow: 0 2px 5px 0 rgba(0,0,0,0.2);
+}
+
+
+
+
+
diff --git a/server/user.mediacube.gui/js/toast.js b/server/user.mediacube.gui/js/toast.js
new file mode 100644 (file)
index 0000000..3b54a6b
--- /dev/null
@@ -0,0 +1,113 @@
+'use strict';
+
+function Toast(options) {
+
+    if (!options.message) {
+        throw new Error('Toast.js - You need to set a message to display');
+        return;
+    }
+
+    this.options = options;
+    this.options.type = options.type || 'default';
+
+    this.toastContainerEl = document.querySelector('.toastjs-container');
+    this.toastEl = document.querySelector('.toastjs');
+
+    this._init();
+}
+
+Toast.prototype._createElements = function () {
+    var _this = this;
+
+    return new Promise(function (resolve, reject) {
+
+        _this.toastContainerEl = document.createElement('div');
+        _this.toastContainerEl.classList.add('toastjs-container');
+        _this.toastContainerEl.setAttribute('role', 'alert');
+        _this.toastContainerEl.setAttribute('aria-hidden', true);
+
+        _this.toastEl = document.createElement('div');
+        _this.toastEl.classList.add('toastjs');
+
+        _this.toastContainerEl.appendChild(_this.toastEl);
+        document.body.appendChild(_this.toastContainerEl);
+
+        setTimeout(function () {
+            return resolve();
+        }, 500);
+    });
+};
+
+Toast.prototype._addEventListeners = function () {
+    var _this2 = this;
+
+    document.querySelector('.toastjs-btn--close').addEventListener('click', function () {
+        _this2._close();
+    });
+
+    if (this.options.customButtons) {
+        var customButtonsElArray = Array.prototype.slice.call(document.querySelectorAll('.toastjs-btn--custom'));
+        customButtonsElArray.map(function (el, index) {
+            el.addEventListener('click', function (event) {
+                return _this2.options.customButtons[index].onClick(event);
+            });
+        });
+    }
+};
+
+Toast.prototype._close = function () {
+    var _this3 = this;
+
+    return new Promise(function (resolve, reject) {
+        _this3.toastContainerEl.setAttribute('aria-hidden', true);
+        setTimeout(function () {
+
+            _this3.toastEl.innerHTML = '';
+            _this3.toastEl.classList.remove('default', 'success', 'warning', 'danger');
+
+            if (_this3.focusedElBeforeOpen) {
+                _this3.focusedElBeforeOpen.focus();
+            }
+
+            resolve();
+        }, 1000);
+    });
+};
+
+Toast.prototype._open = function () {
+
+    this.toastEl.classList.add(this.options.type);
+    this.toastContainerEl.setAttribute('aria-hidden', false);
+
+    var customButtons = '';
+    if (this.options.customButtons) {
+        customButtons = this.options.customButtons.map(function (customButton, index) {
+            return '<button type="button" class="toastjs-btn toastjs-btn--custom">' + customButton.text + '</button>';
+        });
+        customButtons = customButtons.join('');
+    }
+
+    this.toastEl.innerHTML = '\n        <p>' + this.options.message + '</p>\n        <button type="button" class="toastjs-btn toastjs-btn--close">Close</button>\n        ' + customButtons + '\n    ';
+
+    this.focusedElBeforeOpen = document.activeElement;
+    document.querySelector('.toastjs-btn--close').focus();
+};
+
+Toast.prototype._init = function () {
+    var _this4 = this;
+
+    Promise.resolve().then(function () {
+        if (_this4.toastContainerEl) {
+            return Promise.resolve();
+        }
+        return _this4._createElements();
+    }).then(function () {
+        if (_this4.toastContainerEl.getAttribute('aria-hidden') == 'false') {
+            return _this4._close();
+        }
+        return Promise.resolve();
+    }).then(function () {
+        _this4._open();
+        _this4._addEventListeners();
+    });
+};
\ No newline at end of file
diff --git a/server/user.mediacube.gui/js/toast.min.js b/server/user.mediacube.gui/js/toast.min.js
new file mode 100644 (file)
index 0000000..1a0413c
--- /dev/null
@@ -0,0 +1 @@
+"use strict";function Toast(t){if(!t.message)throw new Error("Toast.js - You need to set a message to display");this.options=t,this.options.type=t.type||"default",this.toastContainerEl=document.querySelector(".toastjs-container"),this.toastEl=document.querySelector(".toastjs"),this._init()}Toast.prototype._createElements=function(){var t=this;return new Promise(function(e,o){t.toastContainerEl=document.createElement("div"),t.toastContainerEl.classList.add("toastjs-container"),t.toastContainerEl.setAttribute("role","alert"),t.toastContainerEl.setAttribute("aria-hidden",!0),t.toastEl=document.createElement("div"),t.toastEl.classList.add("toastjs"),t.toastContainerEl.appendChild(t.toastEl),document.body.appendChild(t.toastContainerEl),setTimeout(function(){return e()},500)})},Toast.prototype._addEventListeners=function(){var t=this;if(document.querySelector(".toastjs-btn--close").addEventListener("click",function(){t._close()}),this.options.customButtons){var e=Array.prototype.slice.call(document.querySelectorAll(".toastjs-btn--custom"));e.map(function(e,o){e.addEventListener("click",function(e){return t.options.customButtons[o].onClick(e)})})}},Toast.prototype._close=function(){var t=this;return new Promise(function(e,o){t.toastContainerEl.setAttribute("aria-hidden",!0),setTimeout(function(){t.toastEl.innerHTML="",t.toastEl.classList.remove("default","success","warning","danger"),t.focusedElBeforeOpen&&t.focusedElBeforeOpen.focus(),e()},1e3)})},Toast.prototype._open=function(){this.toastEl.classList.add(this.options.type),this.toastContainerEl.setAttribute("aria-hidden",!1);var t="";this.options.customButtons&&(t=this.options.customButtons.map(function(t,e){return'<button type="button" class="toastjs-btn toastjs-btn--custom">'+t.text+"</button>"}),t=t.join("")),this.toastEl.innerHTML="\n        <p>"+this.options.message+'</p>\n        <button type="button" class="toastjs-btn toastjs-btn--close">Close</button>\n        '+t+"\n    ",this.focusedElBeforeOpen=document.activeElement,document.querySelector(".toastjs-btn--close").focus()},Toast.prototype._init=function(){var t=this;Promise.resolve().then(function(){return t.toastContainerEl?Promise.resolve():t._createElements()}).then(function(){return"false"==t.toastContainerEl.getAttribute("aria-hidden")?t._close():Promise.resolve()}).then(function(){t._open(),t._addEventListeners()})};
\ No newline at end of file
index 3b74039d6d5d123ebbefb46e5e37b19eedebe803..1df319a4363131e1a831fbb326f3ba3413016da3 100644 (file)
@@ -1,8 +1,5 @@
-<?xml version="1.0" encoding="UTF-8"?>\r
-\r
 <?init class="user.jobengine.zk.util.AuthInitiator"?>\r
-<!DOCTYPE xml>\r
-<zk xmlns:w="http://www.zkoss.org/2005/zk/client">\r
+<zk>\r
        <style src="/css/archivum.css" />\r
        <zscript><![CDATA[\r
        // Chrome F5 bug workaround (miscalculates 100% width on second refresh)\r
diff --git a/server/user.mediacube.gui/pages/jobeditor.zul b/server/user.mediacube.gui/pages/jobeditor.zul
new file mode 100644 (file)
index 0000000..33849db
--- /dev/null
@@ -0,0 +1,116 @@
+<zk xmlns:ca="client/attribute">\r
+       <style src="/css/toast.css" />\r
+       <script src="/js/toast.min.js" />\r
+       <script>\r
+               function showToast(m) {\r
+                       var toast = new Toast({message: m, type: 'danger' });\r
+                       setTimeout(function(){ toast._close(); }, 3000);\r
+               }\r
+       </script>\r
+       <vlayout height="100%" viewModel="@id('jlm') @init('user.jobengine.zk.model.JobEditorModel')">\r
+               <toolbar>\r
+                       <toolbarbutton label="Futtatás" iconSclass="z-icon-play" onClick="@command('execute')" disabled="${not sessionScope.userPrincipal.admin}" autodisable="self" />\r
+               </toolbar>\r
+               <borderlayout vflex="true">\r
+                       <center border="none" vflex="true">\r
+                               <listbox vflex="true" model="@load(jlm.jobs)" selectedItem="@bind(jlm.selectedJob)">\r
+                                       <listhead>\r
+                                               <listheader hflex="1" label="Név" align="left" />\r
+                                       </listhead>\r
+\r
+                                       <template name="model">\r
+                                               <!--  Ez nagyon veszelyes, furan kezeli a zkoss, problemakat okozhat !!! -->\r
+                                               <!-- <listitem onDoubleClick="@command('execute')"> -->\r
+                                               <listitem>\r
+                                                       <listcell label="@load(empty each.name ? each.template : each.name)" />\r
+                                               </listitem>\r
+                                       </template>\r
+                               </listbox>\r
+                       </center>\r
+                       <east size="60%" flex="true" splittable="true" collapsible="true">\r
+                               <tabbox id="pagesTab" vflex="true" hflex="true" orient="top">\r
+                                       <tabs visible="true">\r
+                                               <tab id="tab0" label="Paraméterek" selected="true" />\r
+                                               <tab id="tab1" label="Részletek" />\r
+                                               <tab id="tab2" label="Ábra" />\r
+                                       </tabs>\r
+                                       <tabpanels>\r
+                                               <tabpanel>\r
+                                                       <borderlayout>\r
+                                                               <north size="50%" splittable="true">\r
+                                                                       <grid visible="@bind(not empty jlm.selectedJob)" sizedByContent="false" span="true" vflex="true"\r
+                                                                               style="border: none; background: #e3e3e3 !important;" oddRowSclass="listbox-odd-style" \r
+                                                                               sclass="listbox-normal-style"\r
+                                                                               emptyMessage="A részletek megtekintéséhez jelöljön ki egy folyamatot.">\r
+                                                                               <columns>\r
+                                                                                       <column hflex="min"/>\r
+                                                                                       <column hflex="true"/>\r
+                                                                               </columns>\r
+                                                                               <rows>\r
+                                                                                       <row>\r
+                                                                                               <label value="Name"/>\r
+                                                                                               <label value="@bind(jlm.selectedJob.name)"/>\r
+                                                                                       </row>\r
+                                                                                       <row>\r
+                                                                                               <label value="Template"/>\r
+                                                                                               <label value="@bind(jlm.selectedJob.template)"/>\r
+                                                                                       </row>\r
+                                                                                       <row>\r
+                                                                                               <label value="Active"/>\r
+                                                                                               <label value="@bind(empty jlm.selectedJob.active ? false : jlm.selectedJob.active)"/>\r
+                                                                                       </row>\r
+                                                                                       <row>\r
+                                                                                               <label value="Execute immediate"/>\r
+                                                                                               <label value="@bind(empty jlm.selectedJob.executeimmediate ? false : jlm.selectedJob.executeimmediate)"/>\r
+                                                                                       </row>\r
+                                                                                       <row>\r
+                                                                                               <label value="Cron expression"/>\r
+                                                                                               <label value="@bind(jlm.selectedJob.cronexpression)"/>\r
+                                                                                       </row>\r
+                                                                                       <row>\r
+                                                                                               <label value="Next execution"/>\r
+                                                                                               <label value="@bind(jlm.selectedJob.nextTime)"/>\r
+                                                                                       </row>\r
+                                                                               </rows>\r
+                                                                       </grid>\r
+\r
+                                                               </north>\r
+                                                               <center border="none" flex="true">\r
+                                                                       <grid model="@load(jlm.selectedJob.parameters)" style="border: none; background: #e3e3e3 !important;"\r
+                                                                               oddRowSclass="listbox-odd-style" sclass="listbox-normal-style">\r
+                                                                               <columns sizable="true">\r
+                                                                                       <column label="Name" hflex="1"/>\r
+                                                                                       <column label="Value" hflex="3"/>\r
+                                                                                       <column label="Type" hflex="1"/>\r
+                                                                               </columns>\r
+                                                                               <rows>\r
+                                                                                       <template name="model">\r
+                                                                                               <row>\r
+                                                                                                       <label value="@load(each.name)"/>\r
+                                                                                                       <label value="@load(each.value)"/>\r
+                                                                                                       <label value="@load(each.type)"/>\r
+                                                                                               </row>\r
+                                                                                       </template>\r
+                                                                               </rows>\r
+                                                                       </grid>\r
+                                                               </center>\r
+                                                       </borderlayout>\r
+                                               </tabpanel>\r
+                                               <tabpanel>\r
+                                                       <label height="100%" ca:data-syntax-highlight="true" multiline="true" pre="true" \r
+                                                               value="@bind(jlm.selectedJob['xml'])" />\r
+                                               </tabpanel>\r
+                                               <tabpanel>\r
+                                                       <include src="pages/processVisualizer.zul" />\r
+                                               </tabpanel>\r
+                                       </tabpanels>\r
+                               </tabbox>\r
+                       </east>\r
+               </borderlayout>\r
+<!--           <div hflex="true" vflex="min" align="center"> -->\r
+<!--                   <button id="reloadButton" label="Frissítés" onClick="@command('reload')" /> -->\r
+<!--                   <button id="closeButton" label="Mégsem" onClick="@command('close')" /> -->\r
+<!--                   <button id="executeButton" label="Futtatás" onClick="@command('execute')" /> -->\r
+<!--           </div> -->\r
+       </vlayout>\r
+</zk>\r
index 04f60a3f08bf17dd1ffa73debf0076079f460976..648ad922ef1a5d20b2e1842768c819ad9f7e4e66 100644 (file)
@@ -1,11 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <?taglib uri="http://www.zkoss.org/dsp/web/core" prefix="c" ?>\r
 <?init class="user.jobengine.zk.util.AdminAuthInitiator"?>\r
-<?page id="joblist"?>\r
-<!DOCTYPE xml>\r
-\r
 <zk xmlns:w="http://www.zkoss.org/2005/zk/client" xmlns:ca="client/attribute" xmlns:x="xhtml">\r
-       <style src="css/joblist.css" />\r
+       <style src="/css/joblist.css" />\r
 \r
        <!-- csak igy jo a list sebessege -->\r
        <custom-attributes org.zkoss.zul.listbox.rod="true" />\r
@@ -24,8 +21,8 @@
                        <toolbarbutton label="Feladat leállítása" iconSclass="z-icon-times-circle" onClick="@command('cancelSelectedJobs')" \r
                                disabled="@load(jlm.updatePriorityDisabled)" autodisable="self"/>\r
                        <separator orient="vertical"/>\r
-                       <toolbarbutton label="Futtatás" iconSclass="z-icon-play" onClick="@command('executeJob')" \r
-                               disabled="${not sessionScope.userPrincipal.admin}" autodisable="self" />\r
+<!--                   <toolbarbutton label="Futtatás" iconSclass="z-icon-play" onClick="@command('executeJob')"  -->\r
+<!--                           disabled="${not sessionScope.userPrincipal.admin}" autodisable="self" /> -->\r
                        <toolbarbutton label="Összes megszakítása" iconSclass="z-icon-stop" onClick="@command('cancelAllJobs')" \r
                                disabled="${not sessionScope.userPrincipal.admin}" autodisable="self" />\r
                          \r
diff --git a/server/user.mediacube.gui/pages/jobs.zul b/server/user.mediacube.gui/pages/jobs.zul
new file mode 100644 (file)
index 0000000..30f4c51
--- /dev/null
@@ -0,0 +1,20 @@
+<?page id="jobs"?>\r
+<zk xmlns:w="http://www.zkoss.org/2005/zk/client" xmlns:ca="client/attribute" xmlns:x="xhtml">\r
+       <style src="css/joblist.css" />\r
+\r
+       <tabbox id="pagesTab" vflex="true" hflex="true" orient="top">\r
+               <tabs visible="true">\r
+                       <tab id="tab0" label="Futó folyamatok" selected="true" />\r
+                       <tab id="tab1" label="Folyamat szerkesztő" />\r
+               </tabs>\r
+               <tabpanels>\r
+                       <tabpanel>\r
+                               <include src="/pages/joblist.zul" />\r
+                       </tabpanel>\r
+                       <tabpanel>\r
+                               <include src="/pages/jobeditor.zul" />\r
+                       </tabpanel>\r
+               </tabpanels>\r
+       </tabbox>\r
+\r
+</zk>
\ No newline at end of file
index 31b800c32639bc59e439b726e6e7adaf21310e2e..6080525ab46f905703e6f3cf1e301b16afa035e8 100644 (file)
@@ -2,110 +2,7 @@
 <!DOCTYPE xml>\r
 \r
 <zk xmlns:ca="client/attribute">\r
-       <window id="resultWin" title="Folyamat futtatása" sizable="true" width="70%" height="70%" border="normal"\r
-               viewModel="@id('jlm') @init('user.jobengine.zk.model.JobSelectorModel')" forward="onCancel=closeButton.onClick">\r
-               <vlayout height="100%">\r
-                       <borderlayout vflex="true">\r
-                               <center border="none" vflex="true">\r
-                                       <listbox vflex="true" model="@load(jlm.jobs)" selectedItem="@bind(jlm.selectedJob)">\r
-                                               <listhead>\r
-                                                       <listheader hflex="1" label="Név" align="left" />\r
-                                               </listhead>\r
-\r
-                                               <template name="model">\r
-<!--  Ez nagyon veszelyes, furan kezeli a zkoss, problemakat okozhat !!! -->\r
-<!--                                           <listitem onDoubleClick="@command('execute')"> -->\r
-                                                       <listitem>\r
-                                                               <listcell label="@load(empty each.name ? each.template : each.name)" />\r
-                                                       </listitem>\r
-                                               </template>\r
-                                       </listbox>\r
-                               </center>\r
-                               <east size="60%" flex="true" splittable="true" collapsible="true">\r
-                                       <tabbox id="pagesTab" vflex="true" hflex="true" orient="top">\r
-                                               <tabs visible="true">\r
-                                                       <tab id="tab0" label="Paraméterek" selected="true" />\r
-                                                       <tab id="tab1" label="Részletek" />\r
-                                                       <tab id="tab2" label="Ábra" />\r
-                                               </tabs>\r
-                                               <tabpanels>\r
-                                                       <tabpanel>\r
-                                                               <borderlayout>\r
-                                                                       <north size="50%" splittable="true">\r
-                                                                               <grid visible="@bind(not empty jlm.selectedJob)" sizedByContent="false" span="true" vflex="true"\r
-                                                                                       style="border: none; background: #e3e3e3 !important;" oddRowSclass="listbox-odd-style" \r
-                                                                                       sclass="listbox-normal-style"\r
-                                                                                       emptyMessage="A részletek megtekintéséhez jelöljön ki egy folyamatot.">\r
-                                                                                       <columns>\r
-                                                                                               <column hflex="min"/>\r
-                                                                                               <column hflex="true"/>\r
-                                                                                       </columns>\r
-                                                                                       <rows>\r
-                                                                                               <row>\r
-                                                                                                       <label value="Name"/>\r
-                                                                                                       <label value="@bind(jlm.selectedJob.name)"/>\r
-                                                                                               </row>\r
-                                                                                               <row>\r
-                                                                                                       <label value="Template"/>\r
-                                                                                                       <label value="@bind(jlm.selectedJob.template)"/>\r
-                                                                                               </row>\r
-                                                                                               <row>\r
-                                                                                                       <label value="Active"/>\r
-                                                                                                       <label value="@bind(empty jlm.selectedJob.active ? false : jlm.selectedJob.active)"/>\r
-                                                                                               </row>\r
-                                                                                               <row>\r
-                                                                                                       <label value="Execute immediate"/>\r
-                                                                                                       <label value="@bind(empty jlm.selectedJob.executeimmediate ? false : jlm.selectedJob.executeimmediate)"/>\r
-                                                                                               </row>\r
-                                                                                               <row>\r
-                                                                                                       <label value="Cron expression"/>\r
-                                                                                                       <label value="@bind(jlm.selectedJob.cronexpression)"/>\r
-                                                                                               </row>\r
-                                                                                               <row>\r
-                                                                                                       <label value="Next execution"/>\r
-                                                                                                       <label value="@bind(jlm.selectedJob.nextTime)"/>\r
-                                                                                               </row>\r
-                                                                                       </rows>\r
-                                                                               </grid>\r
-\r
-                                                                       </north>\r
-                                                                       <center border="none" flex="true">\r
-                                                                               <grid model="@load(jlm.selectedJob.parameters)" style="border: none; background: #e3e3e3 !important;"\r
-                                                                                       oddRowSclass="listbox-odd-style" sclass="listbox-normal-style">\r
-                                                                                       <columns sizable="true">\r
-                                                                                               <column label="Name" hflex="1"/>\r
-                                                                                               <column label="Value" hflex="3"/>\r
-                                                                                               <column label="Type" hflex="1"/>\r
-                                                                                       </columns>\r
-                                                                                       <rows>\r
-                                                                                               <template name="model">\r
-                                                                                                       <row>\r
-                                                                                                               <label value="@load(each.name)"/>\r
-                                                                                                               <label value="@load(each.value)"/>\r
-                                                                                                               <label value="@load(each.type)"/>\r
-                                                                                                       </row>\r
-                                                                                               </template>\r
-                                                                                       </rows>\r
-                                                                               </grid>\r
-                                                                       </center>\r
-                                                               </borderlayout>\r
-                                                       </tabpanel>\r
-                                                       <tabpanel>\r
-                                                               <label height="100%" ca:data-syntax-highlight="true" multiline="true" pre="true" \r
-                                                                       value="@bind(jlm.selectedJob['xml'])" />\r
-                                                       </tabpanel>\r
-                                                       <tabpanel>\r
-                                                               <include src="pages/processVisualizer.zul" />\r
-                                                       </tabpanel>\r
-                                               </tabpanels>\r
-                                       </tabbox>\r
-                               </east>\r
-                       </borderlayout>\r
-                       <div hflex="true" vflex="min" align="center">\r
-                               <!-- <button id="reloadButton" label="Frissítés" onClick="@command('reload')" /> -->\r
-                               <button id="closeButton" label="Mégsem" onClick="@command('close')" />\r
-                               <button id="executeButton" label="Futtatás" onClick="@command('execute')" />\r
-                       </div>\r
-               </vlayout>\r
+       <window id="resultWin" title="Folyamat futtatása" sizable="true" width="70%" height="70%" border="normal" forward="onCancel=closeButton.onClick">\r
+               <include src="/pages/jobeditor.zul" />\r
        </window>\r
 </zk>\r
index fd678321ad0bd76b3754b75e034c45bcb72a4b0b..cb01bdc8c4ed2f192f7a6961518e7859e9c3f031 100644 (file)
@@ -24,7 +24,7 @@ import user.jobengine.zk.util.SessionUtil;
 public class IndexModel extends BaseModel {\r
        private static final Logger logger = LogManager.getLogger();\r
        private String page;\r
-       private Map<String, Object> pathMap = ListUtils.asMap("/", "searchitems", "jobs", "joblist", "missingmaterials",\r
+       private Map<String, Object> pathMap = ListUtils.asMap("/", "searchitems", "jobs", "jobs", "missingmaterials",\r
                        "missingmaterials", "newshistory", "newshistory", "edithistory", "edithistory", "statistics", "statistics",\r
                        "maestro", "maestro", "pwdgen", "pwdgen");\r
 \r
similarity index 83%
rename from server/user.mediacube.gui/src/user/jobengine/zk/model/JobSelectorModel.java
rename to server/user.mediacube.gui/src/user/jobengine/zk/model/JobEditorModel.java
index 931ec81fadf9d76256d9d60c52f1bf558e7b58fe..910112502b66c3d14f870b3b0b7a0e084228ce44 100644 (file)
@@ -20,17 +20,20 @@ import org.zkoss.zk.ui.Component;
 import org.zkoss.zk.ui.Executions;\r
 import org.zkoss.zk.ui.select.Selectors;\r
 import org.zkoss.zk.ui.select.annotation.Wire;\r
+import org.zkoss.zk.ui.util.Clients;\r
 import org.zkoss.zul.ListModelList;\r
 import org.zkoss.zul.Messagebox;\r
 import org.zkoss.zul.Window;\r
 \r
 import com.ibm.nosql.json.api.BasicDBObject;\r
 \r
+import user.jobengine.gui.ComponentBinder;\r
 import user.jobengine.server.IJobEngine;\r
+import user.jobengine.server.IJobRuntime;\r
 import user.jobengine.server.scheduler.ScheduledJob;\r
 import user.jobengine.server.scheduler.SchedulerService;\r
 \r
-public class JobSelectorModel extends BaseModel {\r
+public class JobEditorModel extends BaseModel {\r
        private static final String XML = "xml";\r
        private static final String NEXT_TIME = "nextTime";\r
        private static final String TEMPLATE = "template";\r
@@ -50,7 +53,8 @@ public class JobSelectorModel extends BaseModel {
 \r
        @Command\r
        public void close() {\r
-               resultWin.detach();\r
+               if (resultWin != null)\r
+                       resultWin.detach();\r
        }\r
 \r
        @Command\r
@@ -61,17 +65,20 @@ public class JobSelectorModel extends BaseModel {
 \r
                ScheduledJob scheduledJob = jobEngine.getScheduledJob(template);\r
 \r
-               // ScheduledJob scheduledJob =\r
-               // jobEngine.getJobEngineConfiguration().createScheduledJob(selectedJob,\r
-               // jobEngine);\r
                try {\r
-                       scheduledJob.doManualJob();\r
+                       IJobRuntime runtime = scheduledJob.doManualJob();\r
+                       toast(runtime);\r
                } catch (Exception e) {\r
                        Messagebox.show(e.getMessage());\r
                }\r
                close();\r
        }\r
 \r
+       private void toast(IJobRuntime runtime) {\r
+               Clients.evalJavaScript(\r
+                               String.format("showToast('<b>%s</b> elindítva.</br>ID %d')", runtime.getName(), runtime.getId()));\r
+       }\r
+\r
        public ListModelList<BasicDBObject> getJobs() {\r
                return jobs;\r
        }\r
@@ -86,7 +93,9 @@ public class JobSelectorModel extends BaseModel {
 \r
        @Init\r
        public void init() {\r
-               this.jobEngine = (IJobEngine) Executions.getCurrent().getArg().get("jobEngine");\r
+               jobEngine = (IJobEngine) Executions.getCurrent().getArg().get("jobEngine");\r
+               if (jobEngine == null)\r
+                       jobEngine = ComponentBinder.getJobEngine();\r
 \r
                initJobList();\r
        }\r
index 9ce5c9c62bdb8f94ab0c2c50d344f13d69d1ca30..12036f40c09e6040793bf9ad41bf20a652b24915 100644 (file)
@@ -102,8 +102,13 @@ public class MaestroJobListModel extends AsyncBaseModel implements IJobChangedLi
                jobList.clear();\r
                Map<Long, IJobRuntime> jobMap = jobEngine.getJobs();\r
                for (int i = 0; i < jobMap.size(); i++) {\r
-                       if (currentUser.equals(jobMap.get(i).getOwner())) {\r
-                               jobList.add(i, jobMap.get(i));\r
+                       IJobRuntime runtime = jobMap.get(i);\r
+\r
+                       if (runtime == null)\r
+                               continue;\r
+\r
+                       if (currentUser.equals(runtime.getOwner())) {\r
+                               jobList.add(i, runtime);\r
                        }\r
                }\r
        }\r