mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-27 02:43:08 +02:00
Api key setting
This commit is contained in:
parent
87451b1223
commit
c00ab0fbe2
4 changed files with 51 additions and 0 deletions
|
@ -7,6 +7,7 @@ unreleased
|
||||||
* アンテナの受信ソースにグループを指定できるように
|
* アンテナの受信ソースにグループを指定できるように
|
||||||
* 時計ウィジェットを追加
|
* 時計ウィジェットを追加
|
||||||
* ログアウトせずに新しいアカウントを追加できるように
|
* ログアウトせずに新しいアカウントを追加できるように
|
||||||
|
* APIキー設定を実装
|
||||||
|
|
||||||
### 🐛Fixes
|
### 🐛Fixes
|
||||||
* v12アップデート後にトップページアクセスでOops!になっちゃうのを修正
|
* v12アップデート後にトップページアクセスでOops!になっちゃうのを修正
|
||||||
|
|
|
@ -399,6 +399,7 @@ tags: "タグ"
|
||||||
docSource: "このドキュメントのソース"
|
docSource: "このドキュメントのソース"
|
||||||
createAccount: "アカウントを作成"
|
createAccount: "アカウントを作成"
|
||||||
existingAcount: "既存のアカウント"
|
existingAcount: "既存のアカウント"
|
||||||
|
regenerate: "再生成"
|
||||||
|
|
||||||
_ago:
|
_ago:
|
||||||
unknown: "謎"
|
unknown: "謎"
|
||||||
|
|
46
src/client/pages/settings/api.vue
Normal file
46
src/client/pages/settings/api.vue
Normal file
|
@ -0,0 +1,46 @@
|
||||||
|
<template>
|
||||||
|
<section class="_card">
|
||||||
|
<div class="_title"><fa :icon="faKey"/> API</div>
|
||||||
|
<div class="_content">
|
||||||
|
<mk-input :value="$store.state.i.token" readonly>
|
||||||
|
<span>{{ $t('token') }}</span>
|
||||||
|
</mk-input>
|
||||||
|
<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 i18n from '../../i18n';
|
||||||
|
import MkButton from '../../components/ui/button.vue';
|
||||||
|
import MkInput from '../../components/ui/input.vue';
|
||||||
|
|
||||||
|
export default Vue.extend({
|
||||||
|
i18n,
|
||||||
|
components: {
|
||||||
|
MkButton, MkInput
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
faKey, faSyncAlt
|
||||||
|
};
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
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>
|
|
@ -14,6 +14,7 @@
|
||||||
<x-security/>
|
<x-security/>
|
||||||
<x-2fa/>
|
<x-2fa/>
|
||||||
<x-integration/>
|
<x-integration/>
|
||||||
|
<x-api/>
|
||||||
|
|
||||||
<mk-button @click="cacheClear()" primary class="cacheClear">{{ $t('cacheClear') }}</mk-button>
|
<mk-button @click="cacheClear()" primary class="cacheClear">{{ $t('cacheClear') }}</mk-button>
|
||||||
<mk-button @click="$root.signout()" primary class="logout">{{ $t('logout') }}</mk-button>
|
<mk-button @click="$root.signout()" primary class="logout">{{ $t('logout') }}</mk-button>
|
||||||
|
@ -34,6 +35,7 @@ import XSecurity from './security.vue';
|
||||||
import XTheme from './theme.vue';
|
import XTheme from './theme.vue';
|
||||||
import X2fa from './2fa.vue';
|
import X2fa from './2fa.vue';
|
||||||
import XIntegration from './integration.vue';
|
import XIntegration from './integration.vue';
|
||||||
|
import XApi from './api.vue';
|
||||||
import MkButton from '../../components/ui/button.vue';
|
import MkButton from '../../components/ui/button.vue';
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
|
@ -55,6 +57,7 @@ export default Vue.extend({
|
||||||
XTheme,
|
XTheme,
|
||||||
X2fa,
|
X2fa,
|
||||||
XIntegration,
|
XIntegration,
|
||||||
|
XApi,
|
||||||
MkButton,
|
MkButton,
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue