2021-06-25 13:55:49 +00:00
|
|
|
|
<template>
|
2021-08-19 18:37:59 +00:00
|
|
|
|
<transition name="slide-fade" appear>
|
|
|
|
|
<div>
|
|
|
|
|
<h1 v-show="show" class="mb-3">
|
2021-08-24 08:44:58 +00:00
|
|
|
|
{{ $t("Settings") }}
|
2021-08-19 18:37:59 +00:00
|
|
|
|
</h1>
|
|
|
|
|
|
|
|
|
|
<div class="shadow-box">
|
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-6">
|
2021-08-24 08:44:58 +00:00
|
|
|
|
<h2 class="mb-2">{{ $t("Appearance") }}</h2>
|
2021-08-19 18:37:59 +00:00
|
|
|
|
|
2021-08-24 08:44:58 +00:00
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label for="language" class="form-label">{{ $t("Language") }}</label>
|
|
|
|
|
<select id="language" v-model="$i18n.locale" class="form-select">
|
|
|
|
|
<option v-for="(lang, i) in $i18n.availableLocales" :key="`Lang${i}`" :value="lang">
|
|
|
|
|
{{ $i18n.messages[lang].languageName }}
|
|
|
|
|
</option>
|
|
|
|
|
</select>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="mb-3">
|
|
|
|
|
<label for="timezone" class="form-label">{{ $t("Theme") }}</label>
|
2021-08-08 17:58:24 +00:00
|
|
|
|
|
2021-08-24 08:44:58 +00:00
|
|
|
|
<div>
|
|
|
|
|
<div class="btn-group" role="group" aria-label="Basic checkbox toggle button group">
|
|
|
|
|
<input id="btncheck1" v-model="$root.userTheme" type="radio" class="btn-check" name="theme" autocomplete="off" value="light">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
<label class="btn btn-outline-primary" for="btncheck1">{{ $t("Light") }}</label>
|
2021-08-15 18:46:21 +00:00
|
|
|
|
|
2021-08-24 08:44:58 +00:00
|
|
|
|
<input id="btncheck2" v-model="$root.userTheme" type="radio" class="btn-check" name="theme" autocomplete="off" value="dark">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
<label class="btn btn-outline-primary" for="btncheck2">{{ $t("Dark") }}</label>
|
2021-08-15 18:46:21 +00:00
|
|
|
|
|
2021-08-24 08:44:58 +00:00
|
|
|
|
<input id="btncheck3" v-model="$root.userTheme" type="radio" class="btn-check" name="theme" autocomplete="off" value="auto">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
<label class="btn btn-outline-primary" for="btncheck3">{{ $t("Auto") }}</label>
|
2021-08-19 18:37:59 +00:00
|
|
|
|
</div>
|
2021-08-15 18:46:21 +00:00
|
|
|
|
</div>
|
2021-08-24 08:44:58 +00:00
|
|
|
|
</div>
|
2021-08-08 05:47:29 +00:00
|
|
|
|
|
2021-08-24 08:44:58 +00:00
|
|
|
|
<div class="mb-3">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
<label class="form-label">{{ $t("Theme - Heartbeat Bar") }}</label>
|
2021-08-24 08:44:58 +00:00
|
|
|
|
<div>
|
|
|
|
|
<div class="btn-group" role="group" aria-label="Basic checkbox toggle button group">
|
|
|
|
|
<input id="btncheck4" v-model="$root.userHeartbeatBar" type="radio" class="btn-check" name="heartbeatBarTheme" autocomplete="off" value="normal">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
<label class="btn btn-outline-primary" for="btncheck4">{{ $t("Normal") }}</label>
|
2021-08-19 18:37:59 +00:00
|
|
|
|
|
2021-08-24 08:44:58 +00:00
|
|
|
|
<input id="btncheck5" v-model="$root.userHeartbeatBar" type="radio" class="btn-check" name="heartbeatBarTheme" autocomplete="off" value="bottom">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
<label class="btn btn-outline-primary" for="btncheck5">{{ $t("Bottom") }}</label>
|
2021-08-19 18:37:59 +00:00
|
|
|
|
|
2021-08-24 08:44:58 +00:00
|
|
|
|
<input id="btncheck6" v-model="$root.userHeartbeatBar" type="radio" class="btn-check" name="heartbeatBarTheme" autocomplete="off" value="none">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
<label class="btn btn-outline-primary" for="btncheck6">{{ $t("None") }}</label>
|
2021-08-19 18:37:59 +00:00
|
|
|
|
</div>
|
2021-07-31 15:41:24 +00:00
|
|
|
|
</div>
|
2021-08-24 08:44:58 +00:00
|
|
|
|
</div>
|
2021-07-31 15:41:24 +00:00
|
|
|
|
|
2021-08-24 08:44:58 +00:00
|
|
|
|
<h2 class="mt-5 mb-2">{{ $t("General") }}</h2>
|
|
|
|
|
<form class="mb-3" @submit.prevent="saveGeneral">
|
2021-07-31 15:41:24 +00:00
|
|
|
|
<div class="mb-3">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
<label for="timezone" class="form-label">{{ $t("Timezone") }}</label>
|
2021-08-19 18:37:59 +00:00
|
|
|
|
<select id="timezone" v-model="$root.userTimezone" class="form-select">
|
|
|
|
|
<option value="auto">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
{{ $t("Auto") }}: {{ guessTimezone }}
|
2021-08-19 18:37:59 +00:00
|
|
|
|
</option>
|
|
|
|
|
<option v-for="(timezone, index) in timezoneList" :key="index" :value="timezone.value">
|
|
|
|
|
{{ timezone.name }}
|
|
|
|
|
</option>
|
|
|
|
|
</select>
|
2021-07-31 15:41:24 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="mb-3">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
<label class="form-label">{{ $t("Search Engine Visibility") }}</label>
|
2021-08-19 18:37:59 +00:00
|
|
|
|
|
|
|
|
|
<div class="form-check">
|
|
|
|
|
<input id="searchEngineIndexYes" v-model="settings.searchEngineIndex" class="form-check-input" type="radio" name="flexRadioDefault" :value="true" required>
|
|
|
|
|
<label class="form-check-label" for="searchEngineIndexYes">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
{{ $t("Allow indexing") }}
|
2021-08-19 18:37:59 +00:00
|
|
|
|
</label>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="form-check">
|
|
|
|
|
<input id="searchEngineIndexNo" v-model="settings.searchEngineIndex" class="form-check-input" type="radio" name="flexRadioDefault" :value="false" required>
|
|
|
|
|
<label class="form-check-label" for="searchEngineIndexNo">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
{{ $t("Discourage search engines from indexing site") }}
|
2021-08-19 18:37:59 +00:00
|
|
|
|
</label>
|
2021-07-31 15:41:24 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<button class="btn btn-primary" type="submit">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
{{ $t("Save") }}
|
2021-07-31 15:41:24 +00:00
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
|
2021-08-19 18:37:59 +00:00
|
|
|
|
<template v-if="loaded">
|
|
|
|
|
<template v-if="! settings.disableAuth">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
<h2 class="mt-5 mb-2">{{ $t("Change Password") }}</h2>
|
2021-08-19 18:37:59 +00:00
|
|
|
|
<form class="mb-3" @submit.prevent="savePassword">
|
|
|
|
|
<div class="mb-3">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
<label for="current-password" class="form-label">{{ $t("Current Password") }}</label>
|
2021-08-19 18:37:59 +00:00
|
|
|
|
<input id="current-password" v-model="password.currentPassword" type="password" class="form-control" required>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="mb-3">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
<label for="new-password" class="form-label">{{ $t("New Password") }}</label>
|
2021-08-19 18:37:59 +00:00
|
|
|
|
<input id="new-password" v-model="password.newPassword" type="password" class="form-control" required>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div class="mb-3">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
<label for="repeat-new-password" class="form-label">{{ $t("Repeat New Password") }}</label>
|
2021-08-19 18:37:59 +00:00
|
|
|
|
<input id="repeat-new-password" v-model="password.repeatNewPassword" type="password" class="form-control" :class="{ 'is-invalid' : invalidPassword }" required>
|
|
|
|
|
<div class="invalid-feedback">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
{{ $t("passwordNotMatchMsg") }}
|
2021-08-19 18:37:59 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<div>
|
|
|
|
|
<button class="btn btn-primary" type="submit">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
{{ $t("Update Password") }}
|
2021-08-19 18:37:59 +00:00
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</form>
|
|
|
|
|
</template>
|
|
|
|
|
|
2021-08-24 10:26:44 +00:00
|
|
|
|
<h2 class="mt-5 mb-2">{{ $t("Advanced") }}</h2>
|
2021-06-25 13:55:49 +00:00
|
|
|
|
|
2021-08-19 18:37:59 +00:00
|
|
|
|
<div class="mb-3">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
<button v-if="settings.disableAuth" class="btn btn-outline-primary me-1" @click="enableAuth">{{ $t("Enable Auth") }}</button>
|
|
|
|
|
<button v-if="! settings.disableAuth" class="btn btn-primary me-1" @click="confirmDisableAuth">{{ $t("Disable Auth") }}</button>
|
|
|
|
|
<button v-if="! settings.disableAuth" class="btn btn-danger me-1" @click="$root.logout">{{ $t("Logout") }}</button>
|
2021-08-31 22:36:24 +00:00
|
|
|
|
<button class="btn btn-outline-danger me-1" @click="confirmClearStatistics">{{ $t("Clear all Statistics") }}</button>
|
2021-08-19 18:37:59 +00:00
|
|
|
|
</div>
|
|
|
|
|
</template>
|
2021-06-25 13:55:49 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
2021-08-19 18:37:59 +00:00
|
|
|
|
<div class="notification-list col-md-6">
|
|
|
|
|
<div v-if="$root.isMobile" class="mt-3" />
|
|
|
|
|
|
2021-08-24 10:26:44 +00:00
|
|
|
|
<h2>{{ $t("Notifications") }}</h2>
|
2021-08-19 18:37:59 +00:00
|
|
|
|
<p v-if="$root.notificationList.length === 0">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
{{ $t("Not available, please setup.") }}
|
2021-08-19 18:37:59 +00:00
|
|
|
|
</p>
|
|
|
|
|
<p v-else>
|
2021-08-24 10:26:44 +00:00
|
|
|
|
{{ $t("notificationDescription") }}
|
2021-08-19 18:37:59 +00:00
|
|
|
|
</p>
|
|
|
|
|
|
|
|
|
|
<ul class="list-group mb-3" style="border-radius: 1rem;">
|
|
|
|
|
<li v-for="(notification, index) in $root.notificationList" :key="index" class="list-group-item">
|
|
|
|
|
{{ notification.name }}<br>
|
2021-08-24 10:26:44 +00:00
|
|
|
|
<a href="#" @click="$refs.notificationDialog.show(notification.id)">{{ $t("Edit") }}</a>
|
2021-08-19 18:37:59 +00:00
|
|
|
|
</li>
|
|
|
|
|
</ul>
|
|
|
|
|
|
|
|
|
|
<button class="btn btn-primary me-2" type="button" @click="$refs.notificationDialog.show()">
|
2021-08-24 10:26:44 +00:00
|
|
|
|
{{ $t("Setup Notification") }}
|
2021-08-19 18:37:59 +00:00
|
|
|
|
</button>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2021-06-25 13:55:49 +00:00
|
|
|
|
</div>
|
|
|
|
|
|
2021-08-29 18:22:49 +00:00
|
|
|
|
<footer>
|
|
|
|
|
<div class="container-fluid">
|
|
|
|
|
Uptime Kuma -
|
|
|
|
|
{{ $t("Version") }}: {{ $root.info.version }} -
|
|
|
|
|
<a href="https://github.com/louislam/uptime-kuma/releases" target="_blank" rel="noopener">{{ $t("Check Update On GitHub") }}</a>
|
|
|
|
|
</div>
|
|
|
|
|
</footer>
|
|
|
|
|
|
2021-08-19 18:37:59 +00:00
|
|
|
|
<NotificationDialog ref="notificationDialog" />
|
2021-07-31 13:57:58 +00:00
|
|
|
|
|
2021-08-24 10:26:44 +00:00
|
|
|
|
<Confirm ref="confirmDisableAuth" btn-style="btn-danger" :yes-text="$t('I understand, please disable')" :no-text="$t('Leave')" @yes="disableAuth">
|
|
|
|
|
<template v-if="$i18n.locale === 'en' ">
|
|
|
|
|
<p>Are you sure want to <strong>disable auth</strong>?</p>
|
|
|
|
|
<p>It is for <strong>someone who have 3rd-party auth</strong> in front of Uptime Kuma such as Cloudflare Access.</p>
|
|
|
|
|
<p>Please use it carefully.</p>
|
|
|
|
|
</template>
|
|
|
|
|
|
2021-09-02 14:23:07 +00:00
|
|
|
|
<template v-if="$i18n.locale === 'es-ES' ">
|
|
|
|
|
<p>Seguro que deseas <strong>deshabilitar la autenticación</strong>?</p>
|
|
|
|
|
<p>Es para <strong>quien implementa autenticación de terceros</strong> ante Uptime Kuma como por ejemplo Cloudflare Access.</p>
|
|
|
|
|
<p>Por favor usar con cuidado.</p>
|
|
|
|
|
</template>
|
|
|
|
|
|
2021-08-24 10:26:44 +00:00
|
|
|
|
<template v-if="$i18n.locale === 'zh-HK' ">
|
|
|
|
|
<p>你是否確認<strong>取消登入認証</strong>?</p>
|
|
|
|
|
<p>這個功能是設計給已有<strong>第三方認証</strong>的用家,例如 Cloudflare Access。</p>
|
|
|
|
|
<p>請小心使用。</p>
|
|
|
|
|
</template>
|
2021-08-26 00:43:26 +00:00
|
|
|
|
|
2021-09-03 05:33:26 +00:00
|
|
|
|
<template v-if="$i18n.locale === 'zh-CN' ">
|
|
|
|
|
<p>是否确定 <strong>取消登录验证</strong>?</p>
|
|
|
|
|
<p>这是为 <strong>有第三方认证</strong> 的用户提供的功能,如 Cloudflare Access</p>
|
|
|
|
|
<p>请谨慎使用!</p>
|
|
|
|
|
</template>
|
|
|
|
|
|
2021-08-26 00:43:26 +00:00
|
|
|
|
<template v-if="$i18n.locale === 'de-DE' ">
|
|
|
|
|
<p>Bist du sicher das du die <strong>Authentifizierung deaktivieren</strong> möchtest?</p>
|
|
|
|
|
<p>Es ist für <strong>jemanden der eine externe Authentifizierung</strong> vor Uptime Kuma geschaltet hat, wie z.B. Cloudflare Access.</p>
|
|
|
|
|
<p>Bitte mit Vorsicht nutzen.</p>
|
|
|
|
|
</template>
|
2021-09-03 00:06:26 +00:00
|
|
|
|
|
|
|
|
|
<template v-if="$i18n.locale === 'sr' ">
|
|
|
|
|
<p>Да ли сте сигурни да желите да <strong>искључите аутентификацију</strong>?</p>
|
|
|
|
|
<p>То је за <strong>оне који имају додату аутентификацију</strong> испред Uptime Kuma као на пример Cloudflare Access.</p>
|
2021-09-03 00:24:31 +00:00
|
|
|
|
<p>Молим Вас користите ово са пажњом.</p>
|
2021-09-03 00:06:26 +00:00
|
|
|
|
</template>
|
2021-09-03 06:32:12 +00:00
|
|
|
|
|
2021-09-03 00:20:01 +00:00
|
|
|
|
<template v-if="$i18n.locale === 'sr-latn' ">
|
|
|
|
|
<p>Da li ste sigurni da želite da <strong>isključite autentifikaciju</strong>?</p>
|
|
|
|
|
<p>To je za <strong>one koji imaju dodatu autentifikaciju</strong> ispred Uptime Kuma kao na primer Cloudflare Access.</p>
|
|
|
|
|
<p>Molim Vas koristite ovo sa pažnjom.</p>
|
|
|
|
|
</template>
|
2021-09-03 14:18:18 +00:00
|
|
|
|
|
|
|
|
|
<template v-if="$i18n.locale === 'ko-KR' ">
|
|
|
|
|
<p>정말로 <strong>인증 기능을 끌까요</strong>?</p>
|
|
|
|
|
<p>이 기능은 <strong>Cloudflare Access와 같은 서드파티 인증</strong>을 Uptime Kuma 앞에 둔 사용자를 위한 기능이에요.</p>
|
|
|
|
|
<p>신중하게 사용하세요.</p>
|
|
|
|
|
</template>
|
2021-09-04 20:38:53 +00:00
|
|
|
|
<template v-if="$i18n.locale === 'pl' ">
|
|
|
|
|
<p>Czy na pewno chcesz <strong>wyłączyć autoryzację</strong>?</p>
|
|
|
|
|
<p>Jest przeznaczony dla <strong>kogoś, kto ma autoryzację zewnętrzną</strong> przed Uptime Kuma, taką jak Cloudflare Access.</p>
|
|
|
|
|
<p>Proszę używać ostrożnie.</p>
|
|
|
|
|
</template>
|
2021-08-19 18:37:59 +00:00
|
|
|
|
</Confirm>
|
2021-08-31 22:36:24 +00:00
|
|
|
|
|
|
|
|
|
<Confirm ref="confirmClearStatistics" btn-style="btn-danger" :yes-text="$t('Yes')" :no-text="$t('No')" @yes="clearStatistics">
|
|
|
|
|
{{ $t("confirmClearStatisticsMsg") }}
|
|
|
|
|
</Confirm>
|
2021-08-19 18:37:59 +00:00
|
|
|
|
</div>
|
|
|
|
|
</transition>
|
2021-06-25 13:55:49 +00:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2021-07-31 13:57:58 +00:00
|
|
|
|
import Confirm from "../components/Confirm.vue";
|
2021-06-30 18:02:54 +00:00
|
|
|
|
import dayjs from "dayjs";
|
2021-07-27 17:47:13 +00:00
|
|
|
|
import utc from "dayjs/plugin/utc"
|
|
|
|
|
import timezone from "dayjs/plugin/timezone"
|
2021-07-09 09:55:48 +00:00
|
|
|
|
import NotificationDialog from "../components/NotificationDialog.vue";
|
2021-06-30 18:02:54 +00:00
|
|
|
|
dayjs.extend(utc)
|
|
|
|
|
dayjs.extend(timezone)
|
2021-07-31 13:57:58 +00:00
|
|
|
|
|
2021-07-27 17:47:13 +00:00
|
|
|
|
import { timezoneList } from "../util-frontend";
|
|
|
|
|
import { useToast } from "vue-toastification"
|
2021-07-01 13:47:14 +00:00
|
|
|
|
const toast = useToast()
|
2021-06-25 13:55:49 +00:00
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
2021-07-27 17:47:13 +00:00
|
|
|
|
NotificationDialog,
|
2021-07-31 13:57:58 +00:00
|
|
|
|
Confirm,
|
2021-06-25 13:55:49 +00:00
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
2021-06-30 18:02:54 +00:00
|
|
|
|
timezoneList: timezoneList(),
|
|
|
|
|
guessTimezone: dayjs.tz.guess(),
|
2021-08-19 18:37:59 +00:00
|
|
|
|
show: true,
|
2021-06-25 13:55:49 +00:00
|
|
|
|
invalidPassword: false,
|
|
|
|
|
password: {
|
|
|
|
|
currentPassword: "",
|
|
|
|
|
newPassword: "",
|
|
|
|
|
repeatNewPassword: "",
|
2021-07-27 17:47:13 +00:00
|
|
|
|
},
|
2021-07-31 13:57:58 +00:00
|
|
|
|
settings: {
|
|
|
|
|
|
2021-07-31 15:41:24 +00:00
|
|
|
|
},
|
|
|
|
|
loaded: false,
|
2021-06-25 13:55:49 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
2021-07-27 17:47:13 +00:00
|
|
|
|
watch: {
|
|
|
|
|
"password.repeatNewPassword"() {
|
|
|
|
|
this.invalidPassword = false;
|
|
|
|
|
},
|
2021-08-24 08:44:58 +00:00
|
|
|
|
|
|
|
|
|
"$i18n.locale"() {
|
|
|
|
|
localStorage.locale = this.$i18n.locale;
|
|
|
|
|
},
|
2021-07-27 17:47:13 +00:00
|
|
|
|
},
|
2021-07-01 13:47:14 +00:00
|
|
|
|
|
|
|
|
|
mounted() {
|
2021-07-31 13:57:58 +00:00
|
|
|
|
this.loadSettings();
|
2021-07-01 13:47:14 +00:00
|
|
|
|
},
|
|
|
|
|
|
2021-06-25 13:55:49 +00:00
|
|
|
|
methods: {
|
2021-07-01 13:47:14 +00:00
|
|
|
|
|
|
|
|
|
saveGeneral() {
|
|
|
|
|
localStorage.timezone = this.$root.userTimezone;
|
2021-08-09 10:16:27 +00:00
|
|
|
|
this.saveSettings();
|
2021-07-01 13:47:14 +00:00
|
|
|
|
},
|
|
|
|
|
|
2021-06-25 13:55:49 +00:00
|
|
|
|
savePassword() {
|
|
|
|
|
if (this.password.newPassword !== this.password.repeatNewPassword) {
|
|
|
|
|
this.invalidPassword = true;
|
|
|
|
|
} else {
|
|
|
|
|
this.$root.getSocket().emit("changePassword", this.password, (res) => {
|
|
|
|
|
this.$root.toastRes(res)
|
|
|
|
|
if (res.ok) {
|
|
|
|
|
this.password.currentPassword = ""
|
|
|
|
|
this.password.newPassword = ""
|
|
|
|
|
this.password.repeatNewPassword = ""
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
},
|
2021-07-31 13:57:58 +00:00
|
|
|
|
|
|
|
|
|
loadSettings() {
|
|
|
|
|
this.$root.getSocket().emit("getSettings", (res) => {
|
|
|
|
|
this.settings = res.data;
|
2021-08-09 10:46:57 +00:00
|
|
|
|
|
|
|
|
|
if (this.settings.searchEngineIndex === undefined) {
|
|
|
|
|
this.settings.searchEngineIndex = false;
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-31 15:41:24 +00:00
|
|
|
|
this.loaded = true;
|
2021-07-31 13:57:58 +00:00
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
saveSettings() {
|
|
|
|
|
this.$root.getSocket().emit("setSettings", this.settings, (res) => {
|
|
|
|
|
this.$root.toastRes(res);
|
|
|
|
|
this.loadSettings();
|
|
|
|
|
})
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
confirmDisableAuth() {
|
|
|
|
|
this.$refs.confirmDisableAuth.show();
|
|
|
|
|
},
|
|
|
|
|
|
2021-08-31 22:36:24 +00:00
|
|
|
|
confirmClearStatistics() {
|
|
|
|
|
this.$refs.confirmClearStatistics.show();
|
|
|
|
|
},
|
|
|
|
|
|
2021-07-31 13:57:58 +00:00
|
|
|
|
disableAuth() {
|
|
|
|
|
this.settings.disableAuth = true;
|
|
|
|
|
this.saveSettings();
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
enableAuth() {
|
|
|
|
|
this.settings.disableAuth = false;
|
|
|
|
|
this.saveSettings();
|
2021-08-03 05:07:20 +00:00
|
|
|
|
this.$root.storage().removeItem("token");
|
2021-07-31 13:57:58 +00:00
|
|
|
|
},
|
|
|
|
|
|
2021-08-31 22:36:24 +00:00
|
|
|
|
clearStatistics() {
|
|
|
|
|
this.$root.clearStatistics((res) => {
|
|
|
|
|
if (res.ok) {
|
|
|
|
|
this.$router.go();
|
|
|
|
|
} else {
|
|
|
|
|
toast.error(res.msg);
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
},
|
2021-06-25 13:55:49 +00:00
|
|
|
|
},
|
|
|
|
|
}
|
|
|
|
|
</script>
|
|
|
|
|
|
2021-08-08 05:47:29 +00:00
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
|
@import "../assets/vars.scss";
|
|
|
|
|
|
|
|
|
|
.shadow-box {
|
|
|
|
|
padding: 20px;
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-10 04:20:06 +00:00
|
|
|
|
.btn-check:active + .btn-outline-primary,
|
|
|
|
|
.btn-check:checked + .btn-outline-primary,
|
|
|
|
|
.btn-check:hover + .btn-outline-primary {
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
|
2021-08-08 05:47:29 +00:00
|
|
|
|
.dark {
|
|
|
|
|
.list-group-item {
|
|
|
|
|
background-color: $dark-bg2;
|
|
|
|
|
color: $dark-font-color;
|
2021-06-25 13:55:49 +00:00
|
|
|
|
}
|
2021-08-10 04:20:06 +00:00
|
|
|
|
|
|
|
|
|
.btn-check:active + .btn-outline-primary,
|
|
|
|
|
.btn-check:checked + .btn-outline-primary,
|
|
|
|
|
.btn-check:hover + .btn-outline-primary {
|
|
|
|
|
color: #000;
|
|
|
|
|
}
|
2021-08-08 05:47:29 +00:00
|
|
|
|
}
|
2021-08-29 18:22:49 +00:00
|
|
|
|
|
|
|
|
|
footer {
|
|
|
|
|
color: #aaa;
|
|
|
|
|
font-size: 13px;
|
|
|
|
|
margin-top: 20px;
|
|
|
|
|
padding-bottom: 30px;
|
|
|
|
|
text-align: center;
|
|
|
|
|
}
|
2021-06-25 13:55:49 +00:00
|
|
|
|
</style>
|