2021-04-22 22:29:33 +09:00
|
|
|
<template>
|
|
|
|
<FormBase>
|
|
|
|
<FormSuspense :p="init">
|
2021-09-30 00:50:45 +09:00
|
|
|
<FormSwitch v-model="useObjectStorage">{{ $ts.useObjectStorage }}</FormSwitch>
|
2021-04-22 22:29:33 +09:00
|
|
|
|
|
|
|
<template v-if="useObjectStorage">
|
2021-09-30 00:50:45 +09:00
|
|
|
<FormInput v-model="objectStorageBaseUrl">
|
2021-04-22 22:29:33 +09:00
|
|
|
<span>{{ $ts.objectStorageBaseUrl }}</span>
|
|
|
|
<template #desc>{{ $ts.objectStorageBaseUrlDesc }}</template>
|
|
|
|
</FormInput>
|
|
|
|
|
2021-09-30 00:50:45 +09:00
|
|
|
<FormInput v-model="objectStorageBucket">
|
2021-04-22 22:29:33 +09:00
|
|
|
<span>{{ $ts.objectStorageBucket }}</span>
|
|
|
|
<template #desc>{{ $ts.objectStorageBucketDesc }}</template>
|
|
|
|
</FormInput>
|
|
|
|
|
2021-09-30 00:50:45 +09:00
|
|
|
<FormInput v-model="objectStoragePrefix">
|
2021-04-22 22:29:33 +09:00
|
|
|
<span>{{ $ts.objectStoragePrefix }}</span>
|
|
|
|
<template #desc>{{ $ts.objectStoragePrefixDesc }}</template>
|
|
|
|
</FormInput>
|
|
|
|
|
2021-09-30 00:50:45 +09:00
|
|
|
<FormInput v-model="objectStorageEndpoint">
|
2021-04-22 22:29:33 +09:00
|
|
|
<span>{{ $ts.objectStorageEndpoint }}</span>
|
|
|
|
<template #desc>{{ $ts.objectStorageEndpointDesc }}</template>
|
|
|
|
</FormInput>
|
|
|
|
|
2021-09-30 00:50:45 +09:00
|
|
|
<FormInput v-model="objectStorageRegion">
|
2021-04-22 22:29:33 +09:00
|
|
|
<span>{{ $ts.objectStorageRegion }}</span>
|
|
|
|
<template #desc>{{ $ts.objectStorageRegionDesc }}</template>
|
|
|
|
</FormInput>
|
|
|
|
|
2021-09-30 00:50:45 +09:00
|
|
|
<FormInput v-model="objectStorageAccessKey">
|
2021-04-22 22:29:33 +09:00
|
|
|
<template #prefix><i class="fas fa-key"></i></template>
|
|
|
|
<span>Access key</span>
|
|
|
|
</FormInput>
|
|
|
|
|
2021-09-30 00:50:45 +09:00
|
|
|
<FormInput v-model="objectStorageSecretKey">
|
2021-04-22 22:29:33 +09:00
|
|
|
<template #prefix><i class="fas fa-key"></i></template>
|
|
|
|
<span>Secret key</span>
|
|
|
|
</FormInput>
|
|
|
|
|
2021-09-30 00:50:45 +09:00
|
|
|
<FormSwitch v-model="objectStorageUseSSL">
|
2021-04-22 22:29:33 +09:00
|
|
|
{{ $ts.objectStorageUseSSL }}
|
|
|
|
<template #desc>{{ $ts.objectStorageUseSSLDesc }}</template>
|
|
|
|
</FormSwitch>
|
|
|
|
|
2021-09-30 00:50:45 +09:00
|
|
|
<FormSwitch v-model="objectStorageUseProxy">
|
2021-04-22 22:29:33 +09:00
|
|
|
{{ $ts.objectStorageUseProxy }}
|
|
|
|
<template #desc>{{ $ts.objectStorageUseProxyDesc }}</template>
|
|
|
|
</FormSwitch>
|
|
|
|
|
2021-09-30 00:50:45 +09:00
|
|
|
<FormSwitch v-model="objectStorageSetPublicRead">
|
2021-04-22 22:29:33 +09:00
|
|
|
{{ $ts.objectStorageSetPublicRead }}
|
|
|
|
</FormSwitch>
|
|
|
|
|
2021-09-30 00:50:45 +09:00
|
|
|
<FormSwitch v-model="objectStorageS3ForcePathStyle">
|
2021-04-22 22:29:33 +09:00
|
|
|
s3ForcePathStyle
|
|
|
|
</FormSwitch>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<FormButton @click="save" primary><i class="fas fa-save"></i> {{ $ts.save }}</FormButton>
|
|
|
|
</FormSuspense>
|
|
|
|
</FormBase>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
import { defineComponent } from 'vue';
|
2021-09-30 00:50:45 +09:00
|
|
|
import FormSwitch from '@client/components/debobigego/switch.vue';
|
|
|
|
import FormInput from '@client/components/debobigego/input.vue';
|
|
|
|
import FormButton from '@client/components/debobigego/button.vue';
|
|
|
|
import FormBase from '@client/components/debobigego/base.vue';
|
|
|
|
import FormGroup from '@client/components/debobigego/group.vue';
|
|
|
|
import FormSuspense from '@client/components/debobigego/suspense.vue';
|
2021-04-22 22:29:33 +09:00
|
|
|
import * as os from '@client/os';
|
|
|
|
import * as symbols from '@client/symbols';
|
|
|
|
import { fetchInstance } from '@client/instance';
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
components: {
|
|
|
|
FormSwitch,
|
|
|
|
FormInput,
|
|
|
|
FormBase,
|
|
|
|
FormGroup,
|
|
|
|
FormButton,
|
|
|
|
FormSuspense,
|
|
|
|
},
|
|
|
|
|
|
|
|
emits: ['info'],
|
|
|
|
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
[symbols.PAGE_INFO]: {
|
|
|
|
title: this.$ts.objectStorage,
|
2021-10-10 15:19:16 +09:00
|
|
|
icon: 'fas fa-cloud',
|
|
|
|
bg: 'var(--bg)',
|
2021-04-22 22:29:33 +09:00
|
|
|
},
|
|
|
|
useObjectStorage: false,
|
|
|
|
objectStorageBaseUrl: null,
|
|
|
|
objectStorageBucket: null,
|
|
|
|
objectStoragePrefix: null,
|
|
|
|
objectStorageEndpoint: null,
|
|
|
|
objectStorageRegion: null,
|
|
|
|
objectStoragePort: null,
|
|
|
|
objectStorageAccessKey: null,
|
|
|
|
objectStorageSecretKey: null,
|
|
|
|
objectStorageUseSSL: false,
|
|
|
|
objectStorageUseProxy: false,
|
|
|
|
objectStorageSetPublicRead: false,
|
|
|
|
objectStorageS3ForcePathStyle: true,
|
|
|
|
}
|
|
|
|
},
|
|
|
|
|
|
|
|
async mounted() {
|
|
|
|
this.$emit('info', this[symbols.PAGE_INFO]);
|
|
|
|
},
|
|
|
|
|
|
|
|
methods: {
|
|
|
|
async init() {
|
|
|
|
const meta = await os.api('meta', { detail: true });
|
|
|
|
this.useObjectStorage = meta.useObjectStorage;
|
|
|
|
this.objectStorageBaseUrl = meta.objectStorageBaseUrl;
|
|
|
|
this.objectStorageBucket = meta.objectStorageBucket;
|
|
|
|
this.objectStoragePrefix = meta.objectStoragePrefix;
|
|
|
|
this.objectStorageEndpoint = meta.objectStorageEndpoint;
|
|
|
|
this.objectStorageRegion = meta.objectStorageRegion;
|
|
|
|
this.objectStoragePort = meta.objectStoragePort;
|
|
|
|
this.objectStorageAccessKey = meta.objectStorageAccessKey;
|
|
|
|
this.objectStorageSecretKey = meta.objectStorageSecretKey;
|
|
|
|
this.objectStorageUseSSL = meta.objectStorageUseSSL;
|
|
|
|
this.objectStorageUseProxy = meta.objectStorageUseProxy;
|
|
|
|
this.objectStorageSetPublicRead = meta.objectStorageSetPublicRead;
|
|
|
|
this.objectStorageS3ForcePathStyle = meta.objectStorageS3ForcePathStyle;
|
|
|
|
},
|
|
|
|
save() {
|
|
|
|
os.apiWithDialog('admin/update-meta', {
|
|
|
|
useObjectStorage: this.useObjectStorage,
|
|
|
|
objectStorageBaseUrl: this.objectStorageBaseUrl ? this.objectStorageBaseUrl : null,
|
|
|
|
objectStorageBucket: this.objectStorageBucket ? this.objectStorageBucket : null,
|
|
|
|
objectStoragePrefix: this.objectStoragePrefix ? this.objectStoragePrefix : null,
|
|
|
|
objectStorageEndpoint: this.objectStorageEndpoint ? this.objectStorageEndpoint : null,
|
|
|
|
objectStorageRegion: this.objectStorageRegion ? this.objectStorageRegion : null,
|
|
|
|
objectStoragePort: this.objectStoragePort ? this.objectStoragePort : null,
|
|
|
|
objectStorageAccessKey: this.objectStorageAccessKey ? this.objectStorageAccessKey : null,
|
|
|
|
objectStorageSecretKey: this.objectStorageSecretKey ? this.objectStorageSecretKey : null,
|
|
|
|
objectStorageUseSSL: this.objectStorageUseSSL,
|
|
|
|
objectStorageUseProxy: this.objectStorageUseProxy,
|
|
|
|
objectStorageSetPublicRead: this.objectStorageSetPublicRead,
|
|
|
|
objectStorageS3ForcePathStyle: this.objectStorageS3ForcePathStyle,
|
|
|
|
}).then(() => {
|
|
|
|
fetchInstance();
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
</script>
|