From dc7540f4a1f26e91698a65adc13503787cc87710 Mon Sep 17 00:00:00 2001 From: Sergei Birukov Date: Fri, 22 Mar 2024 23:52:46 +0300 Subject: [PATCH] Move modals into separate components --- .gitignore | 32 ++++ webui/src/App.vue | 193 +++------------------ webui/src/components/ModalCreateClient.vue | 79 +++++++++ webui/src/components/ModalDeleteClient.vue | 66 +++++++ webui/src/components/ModalQRCode.vue | 23 +++ 5 files changed, 222 insertions(+), 171 deletions(-) create mode 100644 webui/src/components/ModalCreateClient.vue create mode 100644 webui/src/components/ModalDeleteClient.vue create mode 100644 webui/src/components/ModalQRCode.vue diff --git a/.gitignore b/.gitignore index e6fce2a6..26b25268 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,35 @@ /src/node_modules .DS_Store *.swp + +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +pnpm-debug.log* +lerna-debug.log* + +node_modules +.DS_Store +dist +dist-ssr +coverage +*.local + +/cypress/videos/ +/cypress/screenshots/ + +# Editor directories and files +.vscode/* +*.vscode-workspace +!.vscode/extensions.json +.idea +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw? + +*.tsbuildinfo diff --git a/webui/src/App.vue b/webui/src/App.vue index a676dde0..62d01f88 100644 --- a/webui/src/App.vue +++ b/webui/src/App.vue @@ -26,185 +26,37 @@
-
-

- There are no clients yet.

- -

-
-
- -
- - - -
-
-
+
+

+ There are no clients yet.

- -

+

+
+
+
+ +
+ +
+
-
- - - - - - -
+
-
- - - - - - - - -
+
@@ -231,14 +83,15 @@ import ClientNewButton from '@/components/ClientNewButton.vue'; import IconLogout from '@/components/icons/IconLogout.vue'; import IconNew from '@/components/icons/IconNew.vue'; import LoadingSpinner from '@/components/LoadingSpinner.vue'; -import IconClose from '@/components/icons/IconClose.vue'; -import IconWarning from '@/components/icons/IconWarning.vue'; import Footer from '@/components/Footer.vue'; +import ModalQRCode from '@/components/ModalQRCode.vue'; +import ModalCreateClient from '@/components/ModalCreateClient.vue'; +import ModalDeleteClient from '@/components/ModalDeleteClient.vue'; import API from '@/services/api'; import Client from '@/components/Client.vue'; -import { useStore } from './store/store'; +import { useStore } from '@/store/store'; import { storeToRefs } from 'pinia'; const store = useStore(); @@ -247,8 +100,6 @@ const { authenticated, requiresPassword } = storeToRefs(store); const { clients, clientsPersist, clientCreateShowModal, clientToDelete, clientCreateName, qrcode } = storeToRefs(store); const logout = store.logout; -const createClient = store.createClient; -const deleteClient = store.deleteClient; const currentRelease = ref(null); const latestRelease = ref(null); diff --git a/webui/src/components/ModalCreateClient.vue b/webui/src/components/ModalCreateClient.vue new file mode 100644 index 00000000..669ce8fb --- /dev/null +++ b/webui/src/components/ModalCreateClient.vue @@ -0,0 +1,79 @@ + + + + + diff --git a/webui/src/components/ModalDeleteClient.vue b/webui/src/components/ModalDeleteClient.vue new file mode 100644 index 00000000..ab43a318 --- /dev/null +++ b/webui/src/components/ModalDeleteClient.vue @@ -0,0 +1,66 @@ + + + diff --git a/webui/src/components/ModalQRCode.vue b/webui/src/components/ModalQRCode.vue new file mode 100644 index 00000000..cb42780d --- /dev/null +++ b/webui/src/components/ModalQRCode.vue @@ -0,0 +1,23 @@ + + +