diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2020-07-18 14:28:32 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2020-07-18 14:28:32 +0900 |
| commit | b39850de012fa7b05959c7f4bbbbade841d186ff (patch) | |
| tree | f726b3b0d3125e1473d5e800e13fd26dffe1987c /src/client/components | |
| parent | fix(docs): Update api doc (diff) | |
| download | sharkey-b39850de012fa7b05959c7f4bbbbade841d186ff.tar.gz sharkey-b39850de012fa7b05959c7f4bbbbade841d186ff.tar.bz2 sharkey-b39850de012fa7b05959c7f4bbbbade841d186ff.zip | |
feat(client): AiScriptプラグインからAPIアクセスできるように
Diffstat (limited to 'src/client/components')
| -rw-r--r-- | src/client/components/token-generate-window.vue | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/src/client/components/token-generate-window.vue b/src/client/components/token-generate-window.vue index 5486ae92e7..e58dcbda78 100644 --- a/src/client/components/token-generate-window.vue +++ b/src/client/components/token-generate-window.vue @@ -3,13 +3,16 @@ <template #header>{{ title || $t('generateAccessToken') }}</template> <div class="ugkkpisj"> <div> + <mk-info warn v-if="information">{{ information }}</mk-info> + </div> + <div> <mk-input v-model="name">{{ $t('name') }}</mk-input> </div> <div> <div style="margin-bottom: 16px;"><b>{{ $t('permission') }}</b></div> <mk-button inline @click="disableAll">{{ $t('disableAll') }}</mk-button> <mk-button inline @click="enableAll">{{ $t('enableAll') }}</mk-button> - <mk-switch v-for="kind in kinds" :key="kind" v-model="permissions[kind]">{{ $t(`_permissions.${kind}`) }}</mk-switch> + <mk-switch v-for="kind in (initialPermissions || kinds)" :key="kind" v-model="permissions[kind]">{{ $t(`_permissions.${kind}`) }}</mk-switch> </div> </div> </x-window> @@ -23,6 +26,7 @@ import MkInput from './ui/input.vue'; import MkTextarea from './ui/textarea.vue'; import MkSwitch from './ui/switch.vue'; import MkButton from './ui/button.vue'; +import MkInfo from './ui/info.vue'; export default Vue.extend({ components: { @@ -31,6 +35,7 @@ export default Vue.extend({ MkTextarea, MkSwitch, MkButton, + MkInfo, }, props: { @@ -38,20 +43,41 @@ export default Vue.extend({ type: String, required: false, default: null + }, + information: { + type: String, + required: false, + default: null + }, + initialName: { + type: String, + required: false, + default: null + }, + initialPermissions: { + type: Array, + required: false, + default: null } }, data() { return { - name: null, + name: this.initialName, permissions: {}, kinds }; }, created() { - for (const kind of this.kinds) { - Vue.set(this.permissions, kind, false); + if (this.initialPermissions) { + for (const kind of this.initialPermissions) { + Vue.set(this.permissions, kind, true); + } + } else { + for (const kind of this.kinds) { + Vue.set(this.permissions, kind, false); + } } }, |