mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-04 14:22:00 +01:00
1 line
12 KiB
Plaintext
1 line
12 KiB
Plaintext
|
{"version":3,"file":"AppSetup-CjgtJWbk.js","sources":["../../../resources/js/services/systemService.js","../../../resources/js/components/VersionChecker.vue","../../../resources/js/views/admin/AppSetup.vue"],"sourcesContent":["import { httpClientFactory } from '@/services/httpClientFactory'\n\nconst webClient = httpClientFactory('web')\n\nexport default {\n /**\n * \n * @returns Promise\n */\n getSystemInfos(config = {}) {\n return webClient.get('system/infos', { ...config })\n },\n\n /**\n * \n * @returns Promise\n */\n getLastRelease(config = {}) {\n return webClient.get('system/latestRelease', { ...config })\n },\n\n /**\n * \n * @returns Promise\n */\n sendTestEmail(config = {}) {\n return webClient.post('system/test-email', { ...config })\n },\n\n /**\n * \n * @returns Promise\n */\n clearCache(config = {}) {\n return webClient.get('system/clear-cache', { ...config })\n },\n\n /**\n * \n * @returns Promise\n */\n optimize(config = {}) {\n return webClient.get('system/optimize', { ...config })\n },\n \n}","<script setup>\n import systemService from '@/services/systemService'\n import { useAppSettingsStore } from '@/stores/appSettings'\n import { UseColorMode } from '@vueuse/components'\n\n const appSettings = useAppSettingsStore()\n const isScanning = ref(false)\n const isUpToDate = ref()\n\n async function getLatestRelease() {\n isScanning.value = true;\n isUpToDate.value = undefined\n\n await systemService.getLastRelease({returnError: true})\n .then(response => {\n appSettings.latestRelease = response.data.newRelease\n isUpToDate.value = response.data.newRelease === null ? null : response.data.newRelease === false\n })\n .catch(() => {\n isUpToDate.value = null\n })\n\n isScanning.value = false;\n }\n\n</script>\n\n<template>\n <div class=\"columns is-mobile is-vcentered\">\n <div class=\"column is-narrow\">\n <button type=\"button\" :class=\"isScanning ? 'is-loading' : ''\" class=\"button is-link is-rounded is-small\" @click=\"getLatestRelease\">{{ $t('admin.check_now') }}</button>\n </div>\n <div class=\"column\">\n <UseColorMode v-slot=\"{ mode }\">\n <span v-if=\"appSettings.latestRelease\" class=\"mt-2\" :class=\"mode == 'dark' ? 'has-text-warning' : 'has-text-warning-dark'\">\n <span class=\"release-flag\"></span>{{ $t('admin.x_is_available', { version: appSettings.latestRelease }) }} <a class=\"is-size-7\" href=\"https://github.com/Bubka/2FAuth/releases\">{{ $t('admin.view_on_github') }}</a>\n </span>\n <span v-if=\"isUpToDate\" class=\"has-text-grey\">\n <FontAwesomeIcon :icon=\"['fas', 'check']\" class=\"mr-1 has-text-success\" /> {{ $t('commons.you_are_up_to_date') }}\n </span>\n <span v-else-if=\"isUpToDate === null\" class=\"has-text-grey\">\n <FontAwesomeIcon :icon=\"['fas', 'times']\" class=\"mr-1 has-text-danger\" />{{ $t('errors.check_failed_try_later') }}\n </span>\n </UseColorMode>\n </div>\n </div>\n</template>\n","<script setup>\n import AdminTabs from '@/layouts/AdminTabs.vue'\n import systemService from '@/services/systemService'\n import { useAppSettingsUpdater } from '@/composables/appSettingsUpdater'\n import { useAppSettingsStore } from '@/stores/appSettings'\n import { useNotifyStore } from '@/stores/notify'\n import { useUserStore } from '@/stores/user'\n import VersionChecker from '@/components/VersionChecker.vue'\n import CopyButton from '@/components/CopyButton.vue'\n\n const $2fauth = inject('2fauth')\n const user = useUserStore()\n const notify = useNotifyStore()\n const appSettings = useAppSettingsStore()\n const returnTo = useStorage($2fauth.prefix + 'returnTo', 'accounts')\n
|