From 0e5e6934223ca831ac8eb8b201d0c3d7131caf0a Mon Sep 17 00:00:00 2001 From: minie4 Date: Mon, 20 Feb 2023 01:03:52 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=A7=91=E2=80=8D=F0=9F=92=BB=20=E2=9C=A8?= =?UTF-8?q?=20Add=20UI=20for=20generating=20API=20tokens=20(/token)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 4 +- src/components/icons/clipboard-copy-icon.vue | 21 +++ src/router/index.js | 6 + src/strings.js | 4 + src/views/TokenView.vue | 138 +++++++++++++++++++ 5 files changed, 172 insertions(+), 1 deletion(-) create mode 100644 src/components/icons/clipboard-copy-icon.vue create mode 100644 src/views/TokenView.vue diff --git a/src/App.vue b/src/App.vue index 32e08c5..1e2df4e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -20,7 +20,9 @@ const route = useRoute(); const routeName = computed(() => route.name); const isDataView = computed(() => { return ( - routeName.value != "title.settings" && routeName.value != "title.login" + routeName.value != "title.settings" && + routeName.value != "title.login" && + routeName.value != "title.token" ); }); diff --git a/src/components/icons/clipboard-copy-icon.vue b/src/components/icons/clipboard-copy-icon.vue new file mode 100644 index 0000000..1c52c13 --- /dev/null +++ b/src/components/icons/clipboard-copy-icon.vue @@ -0,0 +1,21 @@ + + + diff --git a/src/router/index.js b/src/router/index.js index 647b89d..f461e1d 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -5,6 +5,7 @@ import SubstitutionView from "../views/SubstitutionView.vue"; import HistoryView from "../views/HistoryView.vue"; import SettingsView from "../views/SettingsView.vue"; import LoginView from "../views/LoginView.vue"; +import TokenView from "../views/TokenView.vue"; const router = createRouter({ history: createWebHistory(import.meta.env.BASE_URL), @@ -38,6 +39,11 @@ const router = createRouter({ name: "title.login", component: LoginView, }, + { + path: "/token", + name: "title.token", + component: TokenView, + }, ], }); diff --git a/src/strings.js b/src/strings.js index afad8ab..53a4c8d 100644 --- a/src/strings.js +++ b/src/strings.js @@ -6,6 +6,7 @@ export const strings = { history: "History", settings: "Settings", login: "Login", + token: "Token", }, settings: { heading: { @@ -88,6 +89,9 @@ export const strings = { noHistory: "No substitutions for this day have changed yet", }, }, + token: { + header: "Generate API-Token", + }, }, de: { title: { diff --git a/src/views/TokenView.vue b/src/views/TokenView.vue new file mode 100644 index 0000000..9a30a24 --- /dev/null +++ b/src/views/TokenView.vue @@ -0,0 +1,138 @@ + + + + +