@@ -10,6 +10,7 @@ import domain from '@/api/domain'
1010import {Badge , message } from ' ant-design-vue'
1111import {h , ref } from ' vue'
1212import {input } from ' @/components/StdDataEntry'
13+ import SiteDuplicate from ' @/views/domain/SiteDuplicate.vue'
1314
1415const columns = [{
1516 title : () => $gettext (' Name' ),
@@ -25,7 +26,7 @@ const columns = [{
2526 dataIndex: ' enabled' ,
2627 customRender : (args : customRender ) => {
2728 const template: any = []
28- const {text, column } = args
29+ const {text} = args
2930 if (text === true || text > 0 ) {
3031 template .push (<Badge status = " success" />)
3132 template .push ($gettext (' Enabled' ))
@@ -83,6 +84,15 @@ function destroy(site_name: any) {
8384 message .error (e ?.message ?? $gettext (' Server error' ))
8485 })
8586}
87+
88+ const show_duplicator = ref (false )
89+
90+ const target = ref (' ' )
91+
92+ function handle_click_duplicate(name : string ) {
93+ show_duplicator .value = true
94+ target .value = name
95+ }
8696 </script >
8797
8898<template >
@@ -99,25 +109,30 @@ function destroy(site_name: any) {
99109 >
100110 <template #actions =" {record } " >
101111 <a-divider type =" vertical" />
102- <a v-if =" record.enabled" @click =" disable(record.name)" >
112+ <a-button type = " link " size = " small " v-if =" record.enabled" @click =" disable(record.name)" >
103113 {{ $gettext('Disabled') }}
104- </a >
105- <a v-else @click =" enable(record.name)" >
114+ </a-button >
115+ <a-button type = " link " size = " small " v-else @click =" enable(record.name)" >
106116 {{ $gettext('Enabled') }}
107- </a >
108- <template v-if =" ! record .enabled " >
109- <a-divider type =" vertical" />
110- <a-popconfirm
111- :cancelText =" $gettext('No')"
112- :okText =" $gettext('OK')"
113- :title =" $gettext('Are you sure you want to delete?')"
114- @confirm =" destroy(record['name'])" >
115- <a v-translate >Delete</a >
116- </a-popconfirm >
117- </template >
117+ </a-button >
118+ <a-divider type =" vertical" />
119+ <a-button type =" link" size =" small" @click =" handle_click_duplicate(record.name)" >
120+ {{ $gettext('Duplicate') }}
121+ </a-button >
122+ <a-divider type =" vertical" />
123+ <a-popconfirm
124+ :cancelText =" $gettext('No')"
125+ :okText =" $gettext('OK')"
126+ :title =" $gettext('Are you sure you want to delete?')"
127+ @confirm =" destroy(record['name'])" >
128+ <a-button type =" link" size =" small" :disabled =" record.enabled" >
129+ {{ $gettext('Delete') }}
130+ </a-button >
131+ </a-popconfirm >
118132 </template >
119133 </std-table >
120134 </a-card >
135+ <site-duplicate v-model:visible =" show_duplicator" :name =" target" @duplicated =" table.get_list()" />
121136</template >
122137
123138<style scoped>
0 commit comments