From 7343e6e2e8e94b2a58943c62c047b5a7c4116e3a Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 7 Sep 2018 19:20:50 +0900 Subject: 統計で無視するハッシュタグを設定できるように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/api/endpoints/admin/update-meta.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/server/api/endpoints/admin') diff --git a/src/server/api/endpoints/admin/update-meta.ts b/src/server/api/endpoints/admin/update-meta.ts index 10ca15d329..f903628774 100644 --- a/src/server/api/endpoints/admin/update-meta.ts +++ b/src/server/api/endpoints/admin/update-meta.ts @@ -21,7 +21,13 @@ export const meta = { desc: { 'ja-JP': '招待制か否か' } - }) + }), + + hidedTags: $.arr($.str).optional.nullable.note({ + desc: { + 'ja-JP': '統計などで無視するハッシュタグ' + } + }), } }; @@ -39,6 +45,10 @@ export default (params: any) => new Promise(async (res, rej) => { set.disableRegistration = ps.disableRegistration; } + if (Array.isArray(ps.hidedTags)) { + set.hidedTags = ps.hidedTags; + } + await Meta.update({}, { $set: set }, { upsert: true }); -- cgit v1.2.3-freya From 046976dffc1aa8bc02259ab4a65e74b1216a0ec3 Mon Sep 17 00:00:00 2001 From: syuilo Date: Wed, 12 Sep 2018 02:48:19 +0900 Subject: Resolve #2691 --- .../app/desktop/views/components/timeline.vue | 11 +- .../desktop/views/pages/admin/admin.dashboard.vue | 35 ++++-- src/client/app/mobile/views/pages/home.vue | 11 +- src/models/meta.ts | 1 + src/server/api/endpoints/admin/update-meta.ts | 10 ++ src/server/api/endpoints/meta.ts | 1 + src/stream.ts | 119 ++++++++++++++------- 7 files changed, 134 insertions(+), 54 deletions(-) (limited to 'src/server/api/endpoints/admin') diff --git a/src/client/app/desktop/views/components/timeline.vue b/src/client/app/desktop/views/components/timeline.vue index 52a7753438..8d72016f22 100644 --- a/src/client/app/desktop/views/components/timeline.vue +++ b/src/client/app/desktop/views/components/timeline.vue @@ -2,8 +2,8 @@
%fa:home% %i18n:@home% - %fa:R comments% %i18n:@local% - %fa:share-alt% %i18n:@hybrid% + %fa:R comments% %i18n:@local% + %fa:share-alt% %i18n:@hybrid% %fa:globe% %i18n:@global% %fa:list% {{ list.title }} @@ -29,7 +29,8 @@ export default Vue.extend({ data() { return { src: 'home', - list: null + list: null, + enableLocalTimeline: false }; }, @@ -44,6 +45,10 @@ export default Vue.extend({ }, created() { + (this as any).os.getMeta().then(meta => { + this.enableLocalTimeline = !meta.disableLocalTimeline; + }); + if (this.$store.state.device.tl) { this.src = this.$store.state.device.tl.src; if (this.src == 'list') { diff --git a/src/client/app/desktop/views/pages/admin/admin.dashboard.vue b/src/client/app/desktop/views/pages/admin/admin.dashboard.vue index ebb54d782e..c86c30db17 100644 --- a/src/client/app/desktop/views/pages/admin/admin.dashboard.vue +++ b/src/client/app/desktop/views/pages/admin/admin.dashboard.vue @@ -1,22 +1,34 @@ @@ -33,6 +45,7 @@ export default Vue.extend({ return { stats: null, disableRegistration: false, + disableLocalTimeline: false, inviteCode: null, connection: null, connectionId: null @@ -44,6 +57,7 @@ export default Vue.extend({ (this as any).os.getMeta().then(meta => { this.disableRegistration = meta.disableRegistration; + this.disableLocalTimeline = meta.disableLocalTimeline; }); (this as any).api('stats').then(stats => { @@ -61,7 +75,8 @@ export default Vue.extend({ }, updateMeta() { (this as any).api('admin/update-meta', { - disableRegistration: this.disableRegistration + disableRegistration: this.disableRegistration, + disableLocalTimeline: this.disableLocalTimeline }); } } @@ -97,4 +112,8 @@ export default Vue.extend({ border solid 1px #eee border-radius: 8px + > .form + > div + border-bottom solid 1px #eee + diff --git a/src/client/app/mobile/views/pages/home.vue b/src/client/app/mobile/views/pages/home.vue index 706c9cd28b..333ca1a7a1 100644 --- a/src/client/app/mobile/views/pages/home.vue +++ b/src/client/app/mobile/views/pages/home.vue @@ -24,8 +24,8 @@
%fa:home% %i18n:@home% - %fa:R comments% %i18n:@local% - %fa:share-alt% %i18n:@hybrid% + %fa:R comments% %i18n:@local% + %fa:share-alt% %i18n:@hybrid% %fa:globe% %i18n:@global%