From 8bb234df1cf2345ccae09a0f125da212501f85ab Mon Sep 17 00:00:00 2001 From: Andreas Dinauer Date: Sun, 12 Apr 2026 16:34:07 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Minor=20improvements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/auth/Token.ts | 11 ++++++++++ app/components/artifact/Artifact.ts | 9 ++++++++ .../settings/token/TokenCreationComponent.vue | 4 ++-- app/pages/artifacts/[id]/index.vue | 17 +++++++++++++++ app/pages/settings/index.vue | 20 ++++++++++++------ app/utils/Download.ts | 2 +- nuxt.config.ts | 4 +++- public/icon.png | Bin 0 -> 1012 bytes 8 files changed, 56 insertions(+), 11 deletions(-) create mode 100644 public/icon.png diff --git a/app/auth/Token.ts b/app/auth/Token.ts index 0dccd2a..ff79e85 100644 --- a/app/auth/Token.ts +++ b/app/auth/Token.ts @@ -3,6 +3,7 @@ export class Token static baseURL: "http://localhost:8080"; constructor( + public id: string, public name: string, public createdAt: Date, public expiresAt: Date @@ -18,6 +19,15 @@ export class Token onSuccess(response.data); }); } + + static delete(id: string, onSuccess: () => void) + { + MavenApi.create().delete("/tokens/" + id) + .then(() => + { + onSuccess(); + }); + } } export class TokenCreation @@ -42,6 +52,7 @@ export class TokenCreation export class TokenSecret { constructor( + public id: string, public name: string, public expiresAt: Date, public createdAt: Date, diff --git a/app/components/artifact/Artifact.ts b/app/components/artifact/Artifact.ts index 44e4bed..2797381 100644 --- a/app/components/artifact/Artifact.ts +++ b/app/components/artifact/Artifact.ts @@ -32,6 +32,15 @@ export class Artifact onSuccess(response.data) }); } + + static deleteById(id: string, onSuccess: () => void) + { + MavenApi.create().delete("/artifacts/" + id) + .then(() => + { + onSuccess() + }); + } } export class Version diff --git a/app/components/settings/token/TokenCreationComponent.vue b/app/components/settings/token/TokenCreationComponent.vue index 641e49c..b6fd1ae 100644 --- a/app/components/settings/token/TokenCreationComponent.vue +++ b/app/components/settings/token/TokenCreationComponent.vue @@ -24,7 +24,7 @@ diff --git a/app/pages/artifacts/[id]/index.vue b/app/pages/artifacts/[id]/index.vue index 5e8b512..412e2ea 100644 --- a/app/pages/artifacts/[id]/index.vue +++ b/app/pages/artifacts/[id]/index.vue @@ -16,6 +16,12 @@

{{ jar.filename }}

{{ selectedVersion.pom.filename }} +
+

Actions

+
+ Delete +
+

Versions

@@ -44,6 +50,14 @@ onMounted(() => { }) }) +function del() +{ + const id = useRoute().params.id as string; + Artifact.deleteById(id, () => { + useRouter().push("/artifacts"); + }) +} + const dependency = computed(() => { if (selectedVersion.value) { @@ -71,4 +85,7 @@ const dependency = computed(() => { color: white; border: none; } +.delete { + background-color: #e63515; +} \ No newline at end of file diff --git a/app/pages/settings/index.vue b/app/pages/settings/index.vue index a70dd18..a7bb652 100644 --- a/app/pages/settings/index.vue +++ b/app/pages/settings/index.vue @@ -29,22 +29,20 @@ {{ token.name }} {{ dayjs(token.createdAt).format("DD.MM.YYYY") }} {{ dayjs(token.expiresAt).format("DD.MM.YYYY") }} - +
- Create + Create