mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-01-31 14:08:06 +08:00
parent
f77681b9c9
commit
0e6fdffeec
@ -27,12 +27,16 @@ func NewS3Client(vars map[string]interface{}) (*s3Client, error) {
|
|||||||
if len(scType) == 0 {
|
if len(scType) == 0 {
|
||||||
scType = "Standard"
|
scType = "Standard"
|
||||||
}
|
}
|
||||||
|
mode := loadParamFromVars("mode", vars)
|
||||||
|
if len(mode) == 0 {
|
||||||
|
mode = "virtual hosted"
|
||||||
|
}
|
||||||
sess, err := session.NewSession(&aws.Config{
|
sess, err := session.NewSession(&aws.Config{
|
||||||
Credentials: credentials.NewStaticCredentials(accessKey, secretKey, ""),
|
Credentials: credentials.NewStaticCredentials(accessKey, secretKey, ""),
|
||||||
Endpoint: aws.String(endpoint),
|
Endpoint: aws.String(endpoint),
|
||||||
Region: aws.String(region),
|
Region: aws.String(region),
|
||||||
DisableSSL: aws.Bool(true),
|
DisableSSL: aws.Bool(true),
|
||||||
S3ForcePathStyle: aws.Bool(false),
|
S3ForcePathStyle: aws.Bool(mode == "path"),
|
||||||
})
|
})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
@ -1410,6 +1410,7 @@ const message = {
|
|||||||
LOCAL: 'Server Disks',
|
LOCAL: 'Server Disks',
|
||||||
OSS: 'Ali OSS',
|
OSS: 'Ali OSS',
|
||||||
S3: 'Amazon S3',
|
S3: 'Amazon S3',
|
||||||
|
mode: 'Mode',
|
||||||
MINIO: 'MINIO',
|
MINIO: 'MINIO',
|
||||||
SFTP: 'SFTP',
|
SFTP: 'SFTP',
|
||||||
WebDAV: 'WebDAV',
|
WebDAV: 'WebDAV',
|
||||||
|
@ -1323,6 +1323,7 @@ const message = {
|
|||||||
LOCAL: '服務器磁盤',
|
LOCAL: '服務器磁盤',
|
||||||
OSS: '阿裏雲 OSS',
|
OSS: '阿裏雲 OSS',
|
||||||
S3: '亞馬遜 S3 雲存儲',
|
S3: '亞馬遜 S3 雲存儲',
|
||||||
|
mode: '模式',
|
||||||
MINIO: 'MINIO',
|
MINIO: 'MINIO',
|
||||||
SFTP: 'SFTP',
|
SFTP: 'SFTP',
|
||||||
WebDAV: 'WebDAV',
|
WebDAV: 'WebDAV',
|
||||||
|
@ -1327,6 +1327,7 @@ const message = {
|
|||||||
LOCAL: '服务器磁盘',
|
LOCAL: '服务器磁盘',
|
||||||
OSS: '阿里云 OSS',
|
OSS: '阿里云 OSS',
|
||||||
S3: '亚马逊 S3 云存储',
|
S3: '亚马逊 S3 云存储',
|
||||||
|
mode: '模式',
|
||||||
MINIO: 'MINIO',
|
MINIO: 'MINIO',
|
||||||
SFTP: 'SFTP',
|
SFTP: 'SFTP',
|
||||||
WebDAV: 'WebDAV',
|
WebDAV: 'WebDAV',
|
||||||
|
@ -47,7 +47,7 @@
|
|||||||
<el-form-item label="Endpoint" prop="varsJson.endpointItem" :rules="Rules.requiredInput">
|
<el-form-item label="Endpoint" prop="varsJson.endpointItem" :rules="Rules.requiredInput">
|
||||||
<el-input v-model.trim="cosData.rowData!.varsJson['endpointItem']">
|
<el-input v-model.trim="cosData.rowData!.varsJson['endpointItem']">
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<el-select v-model.trim="endpointProto" style="width: 100px">
|
<el-select v-model.trim="endpointProto" style="width: 120px">
|
||||||
<el-option label="http" value="http" />
|
<el-option label="http" value="http" />
|
||||||
<el-option label="https" value="https" />
|
<el-option label="https" value="https" />
|
||||||
</el-select>
|
</el-select>
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
>
|
>
|
||||||
<el-input v-model="kodoData.rowData!.varsJson['domainItem']">
|
<el-input v-model="kodoData.rowData!.varsJson['domainItem']">
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<el-select v-model.trim="domainProto" style="width: 100px">
|
<el-select v-model.trim="domainProto" style="width: 120px">
|
||||||
<el-option label="http" value="http" />
|
<el-option label="http" value="http" />
|
||||||
<el-option label="https" value="https" />
|
<el-option label="https" value="https" />
|
||||||
</el-select>
|
</el-select>
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<el-form-item label="Endpoint" prop="varsJson.endpointItem" :rules="Rules.requiredInput">
|
<el-form-item label="Endpoint" prop="varsJson.endpointItem" :rules="Rules.requiredInput">
|
||||||
<el-input v-model="minioData.rowData!.varsJson['endpointItem']">
|
<el-input v-model="minioData.rowData!.varsJson['endpointItem']">
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<el-select v-model.trim="endpointProto" style="width: 100px">
|
<el-select v-model.trim="endpointProto" style="width: 120px">
|
||||||
<el-option label="http" value="http" />
|
<el-option label="http" value="http" />
|
||||||
<el-option label="https" value="https" />
|
<el-option label="https" value="https" />
|
||||||
</el-select>
|
</el-select>
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
<el-form-item label="Endpoint" prop="varsJson.endpointItem" :rules="Rules.requiredInput">
|
<el-form-item label="Endpoint" prop="varsJson.endpointItem" :rules="Rules.requiredInput">
|
||||||
<el-input v-model="ossData.rowData!.varsJson['endpointItem']">
|
<el-input v-model="ossData.rowData!.varsJson['endpointItem']">
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<el-select v-model.trim="endpointProto" style="width: 100px">
|
<el-select v-model.trim="endpointProto" style="width: 120px">
|
||||||
<el-option label="http" value="http" />
|
<el-option label="http" value="http" />
|
||||||
<el-option label="https" value="https" />
|
<el-option label="https" value="https" />
|
||||||
</el-select>
|
</el-select>
|
||||||
|
@ -16,6 +16,12 @@
|
|||||||
<el-form-item :label="$t('commons.table.type')" prop="type" :rules="Rules.requiredSelect">
|
<el-form-item :label="$t('commons.table.type')" prop="type" :rules="Rules.requiredSelect">
|
||||||
<el-tag>{{ $t('setting.' + s3Data.rowData!.type) }}</el-tag>
|
<el-tag>{{ $t('setting.' + s3Data.rowData!.type) }}</el-tag>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<el-form-item :label="$t('setting.mode')" prop="varsJson.mode" :rules="Rules.requiredSelect">
|
||||||
|
<el-radio-group v-model="s3Data.rowData!.varsJson['mode']">
|
||||||
|
<el-radio value="virtual hosted">Virtual Hosted</el-radio>
|
||||||
|
<el-radio value="path">Path</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
<el-form-item label="Access Key ID" prop="accessKey" :rules="Rules.requiredInput">
|
<el-form-item label="Access Key ID" prop="accessKey" :rules="Rules.requiredInput">
|
||||||
<el-input v-model.trim="s3Data.rowData!.accessKey" />
|
<el-input v-model.trim="s3Data.rowData!.accessKey" />
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -28,7 +34,7 @@
|
|||||||
<el-form-item label="Endpoint" prop="varsJson.endpointItem" :rules="Rules.requiredInput">
|
<el-form-item label="Endpoint" prop="varsJson.endpointItem" :rules="Rules.requiredInput">
|
||||||
<el-input v-model="s3Data.rowData!.varsJson['endpointItem']">
|
<el-input v-model="s3Data.rowData!.varsJson['endpointItem']">
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<el-select v-model.trim="endpointProto" style="width: 100px">
|
<el-select v-model="endpointProto" style="width: 120px">
|
||||||
<el-option label="http" value="http" />
|
<el-option label="http" value="http" />
|
||||||
<el-option label="https" value="https" />
|
<el-option label="https" value="https" />
|
||||||
</el-select>
|
</el-select>
|
||||||
@ -117,9 +123,12 @@ const s3Data = ref<DialogProps>({
|
|||||||
const acceptParams = (params: DialogProps): void => {
|
const acceptParams = (params: DialogProps): void => {
|
||||||
buckets.value = [];
|
buckets.value = [];
|
||||||
s3Data.value = params;
|
s3Data.value = params;
|
||||||
if (params.title === 'create' || (params.title === 'edit' && !s3Data.value.rowData.varsJson['scType'])) {
|
if (!s3Data.value.rowData.varsJson['scType']) {
|
||||||
s3Data.value.rowData.varsJson['scType'] = 'STANDARD';
|
s3Data.value.rowData.varsJson['scType'] = 'STANDARD';
|
||||||
}
|
}
|
||||||
|
if (!s3Data.value.rowData.varsJson['mode']) {
|
||||||
|
s3Data.value.rowData.varsJson['mode'] = 'virtual hosted';
|
||||||
|
}
|
||||||
if (s3Data.value.title === 'edit') {
|
if (s3Data.value.title === 'edit') {
|
||||||
let httpItem = splitHttp(s3Data.value.rowData!.varsJson['endpoint']);
|
let httpItem = splitHttp(s3Data.value.rowData!.varsJson['endpoint']);
|
||||||
s3Data.value.rowData!.varsJson['endpointItem'] = httpItem.url;
|
s3Data.value.rowData!.varsJson['endpointItem'] = httpItem.url;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user