From f9f574532e3a6baca7e04190c78600c5b334aaa0 Mon Sep 17 00:00:00 2001 From: syuilo Date: Tue, 14 May 2019 20:49:09 +0900 Subject: インスタンスブロックを設定できるように MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/client/app/admin/views/federation.vue | 36 ++++++++++++++++++++++++++++--- 1 file changed, 33 insertions(+), 3 deletions(-) (limited to 'src/client/app/admin') diff --git a/src/client/app/admin/views/federation.vue b/src/client/app/admin/views/federation.vue index 25400393b9..4d0b4b7c77 100644 --- a/src/client/app/admin/views/federation.vue +++ b/src/client/app/admin/views/federation.vue @@ -54,7 +54,6 @@ {{ $t('latest-request-received-at') }} - {{ $t('block') }} {{ $t('marked-as-closed') }}
{{ $t('charts') }} @@ -142,6 +141,16 @@ {{ $t('result-is-truncated', { n: limit }) }} + + + +
+ + + + {{ $t('save') }} +
+
@@ -149,7 +158,7 @@ import Vue from 'vue'; import i18n from '../../i18n'; import { faPaperPlane } from '@fortawesome/free-regular-svg-icons'; -import { faGlobe, faTerminal, faSearch, faMinusCircle, faServer, faCrosshairs, faEnvelopeOpenText, faUsers, faCaretDown, faCaretUp, faTrafficLight, faInbox } from '@fortawesome/free-solid-svg-icons'; +import { faBan, faGlobe, faTerminal, faSearch, faMinusCircle, faServer, faCrosshairs, faEnvelopeOpenText, faUsers, faCaretDown, faCaretUp, faTrafficLight, faInbox } from '@fortawesome/free-solid-svg-icons'; import ApexCharts from 'apexcharts'; import * as tinycolor from 'tinycolor2'; @@ -176,7 +185,8 @@ export default Vue.extend({ chartSrc: 'requests', chartSpan: 'hour', chartInstance: null, - faGlobe, faTerminal, faSearch, faMinusCircle, faServer, faCrosshairs, faEnvelopeOpenText, faUsers, faCaretDown, faCaretUp, faPaperPlane, faTrafficLight, faInbox + blockedHosts: '', + faBan, faGlobe, faTerminal, faSearch, faMinusCircle, faServer, faCrosshairs, faEnvelopeOpenText, faUsers, faCaretDown, faCaretUp, faPaperPlane, faTrafficLight, faInbox }; }, @@ -246,6 +256,10 @@ export default Vue.extend({ mounted() { this.fetchInstances(); + + this.$root.getMeta().then(meta => { + this.blockedHosts = meta.blockedHosts.join('\n'); + }); }, beforeDestroy() { @@ -477,6 +491,22 @@ export default Vue.extend({ }] }; }, + + saveBlockedHosts() { + this.$root.api('admin/update-meta', { + blockedHosts: this.blockedHosts.split('\n') + }).then(() => { + this.$root.dialog({ + type: 'success', + text: this.$t('saved') + }); + }).catch(e => { + this.$root.dialog({ + type: 'error', + text: e + }); + }); + } } }); -- cgit v1.2.3-freya