summaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2022-06-21 19:48:28 +0900
committersyuilo <Syuilotan@yahoo.co.jp>2022-06-21 19:48:28 +0900
commit2d181ba5afcc141befde4bcbe540bdf106d79083 (patch)
treed6422d77d47774ec8ed952f70144527b4a8e7922 /packages
parenttweak client (diff)
downloadsharkey-2d181ba5afcc141befde4bcbe540bdf106d79083.tar.gz
sharkey-2d181ba5afcc141befde4bcbe540bdf106d79083.tar.bz2
sharkey-2d181ba5afcc141befde4bcbe540bdf106d79083.zip
enhance(client): show warning in control panel when there is an unresolved abuse report
Diffstat (limited to 'packages')
-rw-r--r--packages/client/src/pages/admin/email-settings.vue2
-rw-r--r--packages/client/src/pages/admin/index.vue11
2 files changed, 12 insertions, 1 deletions
diff --git a/packages/client/src/pages/admin/email-settings.vue b/packages/client/src/pages/admin/email-settings.vue
index 5487c5f333..c0ff94fad2 100644
--- a/packages/client/src/pages/admin/email-settings.vue
+++ b/packages/client/src/pages/admin/email-settings.vue
@@ -5,7 +5,7 @@
<FormSuspense :p="init">
<div class="_formRoot">
<FormSwitch v-model="enableEmail" class="_formBlock">
- <template #label>{{ i18n.ts.enableEmail }}</template>
+ <template #label>{{ i18n.ts.enableEmail }} ({{ i18n.ts.recommended }})</template>
<template #caption>{{ i18n.ts.emailConfigInfo }}</template>
</FormSwitch>
diff --git a/packages/client/src/pages/admin/index.vue b/packages/client/src/pages/admin/index.vue
index 5db91101d7..b91330e1b7 100644
--- a/packages/client/src/pages/admin/index.vue
+++ b/packages/client/src/pages/admin/index.vue
@@ -7,8 +7,10 @@
<img :src="$instance.iconUrl || '/favicon.ico'" alt="" class="icon"/>
</div>
+ <MkInfo v-if="thereIsUnresolvedAbuseReport" warn class="info">{{ $ts.thereIsUnresolvedAbuseReportWarning }} <MkA to="/admin/abuses" class="_link">{{ $ts.check }}</MkA></MkInfo>
<MkInfo v-if="noMaintainerInformation" warn class="info">{{ $ts.noMaintainerInformationWarning }} <MkA to="/admin/settings" class="_link">{{ $ts.configure }}</MkA></MkInfo>
<MkInfo v-if="noBotProtection" warn class="info">{{ $ts.noBotProtectionWarning }} <MkA to="/admin/security" class="_link">{{ $ts.configure }}</MkA></MkInfo>
+ <MkInfo v-if="noEmailServer" warn class="info">{{ $ts.noEmailServerWarning }} <MkA to="/admin/email-settings" class="_link">{{ $ts.configure }}</MkA></MkInfo>
<MkSuperMenu :def="menuDef" :grid="initialPage == null"></MkSuperMenu>
</div>
@@ -58,6 +60,15 @@ let el = $ref(null);
let pageProps = $ref({});
let noMaintainerInformation = isEmpty(instance.maintainerName) || isEmpty(instance.maintainerEmail);
let noBotProtection = !instance.enableHcaptcha && !instance.enableRecaptcha;
+let noEmailServer = !instance.enableEmail;
+let thereIsUnresolvedAbuseReport = $ref(false);
+
+os.api('admin/abuse-user-reports', {
+ state: 'unresolved',
+ limit: 1,
+}).then(reports => {
+ if (reports.length > 0) thereIsUnresolvedAbuseReport = true;
+});
const NARROW_THRESHOLD = 600;
const ro = new ResizeObserver((entries, observer) => {