|
|
@@ -5,12 +5,18 @@
|
|
|
{{i18n('descBlacklist')}}
|
|
|
<a href="https://violentmonkey.github.io/posts/smart-rules-for-blacklist/#blacklist-patterns" target="_blank" rel="noopener noreferrer" v-text="i18n('learnBlacklist')"></a>
|
|
|
</p>
|
|
|
- <setting-text name="blacklist" @save="onSave"/>
|
|
|
+ <div class="flex flex-wrap">
|
|
|
+ <setting-text name="blacklist" class="flex-1" @save="onSave" @bgError="errors = $event"/>
|
|
|
+ <ol v-if="errors" class="text-red">
|
|
|
+ <li v-for="e in errors" :key="e" v-text="e"/>
|
|
|
+ </ol>
|
|
|
+ </div>
|
|
|
</section>
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import { sendCmd } from '@/common';
|
|
|
+import { sendCmdDirectly } from '@/common';
|
|
|
+import { BLACKLIST_ERRORS } from '@/common/consts';
|
|
|
import { showMessage } from '@/common/ui';
|
|
|
import SettingText from '@/common/ui/setting-text';
|
|
|
|
|
|
@@ -18,11 +24,18 @@ export default {
|
|
|
components: {
|
|
|
SettingText,
|
|
|
},
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ errors: null,
|
|
|
+ };
|
|
|
+ },
|
|
|
methods: {
|
|
|
onSave() {
|
|
|
showMessage({ text: this.i18n('msgSavedBlacklist') });
|
|
|
- sendCmd('BlacklistReset');
|
|
|
},
|
|
|
},
|
|
|
+ async mounted() {
|
|
|
+ this.errors = await sendCmdDirectly('Storage', ['base', 'getOne', BLACKLIST_ERRORS]);
|
|
|
+ },
|
|
|
};
|
|
|
</script>
|