3.9.1 Tema alapu CSS kezeles
authorelgekko <vasary@elgekko.net>
Fri, 10 Mar 2023 14:57:43 +0000 (15:57 +0100)
committerelgekko <vasary@elgekko.net>
Fri, 10 Mar 2023 14:57:43 +0000 (15:57 +0100)
server/user.mediacube.gui/css/mediacube-silvertail.css [new file with mode: 0644]
server/user.mediacube.gui/css/mediacube-userdark.css [new file with mode: 0644]
server/user.mediacube.gui/index.zul
server/user.mediacube.gui/pages/login.zul
server/user.mediacube.gui/pages/menu.zul
server/user.mediacube.gui/resources/i3-label_hu.properties
server/user.mediacube.gui/src/user/jobengine/zk/model/IndexModel.java
server/user.mediacube.gui/src/user/jobengine/zk/model/LoginModel.java
server/user.mediacube.gui/src/user/jobengine/zk/model/MenuModel.java
server/user.mediacube.gui/src/user/jobengine/zk/util/AuthInitiator.java
server/user.mediacube.gui/src/user/jobengine/zk/util/SessionUtil.java

diff --git a/server/user.mediacube.gui/css/mediacube-silvertail.css b/server/user.mediacube.gui/css/mediacube-silvertail.css
new file mode 100644 (file)
index 0000000..139faf5
--- /dev/null
@@ -0,0 +1,35 @@
+body {\r
+    margin: 0;\r
+    padding: 0;\r
+}\r
+body *:not([class*="z-icon-"]) {\r
+       font-family: Verdana;\r
+}\r
+.loginWindow {\r
+       background-color: #212121;\r
+}\r
+.loginMessage {\r
+       color: red;\r
+}\r
+.loginTitle {\r
+       font-size:14px;\r
+       font-weight:bold;\r
+       color:#008AC8;\r
+}\r
+.loginVersion {\r
+       font-size:10px;\r
+       font-weight:bold;\r
+       color:#e3e3e3;\r
+}\r
+.z-loading { \r
+       top: 50% !important; \r
+       left: 45% !important; \r
+       align: center; \r
+       vertical-align: middle; \r
+       font-size: 18px;\r
+    font-weight: bold;\r
+       padding: 5px;\r
+}\r
+.z-notification-pointer ~ .z-notification-content {\r
+       height: 50px;\r
+}\r
diff --git a/server/user.mediacube.gui/css/mediacube-userdark.css b/server/user.mediacube.gui/css/mediacube-userdark.css
new file mode 100644 (file)
index 0000000..cc84ef3
--- /dev/null
@@ -0,0 +1,36 @@
+body {\r
+    margin: 0;\r
+    padding: 0;\r
+}\r
+body *:not([class*="z-icon-"]) {\r
+       font-family: Verdana;\r
+}\r
+.loginWindow {\r
+       background-color: #212121;\r
+}\r
+.loginMessage {\r
+       color: yellow;\r
+}\r
+.loginTitle {\r
+       font-size:14px;\r
+       font-weight:bold;\r
+       color:#008AC8;\r
+}\r
+.loginVersion {\r
+       font-size:10px;\r
+       font-weight:bold;\r
+       color:#e3e3e3;\r
+}\r
+.z-loading { \r
+       top: 50% !important; \r
+       left: 45% !important; \r
+       align: center; \r
+       vertical-align: middle; \r
+       font-size: 18px;\r
+    font-weight: bold;\r
+       padding: 5px;\r
+}\r
+.z-notification-pointer ~ .z-notification-content {\r
+       height: 50px;\r
+}\r
+\r
index f673566071dcbd7ec63202130dce5846512a392b..5118d83835b53124ee100928da61e0c6d6336fd1 100644 (file)
@@ -1,12 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
-\r
 <?init class="user.jobengine.zk.util.AuthInitiator"?>\r
-\r
 <?component name="sidewindow" inline="true" macroURI="pages/sidewindow.zul"?>\r
-\r
-<!DOCTYPE xml>\r
 <zk xmlns:w="http://www.zkoss.org/2005/zk/client">\r
-       <style src="/css/archivum.css" />\r
+       <style src="/css/mediacube-${sessionScope.theme}.css"/>\r
        <style src="/css/toast.css" />\r
        <script src="/js/toast.min.js" />\r
        <script>\r
index fc7f58f453760294b74ec0fe43f0ef85eae91962..9de0df773565852a81d1c35c07d1ce7f7e3769fb 100644 (file)
@@ -1,24 +1,24 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
-\r
-<!DOCTYPE xml>\r
 <zk>\r
