2021-04-22 16:29:33 +03:00
|
|
|
<template>
|
2022-06-20 11:38:49 +03:00
|
|
|
<MkStickyContainer>
|
2023-03-02 13:47:24 +02:00
|
|
|
<template #header><XHeader :tabs="headerTabs"/></template>
|
2023-05-19 14:52:15 +03:00
|
|
|
<MkSpacer :contentMax="700" :marginMin="16" :marginMax="32">
|
2022-06-20 11:38:49 +03:00
|
|
|
<FormSuspense :p="init">
|
2023-01-06 06:40:17 +02:00
|
|
|
<div class="_gaps_m">
|
2023-01-07 07:59:54 +02:00
|
|
|
<MkSwitch v-model="useObjectStorage">{{ i18n.ts.useObjectStorage }}</MkSwitch>
|
2022-06-20 11:38:49 +03:00
|
|
|
|
|
|
|
<template v-if="useObjectStorage">
|
2023-04-03 06:47:30 +03:00
|
|
|
<MkInput v-model="objectStorageBaseUrl" :placeholder="'https://example.com'">
|
2022-06-20 11:38:49 +03:00
|
|
|
<template #label>{{ i18n.ts.objectStorageBaseUrl }}</template>
|
|
|
|
<template #caption>{{ i18n.ts.objectStorageBaseUrlDesc }}</template>
|
2023-01-07 08:09:46 +02:00
|
|
|
</MkInput>
|
2021-12-30 14:47:48 +02:00
|
|
|
|
2023-01-07 08:09:46 +02:00
|
|
|
<MkInput v-model="objectStorageBucket">
|
2022-06-20 11:38:49 +03:00
|
|
|
<template #label>{{ i18n.ts.objectStorageBucket }}</template>
|
|
|
|
<template #caption>{{ i18n.ts.objectStorageBucketDesc }}</template>
|
2023-01-07 08:09:46 +02:00
|
|
|
</MkInput>
|
2022-06-20 11:38:49 +03:00
|
|
|
|
2023-01-07 08:09:46 +02:00
|
|
|
<MkInput v-model="objectStoragePrefix">
|
2022-06-20 11:38:49 +03:00
|
|
|
<template #label>{{ i18n.ts.objectStoragePrefix }}</template>
|
|
|
|
<template #caption>{{ i18n.ts.objectStoragePrefixDesc }}</template>
|
2023-01-07 08:09:46 +02:00
|
|
|
</MkInput>
|
2022-06-20 11:38:49 +03:00
|
|
|
|
2023-04-03 06:47:30 +03:00
|
|
|
<MkInput v-model="objectStorageEndpoint" :placeholder="'example.com'">
|
2022-06-20 11:38:49 +03:00
|
|
|
<template #label>{{ i18n.ts.objectStorageEndpoint }}</template>
|
2023-04-03 06:47:30 +03:00
|
|
|
<template #prefix>https://</template>
|
2022-06-20 11:38:49 +03:00
|
|
|
<template #caption>{{ i18n.ts.objectStorageEndpointDesc }}</template>
|
2023-01-07 08:09:46 +02:00
|
|
|
</MkInput>
|
2022-06-20 11:38:49 +03:00
|
|
|
|
2023-01-07 08:09:46 +02:00
|
|
|
<MkInput v-model="objectStorageRegion">
|
2022-06-20 11:38:49 +03:00
|
|
|
<template #label>{{ i18n.ts.objectStorageRegion }}</template>
|
|
|
|
<template #caption>{{ i18n.ts.objectStorageRegionDesc }}</template>
|
2023-01-07 08:09:46 +02:00
|
|
|
</MkInput>
|
2022-06-20 11:38:49 +03:00
|
|
|
|
2023-05-19 14:52:15 +03:00
|
|
|
<FormSplit :minWidth="280">
|
2023-01-07 08:09:46 +02:00
|
|
|
<MkInput v-model="objectStorageAccessKey">
|
2022-12-19 12:01:30 +02:00
|
|
|
<template #prefix><i class="ti ti-key"></i></template>
|
2022-06-20 11:38:49 +03:00
|
|
|
<template #label>Access key</template>
|
2023-01-07 08:09:46 +02:00
|
|
|
</MkInput>
|
2022-06-20 11:38:49 +03:00
|
|
|
|
2023-01-23 09:08:09 +02:00
|
|
|
<MkInput v-model="objectStorageSecretKey" type="password">
|
2022-12-19 12:01:30 +02:00
|
|
|
<template #prefix><i class="ti ti-key"></i></template>
|
2022-06-20 11:38:49 +03:00
|
|
|
<template #label>Secret key</template>
|
2023-01-07 08:09:46 +02:00
|
|
|
</MkInput>
|
2022-06-20 11:38:49 +03:00
|
|
|
</FormSplit>
|
|
|
|
|
2023-01-07 07:59:54 +02:00
|
|
|
<MkSwitch v-model="objectStorageUseSSL">
|
2022-06-20 11:38:49 +03:00
|
|
|
<template #label>{{ i18n.ts.objectStorageUseSSL }}</template>
|
|
|
|
<template #caption>{{ i18n.ts.objectStorageUseSSLDesc }}</template>
|
2023-01-07 07:59:54 +02:00
|
|
|
</MkSwitch>
|
2022-06-20 11:38:49 +03:00
|
|
|
|
2023-01-07 07:59:54 +02:00
|
|
|
<MkSwitch v-model="objectStorageUseProxy">
|
2022-06-20 11:38:49 +03:00
|
|
|
<template #label>{{ i18n.ts.objectStorageUseProxy }}</template>
|
|
|
|
<template #caption>{{ i18n.ts.objectStorageUseProxyDesc }}</template>
|
2023-01-07 07:59:54 +02:00
|
|
|
</MkSwitch>
|
2022-06-20 11:38:49 +03:00
|
|
|
|
2023-01-07 07:59:54 +02:00
|
|
|
<MkSwitch v-model="objectStorageSetPublicRead">
|
2022-06-20 11:38:49 +03:00
|
|
|
<template #label>{{ i18n.ts.objectStorageSetPublicRead }}</template>
|
2023-01-07 07:59:54 +02:00
|
|
|
</MkSwitch>
|
2022-06-20 11:38:49 +03:00
|
|
|
|
2023-01-07 07:59:54 +02:00
|
|
|
<MkSwitch v-model="objectStorageS3ForcePathStyle">
|
2022-06-20 11:38:49 +03:00
|
|
|
<template #label>s3ForcePathStyle</template>
|
2023-04-03 06:47:30 +03:00
|
|
|
<template #caption>{{ i18n.ts.s3ForcePathStyleDesc }}</template>
|
2023-01-07 07:59:54 +02:00
|
|
|
</MkSwitch>
|
2022-06-20 11:38:49 +03:00
|
|
|
</template>
|
|
|
|
</div>
|
|
|
|
</FormSuspense>
|
|
|
|
</MkSpacer>
|
2023-03-02 13:47:24 +02:00
|
|
|
<template #footer>
|
|
|
|
<div :class="$style.footer">
|
2023-05-19 14:52:15 +03:00
|
|
|
<MkSpacer :contentMax="700" :marginMin="16" :marginMax="16">
|
2023-03-02 13:47:24 +02:00
|
|
|
<MkButton primary rounded @click="save"><i class="ti ti-check"></i> {{ i18n.ts.save }}</MkButton>
|
|
|
|
</MkSpacer>
|
|
|
|
</div>
|
|
|
|
</template>
|
2022-06-20 11:38:49 +03:00
|
|
|
</MkStickyContainer>
|
2021-04-22 16:29:33 +03:00
|
|
|
</template>
|
|
|
|
|
2022-05-17 19:31:32 +03:00
|
|
|
<script lang="ts" setup>
|
|
|
|
import { } from 'vue';
|
2022-06-20 11:38:49 +03:00
|
|
|
import XHeader from './_header_.vue';
|
2023-01-07 07:59:54 +02:00
|
|
|
import MkSwitch from '@/components/MkSwitch.vue';
|
2023-01-07 08:09:46 +02:00
|
|
|
import MkInput from '@/components/MkInput.vue';
|
2021-12-30 14:47:48 +02:00
|
|
|
import FormSuspense from '@/components/form/suspense.vue';
|
|
|
|
import FormSplit from '@/components/form/split.vue';
|
2021-11-11 19:02:25 +02:00
|
|
|
import * as os from '@/os';
|
2022-02-28 20:51:31 +02:00
|
|
|
import { fetchInstance } from '@/instance';
|
2022-05-17 19:31:32 +03:00
|
|
|
import { i18n } from '@/i18n';
|
2022-06-20 11:38:49 +03:00
|
|
|
import { definePageMetadata } from '@/scripts/page-metadata';
|
2023-03-02 13:47:24 +02:00
|
|
|
import MkButton from '@/components/MkButton.vue';
|
2022-05-17 19:31:32 +03:00
|
|
|
|
|
|
|
let useObjectStorage: boolean = $ref(false);
|
|
|
|
let objectStorageBaseUrl: string | null = $ref(null);
|
|
|
|
let objectStorageBucket: string | null = $ref(null);
|
|
|
|
let objectStoragePrefix: string | null = $ref(null);
|
|
|
|
let objectStorageEndpoint: string | null = $ref(null);
|
|
|
|
let objectStorageRegion: string | null = $ref(null);
|
|
|
|
let objectStoragePort: number | null = $ref(null);
|
|
|
|
let objectStorageAccessKey: string | null = $ref(null);
|
|
|
|
let objectStorageSecretKey: string | null = $ref(null);
|
|
|
|
let objectStorageUseSSL: boolean = $ref(false);
|
|
|
|
let objectStorageUseProxy: boolean = $ref(false);
|
|
|
|
let objectStorageSetPublicRead: boolean = $ref(false);
|
|
|
|
let objectStorageS3ForcePathStyle: boolean = $ref(true);
|
|
|
|
|
|
|
|
async function init() {
|
|
|
|
const meta = await os.api('admin/meta');
|
|
|
|
useObjectStorage = meta.useObjectStorage;
|
|
|
|
objectStorageBaseUrl = meta.objectStorageBaseUrl;
|
|
|
|
objectStorageBucket = meta.objectStorageBucket;
|
|
|
|
objectStoragePrefix = meta.objectStoragePrefix;
|
|
|
|
objectStorageEndpoint = meta.objectStorageEndpoint;
|
|
|
|
objectStorageRegion = meta.objectStorageRegion;
|
|
|
|
objectStoragePort = meta.objectStoragePort;
|
|
|
|
objectStorageAccessKey = meta.objectStorageAccessKey;
|
|
|
|
objectStorageSecretKey = meta.objectStorageSecretKey;
|
|
|
|
objectStorageUseSSL = meta.objectStorageUseSSL;
|
|
|
|
objectStorageUseProxy = meta.objectStorageUseProxy;
|
|
|
|
objectStorageSetPublicRead = meta.objectStorageSetPublicRead;
|
|
|
|
objectStorageS3ForcePathStyle = meta.objectStorageS3ForcePathStyle;
|
|
|
|
}
|
|
|
|
|
|
|
|
function save() {
|
|
|
|
os.apiWithDialog('admin/update-meta', {
|
|
|
|
useObjectStorage,
|
|
|
|
objectStorageBaseUrl,
|
|
|
|
objectStorageBucket,
|
|
|
|
objectStoragePrefix,
|
|
|
|
objectStorageEndpoint,
|
|
|
|
objectStorageRegion,
|
|
|
|
objectStoragePort,
|
|
|
|
objectStorageAccessKey,
|
|
|
|
objectStorageSecretKey,
|
|
|
|
objectStorageUseSSL,
|
|
|
|
objectStorageUseProxy,
|
|
|
|
objectStorageSetPublicRead,
|
|
|
|
objectStorageS3ForcePathStyle,
|
|
|
|
}).then(() => {
|
|
|
|
fetchInstance();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-06-20 11:38:49 +03:00
|
|
|
const headerTabs = $computed(() => []);
|
|
|
|
|
|
|
|
definePageMetadata({
|
|
|
|
title: i18n.ts.objectStorage,
|
2022-12-19 12:01:30 +02:00
|
|
|
icon: 'ti ti-cloud',
|
2021-04-22 16:29:33 +03:00
|
|
|
});
|
|
|
|
</script>
|
2023-03-02 13:47:24 +02:00
|
|
|
|
|
|
|
<style lang="scss" module>
|
|
|
|
.footer {
|
|
|
|
-webkit-backdrop-filter: var(--blur, blur(15px));
|
|
|
|
backdrop-filter: var(--blur, blur(15px));
|
|
|
|
}
|
|
|
|
</style>
|