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