Skip to content

Commit 65ae413

Browse files
committed
feat: change cert from cert list #29
1 parent ba924cd commit 65ae413

File tree

1 file changed

+10
-37
lines changed

1 file changed

+10
-37
lines changed

frontend/src/views/domain/cert/ChangeCert.vue

Lines changed: 10 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ const props = defineProps(['directivesMap'])
1313
1414
const visible = ref(false)
1515
16+
const record: any = ref({})
17+
1618
const columns = [{
1719
title: () => $gettext('Name'),
1820
dataIndex: 'name',
@@ -29,15 +31,6 @@ const columns = [{
2931
type: input
3032
},
3133
search: true
32-
}, {
33-
title: () => $gettext('Domain'),
34-
dataIndex: 'domain',
35-
sorter: true,
36-
pithy: true,
37-
edit: {
38-
type: input
39-
},
40-
search: true
4134
}, {
4235
title: () => $gettext('Auto Cert'),
4336
dataIndex: 'auto_cert',
@@ -55,41 +48,20 @@ const columns = [{
5548
},
5649
sorter: true,
5750
pithy: true
58-
}, {
59-
title: () => $gettext('SSL Certificate Path'),
60-
dataIndex: 'ssl_certificate_path',
61-
edit: {
62-
type: input
63-
},
64-
display: false
65-
}, {
66-
title: () => $gettext('SSL Certificate Key Path'),
67-
dataIndex: 'ssl_certificate_key_path',
68-
edit: {
69-
type: input
70-
},
71-
display: false
72-
}, {
73-
title: () => $gettext('Updated at'),
74-
dataIndex: 'updated_at',
75-
customRender: datetime,
76-
sorter: true,
77-
pithy: true
78-
}, {
79-
title: () => $gettext('Action'),
80-
dataIndex: 'action'
8151
}]
8252
8353
function open() {
8454
visible.value = true
8555
}
8656
87-
function onSelect() {
88-
57+
function onSelectedRecord(r: any) {
58+
record.value = r
8959
}
9060
91-
function onSelectedRecord() {
92-
61+
function ok() {
62+
props.directivesMap['ssl_certificate'][0]['params'] = record.value.ssl_certificate_path
63+
props.directivesMap['ssl_certificate_key'][0]['params'] = record.value.ssl_certificate_key_path
64+
visible.value = false
9365
}
9466
</script>
9567

@@ -100,12 +72,13 @@ function onSelectedRecord() {
10072
:title="$gettext('Change Certificate')"
10173
v-model:visible="visible"
10274
:mask="false"
75+
@ok="ok"
10376
>
10477
<std-table
10578
:api="cert"
10679
:pithy="true"
10780
:columns="columns"
108-
@onSelected="onSelect"
81+
selectionType="radio"
10982
@onSelectedRecord="onSelectedRecord"
11083
/>
11184
</a-modal>

0 commit comments

Comments
 (0)