Minio 增加区域配置

This commit is contained in:
Wisp X 2022-03-15 08:03:55 +08:00
parent 08e016e8b0
commit a9650b6780
5 changed files with 13 additions and 1 deletions

View File

@ -16,6 +16,9 @@ final class MinioOption
/** @var string Endpoint */
const Endpoint = 'endpoint';
/** @var string 区域 */
const Region = 'region';
/** @var string Bucket */
const Bucket = 'bucket';
}

View File

@ -127,6 +127,7 @@ class StrategyRequest extends FormRequest
'configs.access_key' => 'required',
'configs.secret_key' => 'required',
'configs.endpoint' => 'required',
'configs.region' => '',
'configs.bucket' => 'required',
],
});

View File

@ -319,7 +319,7 @@ class ImageService
'secret' => $configs->get(MinioOption::SecretKey)
],
'endpoint' => $configs->get(MinioOption::Endpoint),
'region' => '',
'region' => $configs->get(MinioOption::Region),
'version' => '2006-03-01',
]),
bucket: $configs->get(MinioOption::Bucket),

View File

@ -286,6 +286,10 @@
<label for="configs[secret_key]" class="block text-sm font-medium text-gray-700"><span class="text-red-600">*</span>SecretKey</label>
<x-input type="password" name="configs[secret_key]" id="configs[secret_key]" placeholder="请输入 SecretKey" />
</div>
<div class="col-span-3 sm:col-span-2 mb-4">
<label for="configs[region]" class="block text-sm font-medium text-gray-700">区域(region)</label>
<x-input type="text" name="configs[region]" id="configs[region]" placeholder="请输入区域例如us-east-1" />
</div>
<div class="col-span-3 sm:col-span-2 mb-4">
<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 名称" />

View File

@ -308,6 +308,10 @@
<label for="configs[secret_key]" class="block text-sm font-medium text-gray-700"><span class="text-red-600">*</span>SecretKey</label>
<x-input type="password" name="configs[secret_key]" id="configs[secret_key]" placeholder="请输入 SecretKey" value="{{ $strategy->configs['secret_key'] }}" />
</div>
<div class="col-span-3 sm:col-span-2 mb-4">
<label for="configs[region]" class="block text-sm font-medium text-gray-700">区域(region)</label>
<x-input type="text" name="configs[region]" id="configs[region]" placeholder="请输入区域例如us-east-1" value="{{ $strategy->configs->get('region') }}" />
</div>
<div class="col-span-3 sm:col-span-2 mb-4">
<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['bucket'] }}" />