Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

Commit

Permalink
Token Modal confirm for removal (#1375)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mysterious-Dev authored Sep 29, 2023
1 parent b924855 commit f37c429
Showing 1 changed file with 28 additions and 2 deletions.
30 changes: 28 additions & 2 deletions pages/settings/pats.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
<template>
<div class="universal-card">
<ModalConfirm
ref="modal_confirm"
title="Are you sure you want to delete this token?"
description="This will remove this token forever (like really forever)."
proceed-label="Delete this token"
@proceed="removePat(deletePatIndex)"
/>
<Modal
ref="patModal"
:header="`${editPatIndex !== null ? 'Edit' : 'Create'} personal access token`"
Expand Down Expand Up @@ -132,15 +139,32 @@
>
<EditIcon /> Edit token
</button>
<button class="iconified-button raised-button" @click="removePat(pat.id)">
<button
class="iconified-button raised-button"
@click="
() => {
deletePatIndex = pat.id
$refs.modal_confirm.show()
}
"
>
<TrashIcon /> Revoke token
</button>
</div>
</div>
</div>
</template>
<script setup>
import { PlusIcon, Modal, XIcon, Checkbox, TrashIcon, EditIcon, SaveIcon } from 'omorphia'
import {
PlusIcon,
Modal,
XIcon,
Checkbox,
TrashIcon,
EditIcon,
SaveIcon,
ModalConfirm,
} from 'omorphia'
import CopyCode from '~/components/ui/CopyCode.vue'
definePageMeta({
Expand Down Expand Up @@ -193,6 +217,8 @@ const name = ref(null)
const scopesVal = ref(0)
const expires = ref(null)
const deletePatIndex = ref(null)
const loading = ref(false)
const { data: pats, refresh } = await useAsyncData('pat', () => useBaseFetch('pat'))
Expand Down

0 comments on commit f37c429

Please sign in to comment.