From c4ababfab85e1e99a681c58d4d9b0c7fd8636834 Mon Sep 17 00:00:00 2001 From: Max Behzadi <69126271+MaxTheGeeek@users.noreply.github.com> Date: Fri, 12 Apr 2024 13:05:04 +0200 Subject: [PATCH 01/14] REMOVE: useless --- .vscode/extensions.json | 13 ------------- .vscode/settings.json | 20 -------------------- .vscode/snippets.code-snippets | 25 ------------------------- 3 files changed, 58 deletions(-) delete mode 100644 .vscode/extensions.json delete mode 100644 .vscode/settings.json delete mode 100644 .vscode/snippets.code-snippets diff --git a/.vscode/extensions.json b/.vscode/extensions.json deleted file mode 100644 index 30eb5cf6f..000000000 --- a/.vscode/extensions.json +++ /dev/null @@ -1,13 +0,0 @@ -{ - // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. - // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp - - // List of extensions which should be recommended for users of this workspace. - "recommendations": [ - "dbaeumer.vscode-eslint", - "esbenp.prettier-vscode", - "Vue.volar" - ], - // List of extensions recommended by VS Code that should not be recommended for users of this workspace. - "unwantedRecommendations": [] -} diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 3150ee826..000000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "editor.codeActionsOnSave": { - "source.fixAll.eslint": "explicit" - }, - "editor.tabSize": 2, - "editor.detectIndentation": false, - "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode", - "nuxt.isNuxtApp": false, - "vue.features.codeActions.enable": false, - "vue.codeActions.enabled": false, - "vetur.format.enable": false, - "[vue]": { - "editor.formatOnSave": true, - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "vue3snippets.enable-compile-vue-file-on-did-save-code": true, - "javascript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false, - "typescript.format.insertSpaceAfterOpeningAndBeforeClosingEmptyBraces": false -} diff --git a/.vscode/snippets.code-snippets b/.vscode/snippets.code-snippets deleted file mode 100644 index 18aec7bcb..000000000 --- a/.vscode/snippets.code-snippets +++ /dev/null @@ -1,25 +0,0 @@ -{ - // Place your ethereum-node workspace snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and - // description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope - // is left empty or omitted, the snippet gets applied to all languages. The prefix is what is - // used to trigger the snippet and the body will be expanded and inserted. Possible variables are: - // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. - // Placeholders with the same ids are connected. - // Example: - // "Print to console": { - // "scope": "javascript,typescript", - // "prefix": "log", - // "body": [ - // "console.log('$1');", - // "$2" - // ], - // "description": "Log output to console" - // } - - "Import ControlService": { - "scope": "javascript,typescript,vue", - "prefix": "ics", - "body": ["import ControlService from '@/store/ControlService';", "$2"], - "description": "Import ControlService" - } -} From 8e69f564438aa126aec98a6ff3c76b012ba7107a Mon Sep 17 00:00:00 2001 From: Max Behzadi <69126271+MaxTheGeeek@users.noreply.github.com> Date: Fri, 12 Apr 2024 13:06:36 +0200 Subject: [PATCH 02/14] FIX: login form validation --- launcher/public/output.css | 44 +-- .../components/login-form/LoginForm.vue | 315 +++++++++--------- 2 files changed, 183 insertions(+), 176 deletions(-) diff --git a/launcher/public/output.css b/launcher/public/output.css index bb6145561..dfbfe69ea 100755 --- a/launcher/public/output.css +++ b/launcher/public/output.css @@ -1,7 +1,7 @@ @import url("https://fonts.googleapis.com/css2?family=Noto+Sans:wght@100;200;300;400;500;600;700;800;900&display=swap"); /* -! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com +! tailwindcss v3.4.3 | MIT License | https://tailwindcss.com */ /* @@ -217,6 +217,8 @@ textarea { /* 1 */ line-height: inherit; /* 1 */ + letter-spacing: inherit; + /* 1 */ color: inherit; /* 1 */ margin: 0; @@ -240,9 +242,9 @@ select { */ button, -[type='button'], -[type='reset'], -[type='submit'] { +input:where([type='button']), +input:where([type='reset']), +input:where([type='submit']) { -webkit-appearance: button; /* 1 */ background-color: transparent; @@ -524,6 +526,10 @@ video { --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; + --tw-contain-size: ; + --tw-contain-layout: ; + --tw-contain-paint: ; + --tw-contain-style: ; } ::-ms-backdrop{ @@ -574,6 +580,10 @@ video { --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; + --tw-contain-size: ; + --tw-contain-layout: ; + --tw-contain-paint: ; + --tw-contain-style: ; } ::backdrop{ @@ -624,6 +634,10 @@ video { --tw-backdrop-opacity: ; --tw-backdrop-saturate: ; --tw-backdrop-sepia: ; + --tw-contain-size: ; + --tw-contain-layout: ; + --tw-contain-paint: ; + --tw-contain-style: ; } ::-webkit-scrollbar { @@ -757,10 +771,6 @@ video { bottom: -2rem; } -.-left-12{ - left: -3rem; -} - .-left-\[1px\]{ left: -1px; } @@ -793,10 +803,6 @@ video { top: -5rem; } -.-top-7{ - top: -1.75rem; -} - .-top-8{ top: -2rem; } @@ -881,10 +887,6 @@ video { left: 8rem; } -.left-4{ - left: 1rem; -} - .left-\[1\.3rem\]{ left: 1.3rem; } @@ -3308,11 +3310,6 @@ video { background-color: rgb(22 23 23 / var(--tw-bg-opacity)); } -.bg-\[\#16181b\]{ - --tw-bg-opacity: 1; - background-color: rgb(22 24 27 / var(--tw-bg-opacity)); -} - .bg-\[\#171D22\]{ --tw-bg-opacity: 1; background-color: rgb(23 29 34 / var(--tw-bg-opacity)); @@ -3373,11 +3370,6 @@ video { background-color: rgb(27 29 31 / var(--tw-bg-opacity)); } -.bg-\[\#1b1d20\]{ - --tw-bg-opacity: 1; - background-color: rgb(27 29 32 / var(--tw-bg-opacity)); -} - .bg-\[\#1b3231\]{ --tw-bg-opacity: 1; background-color: rgb(27 50 49 / var(--tw-bg-opacity)); diff --git a/launcher/src/components/UI/server-management/components/login-form/LoginForm.vue b/launcher/src/components/UI/server-management/components/login-form/LoginForm.vue index b898546a8..f7a0c2fa6 100644 --- a/launcher/src/components/UI/server-management/components/login-form/LoginForm.vue +++ b/launcher/src/components/UI/server-management/components/login-form/LoginForm.vue @@ -1,5 +1,3 @@ -import { V2_MetaFunction } from "@remix-run/react"; import { computed, onMounted, watch, watchEffect, onUnmounted } from -'vue'; From 7d7d39e64e0ee6e89dbf186a62cc74a191e1fa47 Mon Sep 17 00:00:00 2001 From: Max Behzadi <69126271+MaxTheGeeek@users.noreply.github.com> Date: Fri, 12 Apr 2024 13:50:52 +0200 Subject: [PATCH 03/14] ADD: empty from validation --- .../UI/server-management/components/login-form/LoginForm.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/launcher/src/components/UI/server-management/components/login-form/LoginForm.vue b/launcher/src/components/UI/server-management/components/login-form/LoginForm.vue index f7a0c2fa6..e1aaf1bd4 100644 --- a/launcher/src/components/UI/server-management/components/login-form/LoginForm.vue +++ b/launcher/src/components/UI/server-management/components/login-form/LoginForm.vue @@ -316,7 +316,10 @@ const buttonDisabled = computed(() => { ipError.value.length > 0 || usernameError.value.length > 0 || (useSSHKey.value && sshError.value.length > 0) || - (!useSSHKey.value && passwordError.value.length > 0) + (!useSSHKey.value && passwordError.value.length > 0) || + serverStore.loginState.hostName === "" || + serverStore.loginState.ip === "" || + serverStore.loginState.username === "" ); }); From 456af02fd001170da421119cde8c02b994c544d9 Mon Sep 17 00:00:00 2001 From: Max Behzadi <69126271+MaxTheGeeek@users.noreply.github.com> Date: Mon, 15 Apr 2024 17:28:33 +0200 Subject: [PATCH 04/14] REFACTOR: login form --- launcher/package.json | 4 +- .../icon/server-management-icons/write.png | Bin 0 -> 6334 bytes .../components/login-form/LoginForm.vue | 321 +++++++++--------- 3 files changed, 160 insertions(+), 165 deletions(-) create mode 100755 launcher/public/img/icon/server-management-icons/write.png diff --git a/launcher/package.json b/launcher/package.json index a4b5cffc1..8699aa72e 100755 --- a/launcher/package.json +++ b/launcher/package.json @@ -48,6 +48,7 @@ "semver": "^7.6.0", "ssh2": "^1.1.0", "swiper": "^11.0.6", + "vee-validate": "^4.12.6", "vue": "^3.2.33", "vue-i18n": "9.2.2", "vue-router": "^4.0.15", @@ -57,7 +58,8 @@ "xterm": "^5.3.0", "xterm-addon-attach": "^0.9.0", "xterm-addon-fit": "^0.8.0", - "yaml": "^2.2.1" + "yaml": "^2.2.1", + "yup": "^1.4.0" }, "devDependencies": { "@tailwindcss/forms": "^0.5.2", diff --git a/launcher/public/img/icon/server-management-icons/write.png b/launcher/public/img/icon/server-management-icons/write.png new file mode 100755 index 0000000000000000000000000000000000000000..782c40dbfca507663a6caf39fd93bbee6b71f4b5 GIT binary patch literal 6334 zcmeHL`#Y3d`(N{5ORDMBrle5KIAk)mDI%wKiD6Jw#v!I0cPgTqL}u*vcXw8vam+C) zNpecg&9o~u2$`BE?CB>w!h=sR z4@L$7CX;FW+p(~yfP)c1#^I468RJ%~0a)cs-MM}5>CCadv-gkwc0lK!iL4rmZ(97{ zS=;;9ozu-*e{_ddUMrg%k5fNqcGyKLAmGpiy}Z!3rP;Wn@u3-e=kp7TCw6Vxe>D$X zbb-2OH!0;3IrJb~GdSrllkcs~x1++PbY|2<&Gfe@;roz@d8<*c95<|mK;a9RZQ0R} zxedaeQ33?}-~449&l3U=+nSHY{)TFyv2kdKo~WMCrB`Fj-$H%h6v;%}2o_m_6;z2O zU%5^CW1cDr?m9=Y)&T4?52#o&^%xCPr#?2}t82|n_h$>%Qv1^d#Z;T}c$PkhSmH^D zK8Q-wCbPsfYXxp-EE9E@7;IApzJgkUZQ5j?$k>U+?M)RFpjKhcto3lY;ejER-+58S1JKLJbuXE=P$z2u_j-()awI z2w3xU1aun?4Y-nU;M*TqI2nd}&(8dsaGDZb>`i0?a&5{iz9lXw*>t#{I63I z1HPwzO`TBJBhr2h2U1q$iM?7>(fTd?%1Y&QHBZ3SIFKQj;AGyjUc|wK1Tr;}HMac@ zPaWji`>PGLz3xjAaCcS}Kf|kpz79By=LMdPLd`q04=pAEyUV?=o*%EbWvicPNe48u2U8Uay$z@2U~-@Ea4YH{p92wLLkJ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hXqnC7JiF?KW8b zlor@CBrPS7T_QbDvMbg>z`I56d!EktV3Pq~6m(p%$AoYT_)C28sDT__hWQ)d!wqFlO^D)B+du#VAqI>cyu^jeqptu4op6AFWw$+Qx2PO5UH=Zg;>aHC;9niDzeG}zA&6MZR}U!^a4-E;2#-{(!^8u0XiDUR4~Y@PSt zdc4V)d{{(&FRs()8*#*^WY@@71eSK&7~5rrt7+?6moL<mJQ!qLO{C-3Shd~;$=g-|!_485_0Y<)|p+n)FqzMiMs{t_|n z30woM7+>0I2;np=k5(n-Oin&-(lHyoK_C}e?>rji4_bp_7wev_q42vx>feWaEtznE z*E-i0iL|(e4EU#`R?W|d2yIkMt5W&>a;D_zsaKLGb{g!-pMJSB@kw*whqQtqEx6bZ^7!?iW9({hUdoMBeM(Y=I83rWigOrGUf? zLg6EOqvzb3rv>HH<>HTT#ACAWvLWzA>BeINz7J|uCe$@qr{jXXc{O3NUb!5s8P`I^ zJJA=N+5)xd;QA%3$+~GD@@z~MF*^6nkt1CJrhYeP%ONgB@j=uxQ2Y|T47)45tw=5T z%wRF;)JmIl)!T8$%gB=cfw9nKJ>PQ)(vAG-Mhe2P4MD}BsLw}=^sE<17*?S^-oWQN zVuAp1Olwg6&(gn1EaeHzs;JuLQ$EVwq=9p6JTDgiikdfi&M$-QzfE0}W!Q3=V`a;) zFf~^0%9e&Ov)W!nMwboTn4G#xsnfpk;6TPCrB#a)OGOKa(WlX(uw_a
@@ -112,6 +119,8 @@ const loginHandler = async () => { serverStore.connectingProcess = true; serverStore.isServerAnimationActive = true; await ControlService.logout(); + serverStore.loginState = {}; + // serverStore.selectedServerToConnect await ControlService.stopShell(); await login(loginAbortController.signal); @@ -178,7 +187,9 @@ const serverHandler = (server) => { server.isSelected = true; } - serverStore.savedServers.savedConnections = [...serverStore.savedServers.savedConnections]; + serverStore.savedServers.savedConnections = [ + ...serverStore.savedServers.savedConnections, + ]; }; //Change password handling @@ -210,7 +221,8 @@ const removeServerHandler = async () => { serverStore.isRemoveProcessing = true; serverStore.savedServers.savedConnections = serverStore.savedServers.savedConnections.filter( (item) => - item.host !== serverStore.selectedServerToConnect?.host && item.name !== serverStore.selectedServerToConnect?.name + item.host !== serverStore.selectedServerToConnect?.host && + item.name !== serverStore.selectedServerToConnect?.name ); await remove(); @@ -234,7 +246,9 @@ const readSSHKeyFile = async () => { const confirmDelete = async (key) => { serverStore.sshKeys = serverStore.sshKeys.filter((item) => item !== key); try { - await ControlService.writeSSHKeyFile(serverStore.sshKeys.filter((item) => item !== key)); + await ControlService.writeSSHKeyFile( + serverStore.sshKeys.filter((item) => item !== key) + ); await readSSHKeyFile(); } catch (err) { console.log(err); diff --git a/launcher/src/components/UI/server-management/components/login-form/LoginForm.vue b/launcher/src/components/UI/server-management/components/login-form/LoginForm.vue index 44c40a6ea..2739ab903 100644 --- a/launcher/src/components/UI/server-management/components/login-form/LoginForm.vue +++ b/launcher/src/components/UI/server-management/components/login-form/LoginForm.vue @@ -2,25 +2,19 @@
-
+
Login to server
-
+
{{ serverNameError ? serverNameError : `${$t("multiServer.serverName")}` }}
-
+
-
+
-
+
-
+
{{ $t("formsetup.usessh") }} - +
@@ -222,20 +206,13 @@ for="keypath-file" class="h-8 col-start-12 col-span-full row-start-2 row-span-2 self-center w-full flex justify-center items-center cursor-pointer bg-gray-200 rounded-r-md" > -
+
+
- +
-
+