1818 <span >生命周期</span >
1919 </n-button >
2020
21- <n-button >
21+ <!-- < n-button>
2222 <Icon name="ri:key-2-line" class="mr-2" />
2323 <span>访问权限</span>
24- </n-button >
24+ </n-button> -->
2525
2626 <n-button >
2727 <Icon name =" ri:surgical-mask-line" class =" mr-2" />
5858 <n-descriptions-item class =" font-bold" >
5959 <template #label >
6060 当前状态
61- <n-button quaternary round type =" primary" >
61+ <n-button class = " align-middle " quaternary round type =" primary" >
6262 <Icon name =" ri:edit-2-line" class =" mr-2" />
6363 </n-button >
6464 </template >
6767 <n-descriptions-item >
6868 <template #label >
6969 访问策略
70- <n-button quaternary round type =" primary" >
70+ <n-button class = " align-middle " quaternary round type =" primary" >
7171 <Icon name =" ri:edit-2-line" class =" mr-2" />
7272 </n-button >
7373 </template >
7474 {{ 111 }}
7575 </n-descriptions-item >
7676 <n-descriptions-item >
7777 <template #label >
78- 加密
79- <n-button quaternary round type =" primary" >
78+ 加密类型
79+ <n-button class = " align-middle " quaternary round type =" primary" @click = " editEncript " >
8080 <Icon name =" ri:edit-2-line" class =" mr-2" />
8181 </n-button >
8282 </template >
83- todo
83+ 禁用
8484 </n-descriptions-item >
8585 <n-descriptions-item >
8686 <template #label >
8787 使用情况报告
88- <n-button quaternary round type =" primary" >
88+ <n-button class = " align-middle " quaternary round type =" primary" >
8989 <Icon name =" ri:edit-2-line" class =" mr-2" />
9090 </n-button >
9191 </template >
9494 <n-descriptions-item >
9595 <template #label >
9696 副本
97- <n-button quaternary round type =" primary" >
97+ <n-button class = " align-middle " quaternary round type =" primary" >
9898 <Icon name =" ri:edit-2-line" class =" mr-2" />
9999 </n-button >
100100 </template >
112112 <n-descriptions-item >
113113 <template #label >
114114 配额
115- <n-button quaternary round type =" primary" >
116- <Icon name =" ri:edit-2-line" class = " mr-2 " />
115+ <n-button class = " align-middle " quaternary round type =" primary" >
116+ <Icon name =" ri:edit-2-line" />
117117 </n-button >
118118 </template >
119119 todo
120120 </n-descriptions-item >
121121 <n-descriptions-item class =" w-1/2" >
122122 <template #label >
123123 标签
124- <n-button quaternary round type =" primary" @click =" addTag" >
125- <Icon name =" ri:edit-2- line" class =" mr-2" />
124+ <n-button class = " align-middle " round quaternary type =" primary" @click =" addTag" >
125+ <Icon name =" ri:add- line" size = " 16 " class =" mr-2" />
126126 </n-button >
127127 </template >
128128 <n-tag
154154 <!-- tag -->
155155 <n-modal v-model:show =" showTagModal" title =" 设置tag" preset =" card" draggable :style =" { width: '550px' }" >
156156 <n-form ref =" formRef" inline :label-width =" 80" :model =" tagFormValue" >
157- <n-form-item label =" 标签key" path =" user. name" >
157+ <n-form-item label =" 标签key" path =" name" >
158158 <n-input v-model:value =" tagFormValue.name" placeholder =" 输入标签key" />
159159 </n-form-item >
160- <n-form-item label =" 标签值" path =" phone " >
160+ <n-form-item label =" 标签值" path =" value " >
161161 <n-input v-model:value =" tagFormValue.value" placeholder =" 输入标签值" />
162162 </n-form-item >
163163 <n-form-item >
166166 </n-form-item >
167167 </n-form >
168168 </n-modal >
169+
170+ <!-- Encrypt -->
171+ <n-modal v-model:show =" showEncryptModal" title =" 启用存储空间加密" preset =" card" draggable :style =" { width: '550px' }" >
172+ <n-form ref =" encryptFormRef" label-placemen =" left" label-width =" auto" inline :model =" encryptFormValue" >
173+ <n-form-item label =" 加密类型" path =" encrypt" class =" flex-auto" >
174+ <n-select v-model:value =" encryptFormValue.encrypt" placeholder =" 请选择加密类型" :options =" encryptOptions" />
175+ </n-form-item >
176+ <n-form-item v-if =" encryptFormValue.encrypt == 'SSE-KMS'" label =" KMS Key ID" path =" kmsKeyId" class =" flex-auto" >
177+ <n-select v-model:value =" encryptFormValue.kmsKeyId" placeholder =" " :options =" []" />
178+ </n-form-item >
179+
180+ <n-form-item >
181+ <n-button type =" primary" @click =" submitEncryptForm" >确认</n-button >
182+ <n-button class =" mx-4" @click =" showEncryptModal = false" >取消</n-button >
183+ </n-form-item >
184+ </n-form >
185+ </n-modal >
169186</template >
170187
171188<script setup lang="ts">
@@ -180,6 +197,47 @@ const bucketName = computed(() => props.bucket as string)
180197
181198const { headBucket, getBucketTagging, putBucketTagging, putBucketVersioning, getBucketVersioning } = useBucket ({})
182199
200+ /** ******Encrypt ***********************/
201+ const showEncryptModal = ref (false )
202+ const encryptFormValue = ref ({
203+ encrypt: " disabled" ,
204+ kmsKeyId: " " ,
205+ })
206+
207+ const encryptOptions = [
208+ {
209+ label: " 禁用" ,
210+ value: " disabled" ,
211+ },
212+ {
213+ label: " SSE-KMS" ,
214+ value: " SSE-KMS" ,
215+ },
216+ {
217+ label: " SSE-S3" ,
218+ value: " SSE-S3" ,
219+ },
220+ ]
221+
222+ const editEncript = () => {
223+ showEncryptModal .value = true
224+ }
225+ const submitEncryptForm = () => {
226+ // 处理表单提交逻辑
227+ // console.log("提交表单数据:", encryptFormValue.value)
228+ // showEncryptModal.value = false
229+ if (encryptFormValue .value .encrypt == " SSE-KMS" ) {
230+ message .error (" 您提供的 XML 格式不正确,或者未根据我们发布的架构进行验证。 (MasterKeyID 未找到 aws:kms)。" )
231+ } else if (encryptFormValue .value .encrypt == " SSE-S3" ) {
232+ message .error (" 指定了服务器端加密,但S3未配置。" )
233+ } else {
234+ message .success (" 修改成功" )
235+ showEncryptModal .value = false
236+ }
237+ }
238+
239+ /** ******Encrypt ***********************/
240+
183241/** ******versioning ***********************/
184242const versioningStatus: any = ref (" " )
185243const versionStatus = ref (" Suspended" )
0 commit comments