@@ -146,7 +150,7 @@
v-model="serverStore.loginState.useAuth"
type="checkbox"
class="peer sr-only [&:checked_+_span_svg[data-checked-icon]]:block [&:checked_+_span_svg[data-unchecked-icon]]:hidden bg-gray-200"
- @change="changeLabel"
+ @change="toggleSSH"
/>
-
-
-
-
-
-
+
+
+
+
+
@@ -307,6 +301,7 @@ const router = useRouter();
const { add } = useServerLogin();
//Refs
+
const serverNameError = ref("");
const ipError = ref("");
const usernameError = ref("");
@@ -314,7 +309,6 @@ const passwordError = ref("");
const sshError = ref("");
const message = ref("");
const devices = ref([]);
-const hovered = ref(false);
const removeHovered = ref(false);
const addHovered = ref(false);
const isFormValid = ref(false);
@@ -332,7 +326,7 @@ const buttonDisabled = computed(() => {
});
const getTrashImg = computed(() => {
- if (hovered.value) {
+ if (removeHovered.value) {
return "./img/icon/server-management-icons/trash-can-2.png";
} else {
return "./img/icon/server-management-icons/trash-can.png";
From 76ba64afe5a370b604556dec493029ed74f08f5a Mon Sep 17 00:00:00 2001
From: Max Behzadi <69126271+MaxTheGeeek@users.noreply.github.com>
Date: Mon, 15 Apr 2024 21:03:57 +0200
Subject: [PATCH 09/14] FIX: conflicts
---
.vscode/extensions.json | 2 +-
launcher/public/output.css | 22 +++++++++++++++----
.../components/login-form/LoginForm.vue | 14 ++----------
3 files changed, 21 insertions(+), 17 deletions(-)
diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index 30eb5cf6f..bafc1bb67 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -6,7 +6,7 @@
"recommendations": [
"dbaeumer.vscode-eslint",
"esbenp.prettier-vscode",
- "Vue.volar"
+ "Vue.official"
],
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
"unwantedRecommendations": []
diff --git a/launcher/public/output.css b/launcher/public/output.css
index 90027ee03..7618d731f 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 {
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 330ff535c..81076bd68 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
@@ -99,7 +99,7 @@ watchEffect, onUnmounted } from 'vue';
class="w-6 h-6 col-start-11 col-span-full self-center p-[2px] cursor-pointer hover:scale-110 active:scale-100 transition-all ease-in-out duration-200 justify-self-center"
src="/img/icon/server-management-icons/local-lan.png"
alt="Scanner Icon"
- @click="IpScanLan1"
+ @click="IpScanner"
/>
{
serverStore.loginState.keyPath = selectedFile.path;
} else {
serverStore.loginState.keyPath = "";
- message.value = "Selected file is empty.";
}
} else {
serverStore.loginState.keyPath = "";
@@ -555,15 +554,6 @@ const removeServer = () => {
serverStore.isRemoveModalActive = true;
};
-// const updateCurrentServer = async () => {
-// const currentServer = serverStore.selectedServerToConnect;
-// const config = await ControlService.readConfig();
-// const server = config.savedConnections.find((item) => item.host === currentServer.host);
-// const index = config.savedConnections.indexOf(server);
-// config.savedConnections[index] = currentServer;
-// await ControlService.writeConfig(config);
-// };
-
const internalLogin = () => {
validateForm();
if (isFormValid.value) {
From a310875e6c5dae58f97ff2c8799f32d07e9fbc43 Mon Sep 17 00:00:00 2001
From: Max Behzadi <69126271+MaxTheGeeek@users.noreply.github.com>
Date: Mon, 15 Apr 2024 21:07:32 +0200
Subject: [PATCH 10/14] REMOVE: useless
---
.../UI/server-management/components/login-form/LoginForm.vue | 2 --
1 file changed, 2 deletions(-)
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 81076bd68..32a751193 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';
Date: Mon, 15 Apr 2024 21:12:27 +0200
Subject: [PATCH 11/14] REFACTOR: best practice
---
.../components/login-form/LoginForm.vue | 27 +++----------------
1 file changed, 4 insertions(+), 23 deletions(-)
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 32a751193..66df40e68 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
@@ -334,16 +334,13 @@ const devices = ref([]);
const removeHovered = ref(false);
const addHovered = ref(false);
const isFormValid = ref(false);
+const useSSHKey = ref(false);
const usePassword = ref(false);
//*********** Computed ***********//
const buttonDisabled = computed(() => {
- if (serverNameError.value || ipError.value || usernameError.value) {
- return true;
- } else {
- return false;
- }
+ return !!(serverNameError.value || ipError.value || usernameError.value);
});
const getTrashImg = computed(() => {
@@ -354,28 +351,12 @@ const getTrashImg = computed(() => {
}
});
-const useSSHKey = computed(() => {
- if (serverStore.loginState.useAuth) {
- return true;
- } else {
- return false;
- }
-});
-
const addButtonDisabled = computed(() => {
- if (isFormValid.value) {
- return false;
- } else {
- return true;
- }
+ return !isFormValid.value;
});
const removeButtonDisabled = computed(() => {
- if (serverStore.selectedServerToConnect) {
- return false;
- } else {
- return true;
- }
+ return !serverStore.selectedServerToConnect;
});
//*********** Watchers ***********//
From e983e916e61ca6374a74059db4fea46dda7b513f Mon Sep 17 00:00:00 2001
From: Max Behzadi <69126271+MaxTheGeeek@users.noreply.github.com>
Date: Mon, 15 Apr 2024 21:32:39 +0200
Subject: [PATCH 12/14] REFACTOR: improve UI
---
.../components/ServerBody.vue | 45 +++++++++++++++----
1 file changed, 37 insertions(+), 8 deletions(-)
diff --git a/launcher/src/components/UI/server-management/components/ServerBody.vue b/launcher/src/components/UI/server-management/components/ServerBody.vue
index 959849306..ff243513e 100644
--- a/launcher/src/components/UI/server-management/components/ServerBody.vue
+++ b/launcher/src/components/UI/server-management/components/ServerBody.vue
@@ -6,7 +6,11 @@
class="col-start-14 col-span-full row-start-1 row-span-full p-1 grid grid-cols-12 grid-rows-12 bg-[#1b3231] rounded-md"
>
-
+
@@ -14,7 +18,11 @@
-
+
@@ -32,17 +40,34 @@ import { useControlStore } from "@/store/theControl";
import { computed, onUnmounted, watch } from "vue";
import { useRoute } from "vue-router";
-const emit = defineEmits(["selectServer", "serverLogin", "changePassword", "fileUpload", "deleteKey", "quickLogin"]);
+const emit = defineEmits([
+ "selectServer",
+ "serverLogin",
+ "changePassword",
+ "fileUpload",
+ "deleteKey",
+ "quickLogin",
+]);
const serverStore = useServers();
const controlStore = useControlStore();
const route = useRoute();
-const isLoginActive = computed(() => route.path === "/login" || serverStore.isServerLoginActive);
-const isSSHActive = computed(() => route.path !== "/login" && serverStore.isServerSSHActive);
-const isDetailsActive = computed(() => route.path !== "/login" && serverStore.isServerDetailsActive);
-const isUpdateActive = computed(() => route.path !== "/login" && serverStore.isServerUpdateActive);
-const isSettingsActive = computed(() => route.path !== "/login" && serverStore.isServerSettingsActive);
+const isLoginActive = computed(
+ () => route.path === "/login" || serverStore.isServerLoginActive
+);
+const isSSHActive = computed(
+ () => route.path !== "/login" && serverStore.isServerSSHActive
+);
+const isDetailsActive = computed(
+ () => route.path !== "/login" && serverStore.isServerDetailsActive
+);
+const isUpdateActive = computed(
+ () => route.path !== "/login" && serverStore.isServerUpdateActive
+);
+const isSettingsActive = computed(
+ () => route.path !== "/login" && serverStore.isServerSettingsActive
+);
watch(
() => serverStore.selectedServerConnection,
@@ -92,7 +117,11 @@ const selectServer = (server) => {
};
const addNewServer = () => {
+ serverStore.savedServers.savedConnections.forEach((s) => {
+ if (s.isSelected) s.isSelected = false;
+ });
if (serverStore.connectExistingServer) {
+ serverStore.addNewServer = false;
serverStore.connectExistingServer = false;
serverStore.selectServerToConnect = null;
}
From 400d8be81ed5ad2e2c9adea6b01ea51e3ca889c8 Mon Sep 17 00:00:00 2001
From: Max Behzadi <69126271+MaxTheGeeek@users.noreply.github.com>
Date: Tue, 16 Apr 2024 11:21:34 +0200
Subject: [PATCH 13/14] FIX: some validation fixes
---
launcher/public/output.css | 16 -----
.../components/login-form/LoginForm.vue | 62 ++++++++++++++++---
launcher/src/composables/useLogin.js | 4 +-
3 files changed, 56 insertions(+), 26 deletions(-)
diff --git a/launcher/public/output.css b/launcher/public/output.css
index 7618d731f..fb1d1f1f5 100755
--- a/launcher/public/output.css
+++ b/launcher/public/output.css
@@ -979,10 +979,6 @@ video {
top: 5rem;
}
-.top-5{
- top: 1.25rem;
-}
-
.top-8{
top: 2rem;
}
@@ -995,10 +991,6 @@ video {
top: 7rem;
}
-.-z-10{
- z-index: -10;
-}
-
.z-0{
z-index: 0;
}
@@ -2216,14 +2208,6 @@ video {
width: 100vw;
}
-.w-60{
- width: 15rem;
-}
-
-.w-40{
- width: 10rem;
-}
-
.min-w-\[100px\]{
min-width: 100px;
}
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 66df40e68..44c40a6ea 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
@@ -29,7 +29,7 @@
:placeholder="`${$t('multiServer.serverName')}`"
class="h-8 self-center col-start-1 col-end-10 row-start-2 row-span-2 shadow appearance-none border rounded w-full py-1 px-2 text-gray-800 text-sm font-semibold leading-tight focus:outline-none focus:shadow-outline bg-gray-200"
required
- @change="validateForm"
+ @change="serverNameChanged = true"
/>