Skip to content

Commit 704d8d5

Browse files
committed
support to duplicate a store on ui
1 parent 4a7fed9 commit 704d8d5

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

console/atest-ui/src/views/StoreManager.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,11 @@ function storeVerify(formEl: FormInstance | undefined) {
192192
})
193193
}
194194
195+
const storeDuplicate = async (formEl: FormInstance | undefined) => {
196+
createAction.value = true
197+
storeForm.name += '-copy'
198+
}
199+
195200
function updateKeys() {
196201
const props = storeForm.properties
197202
if (props.findIndex(p => p.key === '') === -1) {
@@ -275,7 +280,7 @@ const storeExtLink = ref('')
275280
ref="storeFormRef"
276281
status-icon label-width="120px">
277282
<el-form-item :label="t('field.name')" prop="name">
278-
<el-input v-model="storeForm.name" test-id="store-form-name" />
283+
<el-input v-model="storeForm.name" test-id="store-form-name" :disabled="!createAction"/>
279284
</el-form-item>
280285
<el-form-item label="URL" prop="url">
281286
<el-input v-model="storeForm.url" placeholder="http://foo" test-id="store-form-url" />
@@ -348,6 +353,11 @@ const storeExtLink = ref('')
348353
test-id="store-form-verify"
349354
>{{t('button.verify')}}</Button
350355
>
356+
<Button
357+
type="primary"
358+
v-if="!createAction"
359+
@click="storeDuplicate(storeFormRef)"
360+
>{{t('button.duplicate')}}</Button>
351361
<Button
352362
type="primary"
353363
@click="submitForm(storeFormRef)"

0 commit comments

Comments
 (0)