minio 策略增加 bucket_endpoint 选项配置

This commit is contained in:
Wisp X 2022-09-20 09:01:49 +08:00
parent bb9ef6e267
commit 1925a1ae7a
5 changed files with 16 additions and 1 deletions

View File

@ -21,4 +21,7 @@ final class MinioOption
/** @var string Bucket */
const Bucket = 'bucket';
/** @var string BucketEndpoint */
const BucketEndpoint = 'bucket_endpoint';
}

View File

@ -131,6 +131,7 @@ class StrategyRequest extends FormRequest
'configs.endpoint' => '',
'configs.region' => '',
'configs.bucket' => 'required',
'configs.bucket_endpoint' => '',
],
});
}
@ -209,6 +210,7 @@ class StrategyRequest extends FormRequest
'configs.endpoint' => '连接地址',
'configs.region' => '区域',
'configs.bucket' => 'Bucket 名称',
'configs.bucket_endpoint' => 'BucketEndpoint',
],
});
}

View File

@ -352,7 +352,7 @@ class ImageService
'endpoint' => $configs->get(MinioOption::Endpoint),
'region' => $configs->get(MinioOption::Region),
'version' => '2006-03-01',
'bucket_endpoint' => true,
'bucket_endpoint' => (bool)$configs->get(MinioOption::BucketEndpoint),
]),
bucket: $configs->get(MinioOption::Bucket),
),

View File

@ -335,6 +335,11 @@
<label for="configs[bucket]" class="block text-sm font-medium text-gray-700"><span class="text-red-600">*</span>Bucket 名称</label>
<x-input type="text" name="configs[bucket]" id="configs[bucket]" placeholder="请输入 Bucket 名称" />
</div>
<div class="col-span-6">
<label for="configs[bucket_endpoint]" class="block text-sm font-medium mb-2 text-gray-700">BucketEndpoint</label>
<x-switch id="configs[bucket_endpoint]" name="configs[bucket_endpoint]" value="1"></x-switch>
<p><small class="text-gray-500"><i class="fas fa-exclamation-circle"></i> 开启此选项后将会直接以「连接地址」作为数据交互传输域名,否则可能会以桶名称拼接域名(例如http://桶名称.连接地址.com)</small></p>
</div>
</div>
</div>
<div class="px-4 py-3 bg-gray-50 text-right sm:px-6">

View File

@ -357,6 +357,11 @@
<label for="configs[bucket]" class="block text-sm font-medium text-gray-700"><span class="text-red-600">*</span>储存桶名称</label>
<x-input type="text" name="configs[bucket]" id="configs[bucket]" placeholder="请输入 Bucket 名称" value="{{ $strategy->configs->get('bucket') }}" />
</div>
<div class="col-span-6">
<label for="configs[bucket_endpoint]" class="block text-sm font-medium mb-2 text-gray-700">BucketEndpoint</label>
<x-switch id="configs[bucket_endpoint]" name="configs[bucket_endpoint]" value="1" :checked="(bool)$strategy->configs->get('bucket_endpoint')"></x-switch>
<p><small class="text-gray-500"><i class="fas fa-exclamation-circle"></i> 开启此选项后将会直接以「连接地址」作为数据交互传输域名,否则可能会以桶名称拼接域名(例如http://桶名称.连接地址.com)</small></p>
</div>
</div>
@endif
</div>