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