summaryrefslogtreecommitdiff
path: root/packages/client/src/pages/admin/security.vue
diff options
context:
space:
mode:
authorsyuilo <Syuilotan@yahoo.co.jp>2022-07-02 15:12:11 +0900
committerGitHub <noreply@github.com>2022-07-02 15:12:11 +0900
commiteccc90c843f63b2dc08d8fbf80e4f54a601e477d (patch)
treea26e23b56d711806862bdfaafeb9b826d25465a8 /packages/client/src/pages/admin/security.vue
parentrefactor(client): refactoring (diff)
downloadsharkey-eccc90c843f63b2dc08d8fbf80e4f54a601e477d.tar.gz
sharkey-eccc90c843f63b2dc08d8fbf80e4f54a601e477d.tar.bz2
sharkey-eccc90c843f63b2dc08d8fbf80e4f54a601e477d.zip
feat: Log user ips (#8872)
* wip * store ip and headers * Update admin-file.vue * require admin for view ip/headers * IP (recent) 消した * admin必須 * opt in * clean ips periodically * respect logging setting in drive/files/create
Diffstat (limited to 'packages/client/src/pages/admin/security.vue')
-rw-r--r--packages/client/src/pages/admin/security.vue15
1 files changed, 15 insertions, 0 deletions
diff --git a/packages/client/src/pages/admin/security.vue b/packages/client/src/pages/admin/security.vue
index ec11e42a7d..76fa9d21eb 100644
--- a/packages/client/src/pages/admin/security.vue
+++ b/packages/client/src/pages/admin/security.vue
@@ -15,6 +15,18 @@
</FormFolder>
<FormFolder class="_formBlock">
+ <template #label>Log IP address</template>
+ <template v-if="enableIpLogging" #suffix>Enabled</template>
+ <template v-else #suffix>Disabled</template>
+
+ <div class="_formRoot">
+ <FormSwitch v-model="enableIpLogging" class="_formBlock" @update:modelValue="save">
+ <template #label>Enable</template>
+ </FormSwitch>
+ </div>
+ </FormFolder>
+
+ <FormFolder class="_formBlock">
<template #label>Summaly Proxy</template>
<div class="_formRoot">
@@ -51,17 +63,20 @@ import { definePageMetadata } from '@/scripts/page-metadata';
let summalyProxy: string = $ref('');
let enableHcaptcha: boolean = $ref(false);
let enableRecaptcha: boolean = $ref(false);
+let enableIpLogging: boolean = $ref(false);
async function init() {
const meta = await os.api('admin/meta');
summalyProxy = meta.summalyProxy;
enableHcaptcha = meta.enableHcaptcha;
enableRecaptcha = meta.enableRecaptcha;
+ enableIpLogging = meta.enableIpLogging;
}
function save() {
os.apiWithDialog('admin/update-meta', {
summalyProxy,
+ enableIpLogging,
}).then(() => {
fetchInstance();
});