Добавил настройку отображения уведомлений от синхронизатора

This commit is contained in:
Book Pauk
2019-03-18 17:03:28 +07:00
parent ae4081001c
commit d520e13c88
3 changed files with 26 additions and 3 deletions

View File

@@ -110,6 +110,10 @@ class ServerStorage extends Vue {
return this.$store.state.reader.currentProfile; return this.$store.state.reader.currentProfile;
} }
get showServerStorageMessages() {
return this.settings.showServerStorageMessages;
}
checkCurrentProfile() { checkCurrentProfile() {
if (!this.profiles[this.currentProfile]) { if (!this.profiles[this.currentProfile]) {
this.commit('reader/setCurrentProfile', ''); this.commit('reader/setCurrentProfile', '');
@@ -118,14 +122,21 @@ class ServerStorage extends Vue {
notifySuccessIfNeeded(rev1, rev2) { notifySuccessIfNeeded(rev1, rev2) {
if (rev1 != rev2) if (rev1 != rev2)
this.$notify.success({message: 'Данные синхронизированы с сервером'}); this.success('Данные синхронизированы с сервером');
}
success(message) {
if (this.showServerStorageMessages)
this.$notify.success({message});
} }
warning(message) { warning(message) {
if (this.showServerStorageMessages)
this.$notify.warning({message}); this.$notify.warning({message});
} }
error(message) { error(message) {
if (this.showServerStorageMessages)
this.$notify.error({message}); this.$notify.error({message});
} }

View File

@@ -388,6 +388,7 @@
<el-form-item label="Управление"> <el-form-item label="Управление">
<el-checkbox v-model="clickControl">Включить управление кликом</el-checkbox> <el-checkbox v-model="clickControl">Включить управление кликом</el-checkbox>
</el-form-item> </el-form-item>
<el-form-item label="Подсказка"> <el-form-item label="Подсказка">
<el-tooltip :open-delay="500" effect="light"> <el-tooltip :open-delay="500" effect="light">
<template slot="content"> <template slot="content">
@@ -405,6 +406,16 @@
<el-checkbox v-model="blinkCachedLoad">Предупреждать о загрузке из кэша</el-checkbox> <el-checkbox v-model="blinkCachedLoad">Предупреждать о загрузке из кэша</el-checkbox>
</el-tooltip> </el-tooltip>
</el-form-item> </el-form-item>
<el-form-item label="Подсказка">
<el-tooltip :open-delay="500" effect="light">
<template slot="content">
Показывать уведомления и ошибки от<br>
синхронизатора данных с сервером
</template>
<el-checkbox v-model="showServerStorageMessages">Показывать сообщения синхронизации</el-checkbox>
</el-tooltip>
</el-form-item>
<el-form-item label="URL"> <el-form-item label="URL">
<el-tooltip :open-delay="500" effect="light"> <el-tooltip :open-delay="500" effect="light">
<template slot="content"> <template slot="content">

View File

@@ -165,6 +165,7 @@ const settingDefaults = {
showInlineImagesInCenter: true, showInlineImagesInCenter: true,
imageHeightLines: 100, imageHeightLines: 100,
imageFitWidth: true, imageFitWidth: true,
showServerStorageMessages: true,
fontShifts: {}, fontShifts: {},
}; };