mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-06-01 04:36:12 -04:00
fix: Add 'loading' message to settings page (#2806)
* Add 'loading' message to settings page * Fix loading message in site settings page * Refactor code to use AppLoader
This commit is contained in:
parent
2cba2d5fd2
commit
7aac82bff3
@ -114,6 +114,7 @@
|
|||||||
"json": "JSON",
|
"json": "JSON",
|
||||||
"keyword": "Keyword",
|
"keyword": "Keyword",
|
||||||
"link-copied": "Link Copied",
|
"link-copied": "Link Copied",
|
||||||
|
"loading": "Loading",
|
||||||
"loading-events": "Loading Events",
|
"loading-events": "Loading Events",
|
||||||
"loading-recipe": "Loading recipe...",
|
"loading-recipe": "Loading recipe...",
|
||||||
"loading-ocr-data": "Loading OCR data...",
|
"loading-ocr-data": "Loading OCR data...",
|
||||||
|
@ -130,40 +130,47 @@
|
|||||||
<section class="mt-4">
|
<section class="mt-4">
|
||||||
<BaseCardSectionTitle class="pb-0" :icon="$globals.icons.cog" :title="$tc('settings.general-about')"> </BaseCardSectionTitle>
|
<BaseCardSectionTitle class="pb-0" :icon="$globals.icons.cog" :title="$tc('settings.general-about')"> </BaseCardSectionTitle>
|
||||||
<v-card class="mb-4">
|
<v-card class="mb-4">
|
||||||
<template v-for="(property, idx) in appInfo">
|
<template v-if="appInfo && appInfo.length">
|
||||||
<v-list-item :key="property.name">
|
<template v-for="(property, idx) in appInfo">
|
||||||
<v-list-item-icon>
|
<v-list-item :key="property.name">
|
||||||
<v-icon> {{ property.icon || $globals.icons.user }} </v-icon>
|
<v-list-item-icon>
|
||||||
</v-list-item-icon>
|
<v-icon> {{ property.icon || $globals.icons.user }} </v-icon>
|
||||||
<v-list-item-content>
|
</v-list-item-icon>
|
||||||
<v-list-item-title>
|
<v-list-item-content>
|
||||||
<div>{{ property.name }}</div>
|
<v-list-item-title>
|
||||||
</v-list-item-title>
|
<div>{{ property.name }}</div>
|
||||||
<template v-if="property.slot === 'recipe-scraper'">
|
</v-list-item-title>
|
||||||
<v-list-item-subtitle>
|
<template v-if="property.slot === 'recipe-scraper'">
|
||||||
<a
|
<v-list-item-subtitle>
|
||||||
target="_blank"
|
<a
|
||||||
:href="`https://github.com/hhursev/recipe-scrapers/releases/tag/${property.value}`"
|
target="_blank"
|
||||||
>
|
:href="`https://github.com/hhursev/recipe-scrapers/releases/tag/${property.value}`"
|
||||||
|
>
|
||||||
|
{{ property.value }}
|
||||||
|
</a>
|
||||||
|
</v-list-item-subtitle>
|
||||||
|
</template>
|
||||||
|
<template v-else-if="property.slot === 'build'">
|
||||||
|
<v-list-item-subtitle>
|
||||||
|
<a target="_blank" :href="`https://github.com/hay-kot/mealie/commit/${property.value}`">
|
||||||
|
{{ property.value }}
|
||||||
|
</a>
|
||||||
|
</v-list-item-subtitle>
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
<v-list-item-subtitle>
|
||||||
{{ property.value }}
|
{{ property.value }}
|
||||||
</a>
|
</v-list-item-subtitle>
|
||||||
</v-list-item-subtitle>
|
</template>
|
||||||
</template>
|
</v-list-item-content>
|
||||||
<template v-else-if="property.slot === 'build'">
|
</v-list-item>
|
||||||
<v-list-item-subtitle>
|
<v-divider v-if="appInfo && idx !== appInfo.length - 1" :key="`divider-${property.name}`"></v-divider>
|
||||||
<a target="_blank" :href="`https://github.com/hay-kot/mealie/commit/${property.value}`">
|
</template>
|
||||||
{{ property.value }}
|
</template>
|
||||||
</a>
|
<template v-else>
|
||||||
</v-list-item-subtitle>
|
<div class="mb-3 text-center">
|
||||||
</template>
|
<AppLoader :waiting-text="$tc('general.loading')" />
|
||||||
<template v-else>
|
</div>
|
||||||
<v-list-item-subtitle>
|
|
||||||
{{ property.value }}
|
|
||||||
</v-list-item-subtitle>
|
|
||||||
</template>
|
|
||||||
</v-list-item-content>
|
|
||||||
</v-list-item>
|
|
||||||
<v-divider v-if="appInfo && idx !== appInfo.length - 1" :key="`divider-${property.name}`"></v-divider>
|
|
||||||
</template>
|
</template>
|
||||||
</v-card>
|
</v-card>
|
||||||
</section>
|
</section>
|
||||||
@ -186,6 +193,7 @@ import { useAdminApi, useUserApi } from "~/composables/api";
|
|||||||
import { validators } from "~/composables/use-validators";
|
import { validators } from "~/composables/use-validators";
|
||||||
import { useAsyncKey } from "~/composables/use-utils";
|
import { useAsyncKey } from "~/composables/use-utils";
|
||||||
import { CheckAppConfig } from "~/lib/api/types/admin";
|
import { CheckAppConfig } from "~/lib/api/types/admin";
|
||||||
|
import AppLoader from "~/components/global/AppLoader.vue";
|
||||||
|
|
||||||
enum DockerVolumeState {
|
enum DockerVolumeState {
|
||||||
Unknown = "unknown",
|
Unknown = "unknown",
|
||||||
@ -208,294 +216,257 @@ interface CheckApp extends CheckAppConfig {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
layout: "admin",
|
layout: "admin",
|
||||||
setup() {
|
setup() {
|
||||||
// ==========================================================
|
// ==========================================================
|
||||||
// Docker Volume Validation
|
// Docker Volume Validation
|
||||||
const docker = reactive({
|
const docker = reactive({
|
||||||
loading: false,
|
loading: false,
|
||||||
state: DockerVolumeState.Unknown,
|
state: DockerVolumeState.Unknown,
|
||||||
});
|
});
|
||||||
|
async function dockerValidate() {
|
||||||
async function dockerValidate() {
|
docker.loading = true;
|
||||||
docker.loading = true;
|
// Do API Check
|
||||||
|
const { data } = await adminApi.about.checkDocker();
|
||||||
// Do API Check
|
if (data == null) {
|
||||||
const { data } = await adminApi.about.checkDocker();
|
docker.state = DockerVolumeState.Error;
|
||||||
if (data == null) {
|
return;
|
||||||
docker.state = DockerVolumeState.Error;
|
}
|
||||||
return;
|
// Get File Contents
|
||||||
}
|
const { data: fileContents } = await adminApi.about.getDockerValidateFileContents();
|
||||||
|
if (data.text === fileContents) {
|
||||||
// Get File Contents
|
docker.state = DockerVolumeState.Success;
|
||||||
const { data: fileContents } = await adminApi.about.getDockerValidateFileContents();
|
}
|
||||||
|
else {
|
||||||
if (data.text === fileContents) {
|
docker.state = DockerVolumeState.Error;
|
||||||
docker.state = DockerVolumeState.Success;
|
}
|
||||||
} else {
|
docker.loading = false;
|
||||||
docker.state = DockerVolumeState.Error;
|
|
||||||
}
|
|
||||||
|
|
||||||
docker.loading = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
const state = reactive({
|
|
||||||
loading: false,
|
|
||||||
address: "",
|
|
||||||
success: false,
|
|
||||||
error: "",
|
|
||||||
tested: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
const appConfig = ref<CheckApp>({
|
|
||||||
emailReady: true,
|
|
||||||
baseUrlSet: true,
|
|
||||||
isSiteSecure: true,
|
|
||||||
isUpToDate: false,
|
|
||||||
ldapReady: false,
|
|
||||||
});
|
|
||||||
|
|
||||||
function isLocalHostOrHttps() {
|
|
||||||
return window.location.hostname === "localhost" || window.location.protocol === "https:";
|
|
||||||
}
|
|
||||||
|
|
||||||
const api = useUserApi();
|
|
||||||
const adminApi = useAdminApi();
|
|
||||||
|
|
||||||
onMounted(async () => {
|
|
||||||
const { data } = await adminApi.about.checkApp();
|
|
||||||
|
|
||||||
if (data) {
|
|
||||||
appConfig.value = { ...data, isSiteSecure: false };
|
|
||||||
}
|
|
||||||
|
|
||||||
appConfig.value.isSiteSecure = isLocalHostOrHttps();
|
|
||||||
});
|
|
||||||
|
|
||||||
const simpleChecks = computed<SimpleCheck[]>(() => {
|
|
||||||
const goodIcon = $globals.icons.checkboxMarkedCircle;
|
|
||||||
const badIcon = $globals.icons.alert;
|
|
||||||
const warningIcon = $globals.icons.alertCircle;
|
|
||||||
|
|
||||||
const goodColor = "success";
|
|
||||||
const badColor = "error";
|
|
||||||
const warningColor = "warning";
|
|
||||||
|
|
||||||
|
|
||||||
const data: SimpleCheck[] = [
|
|
||||||
{
|
|
||||||
id: "application-version",
|
|
||||||
text: i18n.t("settings.application-version"),
|
|
||||||
status: appConfig.value.isUpToDate,
|
|
||||||
errorText: i18n.t("settings.application-version-error-text", [rawAppInfo.value.version, rawAppInfo.value.versionLatest]),
|
|
||||||
successText: i18n.t("settings.mealie-is-up-to-date"),
|
|
||||||
color: appConfig.value.isUpToDate ? goodColor : warningColor,
|
|
||||||
icon: appConfig.value.isUpToDate ? goodIcon : warningIcon,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "secure-site",
|
|
||||||
text: i18n.t("settings.secure-site"),
|
|
||||||
status: appConfig.value.isSiteSecure,
|
|
||||||
errorText: i18n.t("settings.secure-site-error-text"),
|
|
||||||
successText: i18n.t("settings.secure-site-success-text"),
|
|
||||||
color: appConfig.value.isSiteSecure ? goodColor : badColor,
|
|
||||||
icon: appConfig.value.isSiteSecure ? goodIcon : badIcon,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "server-side-base-url",
|
|
||||||
text: i18n.t("settings.server-side-base-url"),
|
|
||||||
status: appConfig.value.baseUrlSet,
|
|
||||||
errorText:
|
|
||||||
i18n.t("settings.server-side-base-url-error-text"),
|
|
||||||
successText: i18n.t("settings.server-side-base-url-success-text"),
|
|
||||||
color: appConfig.value.baseUrlSet ? goodColor : badColor,
|
|
||||||
icon: appConfig.value.baseUrlSet ? goodIcon : badIcon,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
id: "ldap-ready",
|
|
||||||
text: i18n.t("settings.ldap-ready"),
|
|
||||||
status: appConfig.value.ldapReady,
|
|
||||||
errorText:
|
|
||||||
i18n.t("settings.ldap-ready-error-text"),
|
|
||||||
successText: i18n.t("settings.ldap-ready-success-text"),
|
|
||||||
color: appConfig.value.ldapReady ? goodColor : warningColor,
|
|
||||||
icon: appConfig.value.ldapReady ? goodIcon : warningIcon,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
return data;
|
|
||||||
});
|
|
||||||
|
|
||||||
async function testEmail() {
|
|
||||||
state.loading = true;
|
|
||||||
state.tested = false;
|
|
||||||
const { data } = await api.email.test({ email: state.address });
|
|
||||||
|
|
||||||
if (data) {
|
|
||||||
if (data.success) {
|
|
||||||
state.success = true;
|
|
||||||
} else {
|
|
||||||
state.error = data.error ?? "";
|
|
||||||
state.success = false;
|
|
||||||
}
|
}
|
||||||
}
|
const state = reactive({
|
||||||
state.loading = false;
|
loading: false,
|
||||||
state.tested = true;
|
address: "",
|
||||||
}
|
success: false,
|
||||||
|
error: "",
|
||||||
const validEmail = computed(() => {
|
tested: false,
|
||||||
if (state.address === "") {
|
});
|
||||||
return false;
|
const appConfig = ref<CheckApp>({
|
||||||
}
|
emailReady: true,
|
||||||
const valid = validators.email(state.address);
|
baseUrlSet: true,
|
||||||
|
isSiteSecure: true,
|
||||||
// Explicit bool check because validators.email sometimes returns a string
|
isUpToDate: false,
|
||||||
if (valid === true) {
|
ldapReady: false,
|
||||||
return true;
|
});
|
||||||
}
|
function isLocalHostOrHttps() {
|
||||||
return false;
|
return window.location.hostname === "localhost" || window.location.protocol === "https:";
|
||||||
});
|
|
||||||
|
|
||||||
// ============================================================
|
|
||||||
// General About Info
|
|
||||||
|
|
||||||
const { $globals, i18n } = useContext();
|
|
||||||
|
|
||||||
const rawAppInfo = ref({
|
|
||||||
version: "null",
|
|
||||||
versionLatest: "null",
|
|
||||||
});
|
|
||||||
|
|
||||||
function getAppInfo() {
|
|
||||||
const statistics = useAsync(async () => {
|
|
||||||
const { data } = await adminApi.about.about();
|
|
||||||
|
|
||||||
if (data) {
|
|
||||||
rawAppInfo.value.version = data.version;
|
|
||||||
rawAppInfo.value.versionLatest = data.versionLatest;
|
|
||||||
|
|
||||||
const prettyInfo = [
|
|
||||||
{
|
|
||||||
name: i18n.t("about.version"),
|
|
||||||
icon: $globals.icons.information,
|
|
||||||
value: data.version,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
slot: "build",
|
|
||||||
name: i18n.t("settings.build"),
|
|
||||||
icon: $globals.icons.information,
|
|
||||||
value: data.buildId,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: i18n.t("about.application-mode"),
|
|
||||||
icon: $globals.icons.devTo,
|
|
||||||
value: data.production ? i18n.t("about.production") : i18n.t("about.development"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: i18n.t("about.demo-status"),
|
|
||||||
icon: $globals.icons.testTube,
|
|
||||||
value: data.demoStatus ? i18n.t("about.demo") : i18n.t("about.not-demo"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: i18n.t("about.api-port"),
|
|
||||||
icon: $globals.icons.api,
|
|
||||||
value: data.apiPort,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: i18n.t("about.api-docs"),
|
|
||||||
icon: $globals.icons.file,
|
|
||||||
value: data.apiDocs ? i18n.t("general.enabled") : i18n.t("general.disabled"),
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: i18n.t("about.database-type"),
|
|
||||||
icon: $globals.icons.database,
|
|
||||||
value: data.dbType,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: i18n.t("about.database-url"),
|
|
||||||
icon: $globals.icons.database,
|
|
||||||
value: data.dbUrl,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: i18n.t("about.default-group"),
|
|
||||||
icon: $globals.icons.group,
|
|
||||||
value: data.defaultGroup,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
slot: "recipe-scraper",
|
|
||||||
name: i18n.t("settings.recipe-scraper-version"),
|
|
||||||
icon: $globals.icons.primary,
|
|
||||||
value: data.recipeScraperVersion,
|
|
||||||
},
|
|
||||||
];
|
|
||||||
|
|
||||||
return prettyInfo;
|
|
||||||
}
|
}
|
||||||
|
const api = useUserApi();
|
||||||
return data;
|
const adminApi = useAdminApi();
|
||||||
}, useAsyncKey());
|
onMounted(async () => {
|
||||||
|
const { data } = await adminApi.about.checkApp();
|
||||||
return statistics;
|
if (data) {
|
||||||
}
|
appConfig.value = { ...data, isSiteSecure: false };
|
||||||
|
}
|
||||||
const appInfo = getAppInfo();
|
appConfig.value.isSiteSecure = isLocalHostOrHttps();
|
||||||
|
});
|
||||||
const bugReportDialog = ref(false);
|
const simpleChecks = computed<SimpleCheck[]>(() => {
|
||||||
|
const goodIcon = $globals.icons.checkboxMarkedCircle;
|
||||||
const bugReportText = computed(() => {
|
const badIcon = $globals.icons.alert;
|
||||||
const ignore = {
|
const warningIcon = $globals.icons.alertCircle;
|
||||||
[i18n.tc("about.database-url")]: true,
|
const goodColor = "success";
|
||||||
[i18n.tc("about.default-group")]: true,
|
const badColor = "error";
|
||||||
};
|
const warningColor = "warning";
|
||||||
let text = "**Details**\n";
|
const data: SimpleCheck[] = [
|
||||||
|
{
|
||||||
appInfo.value?.forEach((item) => {
|
id: "application-version",
|
||||||
if (ignore[item.name as string]) {
|
text: i18n.t("settings.application-version"),
|
||||||
return;
|
status: appConfig.value.isUpToDate,
|
||||||
|
errorText: i18n.t("settings.application-version-error-text", [rawAppInfo.value.version, rawAppInfo.value.versionLatest]),
|
||||||
|
successText: i18n.t("settings.mealie-is-up-to-date"),
|
||||||
|
color: appConfig.value.isUpToDate ? goodColor : warningColor,
|
||||||
|
icon: appConfig.value.isUpToDate ? goodIcon : warningIcon,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "secure-site",
|
||||||
|
text: i18n.t("settings.secure-site"),
|
||||||
|
status: appConfig.value.isSiteSecure,
|
||||||
|
errorText: i18n.t("settings.secure-site-error-text"),
|
||||||
|
successText: i18n.t("settings.secure-site-success-text"),
|
||||||
|
color: appConfig.value.isSiteSecure ? goodColor : badColor,
|
||||||
|
icon: appConfig.value.isSiteSecure ? goodIcon : badIcon,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "server-side-base-url",
|
||||||
|
text: i18n.t("settings.server-side-base-url"),
|
||||||
|
status: appConfig.value.baseUrlSet,
|
||||||
|
errorText: i18n.t("settings.server-side-base-url-error-text"),
|
||||||
|
successText: i18n.t("settings.server-side-base-url-success-text"),
|
||||||
|
color: appConfig.value.baseUrlSet ? goodColor : badColor,
|
||||||
|
icon: appConfig.value.baseUrlSet ? goodIcon : badIcon,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: "ldap-ready",
|
||||||
|
text: i18n.t("settings.ldap-ready"),
|
||||||
|
status: appConfig.value.ldapReady,
|
||||||
|
errorText: i18n.t("settings.ldap-ready-error-text"),
|
||||||
|
successText: i18n.t("settings.ldap-ready-success-text"),
|
||||||
|
color: appConfig.value.ldapReady ? goodColor : warningColor,
|
||||||
|
icon: appConfig.value.ldapReady ? goodIcon : warningIcon,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
return data;
|
||||||
|
});
|
||||||
|
async function testEmail() {
|
||||||
|
state.loading = true;
|
||||||
|
state.tested = false;
|
||||||
|
const { data } = await api.email.test({ email: state.address });
|
||||||
|
if (data) {
|
||||||
|
if (data.success) {
|
||||||
|
state.success = true;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
state.error = data.error ?? "";
|
||||||
|
state.success = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
state.loading = false;
|
||||||
|
state.tested = true;
|
||||||
}
|
}
|
||||||
text += `${item.name as string}: ${item.value as string}\n`;
|
const validEmail = computed(() => {
|
||||||
});
|
if (state.address === "") {
|
||||||
|
return false;
|
||||||
const ignoreChecks: { [key: string]: boolean } = {
|
}
|
||||||
"application-version": true,
|
const valid = validators.email(state.address);
|
||||||
};
|
// Explicit bool check because validators.email sometimes returns a string
|
||||||
|
if (valid === true) {
|
||||||
text += "\n**Checks**\n";
|
return true;
|
||||||
|
}
|
||||||
simpleChecks.value.forEach((item) => {
|
return false;
|
||||||
if (ignoreChecks[item.id]) {
|
});
|
||||||
return;
|
// ============================================================
|
||||||
|
// General About Info
|
||||||
|
const { $globals, i18n } = useContext();
|
||||||
|
const rawAppInfo = ref({
|
||||||
|
version: "null",
|
||||||
|
versionLatest: "null",
|
||||||
|
});
|
||||||
|
function getAppInfo() {
|
||||||
|
const statistics = useAsync(async () => {
|
||||||
|
const { data } = await adminApi.about.about();
|
||||||
|
if (data) {
|
||||||
|
rawAppInfo.value.version = data.version;
|
||||||
|
rawAppInfo.value.versionLatest = data.versionLatest;
|
||||||
|
const prettyInfo = [
|
||||||
|
{
|
||||||
|
name: i18n.t("about.version"),
|
||||||
|
icon: $globals.icons.information,
|
||||||
|
value: data.version,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
slot: "build",
|
||||||
|
name: i18n.t("settings.build"),
|
||||||
|
icon: $globals.icons.information,
|
||||||
|
value: data.buildId,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: i18n.t("about.application-mode"),
|
||||||
|
icon: $globals.icons.devTo,
|
||||||
|
value: data.production ? i18n.t("about.production") : i18n.t("about.development"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: i18n.t("about.demo-status"),
|
||||||
|
icon: $globals.icons.testTube,
|
||||||
|
value: data.demoStatus ? i18n.t("about.demo") : i18n.t("about.not-demo"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: i18n.t("about.api-port"),
|
||||||
|
icon: $globals.icons.api,
|
||||||
|
value: data.apiPort,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: i18n.t("about.api-docs"),
|
||||||
|
icon: $globals.icons.file,
|
||||||
|
value: data.apiDocs ? i18n.t("general.enabled") : i18n.t("general.disabled"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: i18n.t("about.database-type"),
|
||||||
|
icon: $globals.icons.database,
|
||||||
|
value: data.dbType,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: i18n.t("about.database-url"),
|
||||||
|
icon: $globals.icons.database,
|
||||||
|
value: data.dbUrl,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: i18n.t("about.default-group"),
|
||||||
|
icon: $globals.icons.group,
|
||||||
|
value: data.defaultGroup,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
slot: "recipe-scraper",
|
||||||
|
name: i18n.t("settings.recipe-scraper-version"),
|
||||||
|
icon: $globals.icons.primary,
|
||||||
|
value: data.recipeScraperVersion,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
return prettyInfo;
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
}, useAsyncKey());
|
||||||
|
return statistics;
|
||||||
}
|
}
|
||||||
const status = item.status ? i18n.tc("general.yes") : i18n.tc("general.no");
|
const appInfo = getAppInfo();
|
||||||
text += `${item.text.toString()}: ${status}\n`;
|
const bugReportDialog = ref(false);
|
||||||
});
|
const bugReportText = computed(() => {
|
||||||
|
const ignore = {
|
||||||
text += `${i18n.tc("settings.email-configured")}: ${appConfig.value.emailReady ? i18n.tc("general.yes") : i18n.tc("general.no")}\n`;
|
[i18n.tc("about.database-url")]: true,
|
||||||
text += `${i18n.tc("settings.docker-volume")}: ${docker.state}`;
|
[i18n.tc("about.default-group")]: true,
|
||||||
|
};
|
||||||
return text;
|
let text = "**Details**\n";
|
||||||
});
|
appInfo.value?.forEach((item) => {
|
||||||
|
if (ignore[item.name as string]) {
|
||||||
return {
|
return;
|
||||||
bugReportDialog,
|
}
|
||||||
bugReportText,
|
text += `${item.name as string}: ${item.value as string}\n`;
|
||||||
DockerVolumeState,
|
});
|
||||||
docker,
|
const ignoreChecks: {
|
||||||
dockerValidate,
|
[key: string]: boolean;
|
||||||
simpleChecks,
|
} = {
|
||||||
appConfig,
|
"application-version": true,
|
||||||
validEmail,
|
};
|
||||||
validators,
|
text += "\n**Checks**\n";
|
||||||
...toRefs(state),
|
simpleChecks.value.forEach((item) => {
|
||||||
testEmail,
|
if (ignoreChecks[item.id]) {
|
||||||
appInfo,
|
return;
|
||||||
};
|
}
|
||||||
},
|
const status = item.status ? i18n.tc("general.yes") : i18n.tc("general.no");
|
||||||
head() {
|
text += `${item.text.toString()}: ${status}\n`;
|
||||||
return {
|
});
|
||||||
title: this.$t("settings.site-settings") as string,
|
text += `${i18n.tc("settings.email-configured")}: ${appConfig.value.emailReady ? i18n.tc("general.yes") : i18n.tc("general.no")}\n`;
|
||||||
};
|
text += `${i18n.tc("settings.docker-volume")}: ${docker.state}`;
|
||||||
},
|
return text;
|
||||||
|
});
|
||||||
|
return {
|
||||||
|
bugReportDialog,
|
||||||
|
bugReportText,
|
||||||
|
DockerVolumeState,
|
||||||
|
docker,
|
||||||
|
dockerValidate,
|
||||||
|
simpleChecks,
|
||||||
|
appConfig,
|
||||||
|
validEmail,
|
||||||
|
validators,
|
||||||
|
...toRefs(state),
|
||||||
|
testEmail,
|
||||||
|
appInfo,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
head() {
|
||||||
|
return {
|
||||||
|
title: this.$t("settings.site-settings") as string,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: { AppLoader }
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user