Skip to content

Commit

Permalink
デフォルトでハイライトに連合を含めるオプション
Browse files Browse the repository at this point in the history
  • Loading branch information
mei23 committed Feb 16, 2020
1 parent de88068 commit 9516cd7
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/client/app/admin/views/instance.vue
Expand Up @@ -26,6 +26,7 @@
<ui-switch v-model="disableGlobalTimeline">{{ $t('disable-global-timeline') }}</ui-switch>
<ui-info>{{ $t('disabling-timelines-info') }}</ui-info>
<ui-switch v-model="showReplayInPublicTimeline">showReplayInPublicTimeline</ui-switch>
<ui-switch v-model="featuredGlobal">デフォルトでハイライトに連合を含める</ui-switch>
</section>
<section class="fit-bottom">
<header><fa icon="cloud"/> {{ $t('drive-config') }}</header>
Expand Down Expand Up @@ -157,6 +158,7 @@ export default Vue.extend({
disableLocalTimeline: false,
disableGlobalTimeline: false,
showReplayInPublicTimeline: false,
featuredGlobal: false,
mascotImageUrl: null,
bannerUrl: null,
errorImageUrl: null,
Expand Down Expand Up @@ -209,6 +211,7 @@ export default Vue.extend({
this.disableLocalTimeline = meta.disableLocalTimeline;
this.disableGlobalTimeline = meta.disableGlobalTimeline;
this.showReplayInPublicTimeline = meta.showReplayInPublicTimeline;
this.featuredGlobal = meta.featuredGlobal;
this.mascotImageUrl = meta.mascotImageUrl;
this.bannerUrl = meta.bannerUrl;
this.errorImageUrl = meta.errorImageUrl;
Expand Down Expand Up @@ -270,6 +273,7 @@ export default Vue.extend({
disableRegistration: this.disableRegistration,
disableLocalTimeline: this.disableLocalTimeline,
disableGlobalTimeline: this.disableGlobalTimeline,
featuredGlobal: this.featuredGlobal,
showReplayInPublicTimeline: this.showReplayInPublicTimeline,
mascotImageUrl: this.mascotImageUrl,
bannerUrl: this.bannerUrl,
Expand Down
8 changes: 6 additions & 2 deletions src/client/app/desktop/views/home/featured.vue
Expand Up @@ -42,7 +42,7 @@ export default Vue.extend({
sfwOnly: false,
nsfwOnly: false,
days: 2,
fetching: true,
fetching: false,
notes: [],
};
},
Expand All @@ -64,13 +64,17 @@ export default Vue.extend({
},
},
created() {
this.fetch();
this.$root.getMeta().then((meta: any) => {
this.includeGlobal = !!meta?.featuredGlobal;
this.fetch();
});
},
mounted() {
document.title = this.$root.instanceName;
},
methods: {
fetch() {
if (this.fetching) return;
Progress.start();
this.fetching = true;
Expand Down
8 changes: 6 additions & 2 deletions src/client/app/mobile/views/pages/featured.vue
Expand Up @@ -46,7 +46,7 @@ export default Vue.extend({
sfwOnly: false,
nsfwOnly: false,
days: 2,
fetching: true,
fetching: false,
notes: [],
faNewspaper
};
Expand All @@ -69,13 +69,17 @@ export default Vue.extend({
},
},
created() {
this.fetch();
this.$root.getMeta().then((meta: any) => {
this.includeGlobal = !!meta?.featuredGlobal;
this.fetch();
});
},
mounted() {
document.title = this.$root.instanceName;
},
methods: {
fetch() {
if (this.fetching) return;
Progress.start();
this.fetching = true;
Expand Down
1 change: 1 addition & 0 deletions src/misc/build-meta.ts
Expand Up @@ -33,6 +33,7 @@ export async function buildMeta(instance: IMeta, detail = true) {
disableRegistration: instance.disableRegistration,
disableLocalTimeline: instance.disableLocalTimeline,
disableGlobalTimeline: instance.disableGlobalTimeline,
featuredGlobal: instance.featuredGlobal,
showReplayInPublicTimeline: instance.showReplayInPublicTimeline,
enableEmojiReaction: true,
driveCapacityPerLocalUserMb: instance.localDriveCapacityMb,
Expand Down
1 change: 1 addition & 0 deletions src/models/meta.ts
Expand Up @@ -194,6 +194,7 @@ export type IMeta = {
disableRegistration?: boolean;
disableLocalTimeline?: boolean;
disableGlobalTimeline?: boolean;
featuredGlobal?: boolean;
showReplayInPublicTimeline?: boolean;
enableEmojiReaction?: boolean;
useStarForReactionFallback?: boolean;
Expand Down
1 change: 1 addition & 0 deletions src/server/api/endpoints/admin/meta.ts
Expand Up @@ -105,6 +105,7 @@ export default define(meta, async (ps, me) => {
disableRegistration: instance.disableRegistration,
disableLocalTimeline: instance.disableLocalTimeline,
disableGlobalTimeline: instance.disableGlobalTimeline,
featuredGlobal: instance.featuredGlobal,
showReplayInPublicTimeline: instance.showReplayInPublicTimeline,
enableEmojiReaction: instance.enableEmojiReaction,
driveCapacityPerLocalUserMb: instance.localDriveCapacityMb,
Expand Down
11 changes: 11 additions & 0 deletions src/server/api/endpoints/admin/update-meta.ts
Expand Up @@ -48,6 +48,13 @@ export const meta = {
}
},

featuredGlobal: {
validator: $.optional.nullable.bool,
desc: {
'ja-JP': 'featuredGlobal'
}
},

hidedTags: {
validator: $.optional.nullable.arr($.str),
desc: {
Expand Down Expand Up @@ -358,6 +365,10 @@ export default define(meta, async (ps) => {
set.disableGlobalTimeline = ps.disableGlobalTimeline;
}

if (typeof ps.featuredGlobal === 'boolean') {
set.featuredGlobal = ps.featuredGlobal;
}

if (typeof ps.showReplayInPublicTimeline === 'boolean') {
set.showReplayInPublicTimeline = ps.showReplayInPublicTimeline;
}
Expand Down

0 comments on commit 9516cd7

Please sign in to comment.