2021-12-09 05:38:56 -07:00
|
|
|
<template>
|
2021-12-09 05:45:14 -07:00
|
|
|
<div class="_formRoot">
|
|
|
|
<MkInfo>{{ $ts._instanceMute.title }}</MkInfo>
|
|
|
|
<FormTextarea v-model="instanceMutes" class="_formBlock">
|
|
|
|
<template #label>{{ $ts._instanceMute.heading }}</template>
|
|
|
|
<template #caption>{{ $ts._instanceMute.instanceMuteDescription }}<br>{{ $ts._instanceMute.instanceMuteDescription2 }}</template>
|
|
|
|
</FormTextarea>
|
|
|
|
<MkButton primary :disabled="!changed" class="_formBlock" @click="save()"><i class="fas fa-save"></i> {{ $ts.save }}</MkButton>
|
|
|
|
</div>
|
2021-12-09 05:38:56 -07:00
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
2021-12-09 05:48:57 -07:00
|
|
|
import { defineComponent } from 'vue';
|
2021-12-09 05:45:14 -07:00
|
|
|
import FormTextarea from '@/components/form/textarea.vue';
|
|
|
|
import MkInfo from '@/components/ui/info.vue';
|
|
|
|
import MkButton from '@/components/ui/button.vue';
|
2021-12-09 05:38:56 -07:00
|
|
|
import * as os from '@/os';
|
|
|
|
import * as symbols from '@/symbols';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
2021-12-09 05:45:14 -07:00
|
|
|
MkButton,
|
2021-12-09 05:38:56 -07:00
|
|
|
FormTextarea,
|
2021-12-09 05:45:14 -07:00
|
|
|
MkInfo,
|
2021-12-09 05:38:56 -07:00
|
|
|
},
|
|
|
|
|
|
|
|
emits: ['info'],
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
[symbols.PAGE_INFO]: {
|
|
|
|
title: this.$ts.instanceMute,
|
|
|
|
icon: 'fas fa-volume-mute'
|
|
|
|
},
|
|
|
|
tab: 'soft',
|
|
|
|
instanceMutes: '',
|
|
|
|
changed: false,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
2021-12-09 05:48:57 -07:00
|
|
|
watch: {
|
2021-12-09 05:38:56 -07:00
|
|
|
instanceMutes: {
|
|
|
|
handler() {
|
|
|
|
this.changed = true;
|
|
|
|
},
|
|
|
|
deep: true
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
async created() {
|
|
|
|
this.instanceMutes = this.$i.mutedInstances.join('\n');
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
async save() {
|
|
|
|
let mutes = this.instanceMutes.trim().split('\n').map(el => el.trim()).filter(el => el);
|
|
|
|
await os.api('i/update', {
|
|
|
|
mutedInstances: mutes,
|
|
|
|
});
|
|
|
|
this.changed = false;
|
|
|
|
|
|
|
|
// Refresh filtered list to signal to the user how they've been saved
|
|
|
|
this.instanceMutes = mutes.join('\n');
|
|
|
|
},
|
|
|
|
}
|
|
|
|
})
|
|
|
|
</script>
|