-<style>\r
-input:-webkit-autofill,\r
-input:-webkit-autofill:hover, \r
-input:-webkit-autofill:focus, \r
-input:-webkit-autofill:active{\r
-    -webkit-box-shadow: 0 0 0 30px yellow inset !important;\r
-}\r
-</style>\r
-<hbox self="@define(content)" vflex="1" hflex="1" align="center" pack="center" spacing="20px">\r
+       <style>\r
+       input:-webkit-autofill,\r
+       input:-webkit-autofill:hover, \r
+       input:-webkit-autofill:focus, \r
+       input:-webkit-autofill:active{\r
+           -webkit-box-shadow: 0 0 0 30px yellow inset !important;\r
+       }\r
+       </style>\r
+       <style src="/css/mediacube-${sessionScope.theme}.css"/>\r
+       <hbox self="@define(content)" vflex="1" hflex="1" align="center" pack="center" spacing="20px">\r
         <vlayout>\r
+               <label value="${sessionScope.theme}"/>\r
             <window id="loginWin" viewModel="@id('jlm') @init('user.jobengine.zk.model.LoginModel')"\r
-                border="normal" hflex="min" >\r
+                border="normal" hflex="min" sclass="loginWindow">\r
                                <caption>\r
                                        <hbox>\r
                                                <image src="/img/mediacube_logo_v2_50x50.png" width="20px" height="20px" />\r
-                                               <label style="font-size:14px;font-weight:bold;color:#008AC8" value="MediaCube" />\r
-                                               <label style="font-size:10px;font-weight:bold;color:#e3e3e3;" value="v${labels.version}" /> \r
+                                               <label sclass="loginTitle" value="MediaCube" />\r
+                                               <label sclass="loginVersion" value="v${labels.version}" /> \r
                                        </hbox>\r
                        </caption>                \r
                 <vbox hflex="min" align="center">\r
