インスタンス運営者がピン留めユーザーを設定できるように

Related #4892
This commit is contained in:
syuilo 2019-05-10 17:30:28 +09:00
parent 756e4eaeec
commit 8e6da3a0d9
No known key found for this signature in database
GPG key ID: BDC4C49D06AB9D69
8 changed files with 81 additions and 2 deletions

View file

@ -82,6 +82,14 @@
</section>
</ui-card>
<ui-card>
<template #title>{{ $t('pinned-users') }}</template>
<section>
<ui-textarea v-model="pinnedUsers"></ui-textarea>
<ui-button @click="updateMeta">{{ $t('save') }}</ui-button>
</section>
</ui-card>
<ui-card>
<template #title>{{ $t('invite') }}</template>
<section>
@ -190,6 +198,7 @@ export default Vue.extend({
enableServiceWorker: false,
swPublicKey: null,
swPrivateKey: null,
pinnedUsers: [],
faHeadset, faShieldAlt, faGhost, faUserPlus, farEnvelope, faBolt
};
},
@ -239,6 +248,7 @@ export default Vue.extend({
this.enableServiceWorker = meta.enableServiceWorker;
this.swPublicKey = meta.swPublickey;
this.swPrivateKey = meta.swPrivateKey;
this.pinnedUsers = meta.pinnedUsers.join('\n');
});
},
@ -297,7 +307,8 @@ export default Vue.extend({
smtpPass: this.smtpAuth ? this.smtpPass : '',
enableServiceWorker: this.enableServiceWorker,
swPublicKey: this.swPublicKey,
swPrivateKey: this.swPrivateKey
swPrivateKey: this.swPrivateKey,
pinnedUsers: this.pinnedUsers.split('\n')
}).then(() => {
this.$root.dialog({
type: 'success',

View file

@ -26,6 +26,9 @@
</mk-user-list>
<template v-if="tag == null">
<mk-user-list :make-promise="pinnedUsers">
<fa :icon="faBookmark" fixed-width/>{{ $t('pinned-users') }}
</mk-user-list>
<mk-user-list :make-promise="popularUsers">
<fa :icon="faChartLine" fixed-width/>{{ $t('popular-users') }}
</mk-user-list>
@ -57,6 +60,7 @@ export default Vue.extend({
data() {
return {
pinnedUsers: () => this.$root.api('pinned-users'),
popularUsers: () => this.$root.api('users', {
state: 'alive',
origin: 'local',