mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-06 14:48:02 -05:00
settings and model dialogs
This commit is contained in:
@@ -10,8 +10,8 @@
|
||||
<v-col cols="10">
|
||||
<v-text-field label="Token" v-model="editingObj.token" disabled></v-text-field>
|
||||
</v-col>
|
||||
<v-col cols="2">
|
||||
<v-btn color="info" variant="tonal" icon="$copy" @click="copy(editingObj.token)"></v-btn>
|
||||
<v-col cols="2" >
|
||||
<btn-copy :copy-value="editingObj.token" class="me-1"></btn-copy>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
@@ -20,10 +20,10 @@
|
||||
</v-form>
|
||||
</v-card-text>
|
||||
<v-card-actions>
|
||||
<v-btn color="save" prepend-icon="$save" @click="saveObject">{{ isUpdate ? $t('Save') : $t('Create') }}</v-btn>
|
||||
<v-btn color="delete" prepend-icon="$delete" v-if="isUpdate">{{ $t('Delete') }}
|
||||
<delete-confirm-dialog :object-name="objectName" @delete="deleteObject"></delete-confirm-dialog>
|
||||
</v-btn>
|
||||
<v-btn color="save" prepend-icon="$save" @click="saveObject">{{ isUpdate ? $t('Save') : $t('Create') }}</v-btn>
|
||||
</v-card-actions>
|
||||
</v-card>
|
||||
</template>
|
||||
@@ -38,6 +38,7 @@ import {useI18n} from "vue-i18n";
|
||||
import {ErrorMessageType, PreparedMessage, useMessageStore} from "@/stores/MessageStore";
|
||||
import {DateTime} from "luxon";
|
||||
import {useClipboard} from "@vueuse/core";
|
||||
import BtnCopy from "@/components/buttons/BtnCopy.vue";
|
||||
|
||||
const {t} = useI18n()
|
||||
const {copy} = useClipboard()
|
||||
@@ -108,7 +109,7 @@ async function deleteObject() {
|
||||
let api = new ApiApi()
|
||||
api.apiAccessTokenDestroy({id: editingObj.value.id}).then(r => {
|
||||
editingObj.value = {} as AccessToken
|
||||
emit('delete')
|
||||
emit('delete', editingObj.value)
|
||||
}).catch(err => {
|
||||
useMessageStore().addError(ErrorMessageType.DELETE_ERROR, err)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user