@@ -42,7 +42,7 @@ input:-webkit-autofill:active{
                             </row>\r
                         </rows>\r
                     </grid>\r
-                    <label value="@bind(jlm.message)" />\r
+                    <label sclass="loginMessage" value="@bind(jlm.message)" />\r
                     <button label="Bejelentkezés" onClick="@command('authenticate')"/>\r
                 </vbox>\r
             </window>\r
index f24c03cc87ff83454633da2536e6bb911c10cbab..0b2e971dfa0146a3d2506eba16ca61e32a5b78dd 100644 (file)
@@ -1,11 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>\r
 <?init class="user.jobengine.zk.util.AuthInitiator"?>\r
-\r
-<!DOCTYPE xml>\r
 <zk>\r
 <!--   <style src="/css/menu.css"/> -->\r
        <div viewModel="@id('lm') @init('user.jobengine.zk.model.MenuModel')">\r
-               <menubar id="menubar" hflex="max" >\r
+               <menubar id="menubar" hflex="max">\r
                        <menuitem label="Keresés" onClick="@command('navigate', action='/')" disabled="false" />\r
                        <menuitem label="Folyamatok" onClick="@command('navigate', action='jobs')" \r
                                disabled="${(not sessionScope.userPrincipal.pooler and not sessionScope.userPrincipal.submitter) or sessionScope.userPrincipal.anonymous}" />\r
@@ -35,7 +33,7 @@
                                </menupopup>\r
                        </menu>\r
                        <menuitem label="Mini monitor" onClick="@command('createFloatingJobMonitor')" />\r
-                       <menu label="Megjelenés">\r
+                       <menu label="Megjelenés" visible="false">\r
                                <menupopup>\r
                                        <menuitem label="Világos" onClick="@command('applyTheme', name='silvertail')" />\r
                                        <menuitem label="Sötét" onClick="@command('applyTheme', name='userdark')" />\r
index e82c9922f1b7bee615e09da721c05db0a0a2cef6..532ce66da1036e74c088dad844830f6a6ce36d1b 100644 (file)
@@ -1,12 +1,4 @@
-version=2.9.0\r
-#2.9.0 Eredeti kereses optimalizalva \r
-#2.8.2 Kereses csoportos listazasa \r
-#2.8.0 Keresofelulet modositas (hardkodolt)\r
-#2.7.9 Keresofelulet modositas (hardkodolt)\r
-#2.7.8 Classloader mechanizmus atalakitasa, metadata editor history\r
-#2.7.7 Folyamat inditas dblclik tiltas\r
-#2.7.6 TSM Metadata provider, javitott GroovyClassLoader\r
-#2.7.5 ArchiveItem disableProxy, MediaFile disableProxy\r
+version=2.9.1\r
 \r
 footer=2016-2023 © Copyright User Rendszerház Kft.\r
 \r
index 7cd5f6e6b2b80aa208ccabccc78e0ceb5f11cea6..770689988f37a2f8c9ed7c9e369e6fedd5ff3fe6 100644 (file)
@@ -93,8 +93,8 @@ public class IndexModel extends BaseModel {
        }\r
 \r
        @GlobalCommand()\r
-       public void showMessage(@BindingParam("msg") String msg, String type) {\r
-               Clients.showNotification(msg, type, appTitle, "end_center", 4000);\r
+       public void showMessage(@BindingParam("msg") String msg, @BindingParam("type") String type) {\r
+               Clients.showNotification(msg, type, appTitle, "end_center", 4000, true);\r
                // Clients.evalJavaScript(String.format("showToast('%s')", "XXX"));\r
        }\r
 }
\ No newline at end of file
index 52f8c6b2576b544ba195f4c3969369e311327f8e..09feb4ae57dc0a8ca831fb08168283e5a615338d 100644 (file)
@@ -28,6 +28,7 @@ public class LoginModel extends BaseModel {
                domain = authentication.getAdHost();\r
                if (StringUtils.isNotEmpty(authentication.getDefaultUser()) && StringUtils.isNotBlank(authentication.getDefaultPassword()))\r
                        authenticate(authentication.getDefaultUser(), authentication.getDefaultPassword());\r
+\r
        }\r
 \r
        @Command\r
index fdb2a7b8b34949a5d1bade5f88463cea2632b725..40a59d981a27ae14c5c32c7a8ad99c8cfa314172 100644 (file)
@@ -127,6 +127,7 @@ public class MenuModel extends BaseModel {
        @Command\r
        public void applyTheme(@BindingParam("name") String name) {\r
                Themes.setTheme(Executions.getCurrent(), name);\r
+               SessionUtil.setAttribute("theme", name);\r
                Executions.sendRedirect("");\r
        }\r
 \r
index 4842411fa97b07799b63f38da41953cf085a4521..8282361db98d74902b1c6dce974405906590088f 100644 (file)
@@ -8,19 +8,15 @@ import org.zkoss.zk.ui.util.Initiator;
 import org.zkoss.zul.theme.Themes;\r
 \r
 /**\r
- * Ellenorzi, hogy van e beloginelt user, ha nincs, akkor -> login.zul Minden\r
- * oldal belinkeli ezt az ellenorzest.\r
+ * Ellenorzi, hogy van e beloginelt user, ha nincs, akkor -> login.zul Minden oldal belinkeli ezt az ellenorzest.\r
  */\r
 public class AuthInitiator implements Initiator {\r
        @Override\r
        public void doInit(Page page, Map<String, Object> args) throws Exception {\r
                if (!SessionUtil.isAuthenticated()) {\r
-                       String theme = SessionUtil.getMediaCubeConfig().getTheme();\r
-                       if (theme == null)\r
-                               Themes.setTheme(Executions.getCurrent(), "silvertail");\r
-                       else\r
-                               Themes.setTheme(Executions.getCurrent(), theme);\r
-\r
+                       String theme = SessionUtil.getMediaCubeConfig().getTheme() == null ? "silvertail" : SessionUtil.getMediaCubeConfig().getTheme();\r
+                       Themes.setTheme(Executions.getCurrent(), theme);\r
+                       SessionUtil.setAttribute("theme", theme);\r
                        SessionUtil.redirect("/pages/login.zul");\r
                }\r
        }\r
index 1673975ddcd4e96c04d5d06ed19f5ba3e9997ea1..98873c04cf44e59282d8738a4ee26782d07016e6 100644 (file)
@@ -60,17 +60,6 @@ public class SessionUtil implements GlobalConstants {
        public static final String GUI_EDITOR_DISABLE = "gui.editor.disable";\r
        private static final String FMT_NOTIF = "<div style='white-space:nowrap'>%s</div>";\r
 \r
-       // private static MediaCubeConfig mediaCubeConfig;\r
-       //\r
-       // static {\r
-       // try {\r
-       // mediaCubeConfig = JSONConfig.read(JOBENGINE_MEDIACUBE_CONFIG,\r
-       // MediaCubeConfig.class);\r
-       // } catch (Exception e) {\r
-       // logger.error("Critical error", e);\r
-       // }\r
-       // }\r
-\r
        public static void consoleLog(String message) {\r
                logger.info("Console log - {}", message);\r
                Clients.evalJavaScript(String.format("logToClient('%s')", message));\r