summaryrefslogtreecommitdiff
path: root/src/client/pages/my-settings/api.vue
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/pages/my-settings/api.vue')
-rw-r--r--src/client/pages/my-settings/api.vue58
1 files changed, 0 insertions, 58 deletions
diff --git a/src/client/pages/my-settings/api.vue b/src/client/pages/my-settings/api.vue
deleted file mode 100644
index 44f099ea1d..0000000000
--- a/src/client/pages/my-settings/api.vue
+++ /dev/null
@@ -1,58 +0,0 @@
-<template>
-<section class="_card">
- <div class="_title"><fa :icon="faKey"/> API</div>
- <div class="_content">
- <mk-button @click="generateToken">{{ $t('generateAccessToken') }}</mk-button>
- <mk-button @click="regenerateToken"><fa :icon="faSyncAlt"/> {{ $t('regenerate') }}</mk-button>
- </div>
-</section>
-</template>
-
-<script lang="ts">
-import Vue from 'vue';
-import { faKey, faSyncAlt } from '@fortawesome/free-solid-svg-icons';
-import MkButton from '../../components/ui/button.vue';
-import MkInput from '../../components/ui/input.vue';
-
-export default Vue.extend({
- components: {
- MkButton, MkInput
- },
- data() {
- return {
- faKey, faSyncAlt
- };
- },
- methods: {
- async generateToken() {
- this.$root.new(await import('../../components/token-generate-window.vue').then(m => m.default), {
- }).$on('ok', async ({ name, permissions }) => {
- const { token } = await this.$root.api('miauth/gen-token', {
- session: null,
- name: name,
- permission: permissions,
- });
-
- this.$root.dialog({
- type: 'success',
- title: this.$t('token'),
- text: token
- });
- });
- },
- regenerateToken() {
- this.$root.dialog({
- title: this.$t('password'),
- input: {
- type: 'password'
- }
- }).then(({ canceled, result: password }) => {
- if (canceled) return;
- this.$root.api('i/regenerate_token', {
- password: password
- });
- });
- },
- }
-});
-</script>