Skip to content

Commit 418a53f

Browse files
committed
wip: dns credentials manager
1 parent 0f259e4 commit 418a53f

39 files changed

+758
-151
lines changed

frontend/src/api/dns_credential.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Curd from '@/api/curd'
2+
3+
const dns_credential = new Curd('/dns_credential')
4+
5+
export default dns_credential

frontend/src/components/Chart/AreaChart.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ let chartOptions = {
2222
enabled: false
2323
},
2424
animations: {
25-
enabled: false,
25+
enabled: false
2626
},
2727
toolbar: {
2828
show: false
29-
},
29+
}
3030
},
3131
colors: ['#ff6385', '#36a3eb'],
3232
fill: {
@@ -41,7 +41,7 @@ let chartOptions = {
4141
},
4242
stroke: {
4343
curve: 'smooth',
44-
width: 0,
44+
width: 0
4545
},
4646
xaxis: {
4747
type: 'datetime',
@@ -75,7 +75,7 @@ let chartOptions = {
7575
},
7676
onItemHover: {
7777
highlightDataSeries: false
78-
},
78+
}
7979
}
8080
}
8181
@@ -114,7 +114,7 @@ const callback = () => {
114114
},
115115
onItemHover: {
116116
highlightDataSeries: false
117-
},
117+
}
118118
}
119119
}
120120
}

frontend/src/components/ChatGPT/ChatGPT.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,10 @@ import {urlJoin} from '@/lib/helper'
77
import {marked} from 'marked'
88
import hljs from 'highlight.js'
99
import 'highlight.js/styles/vs2015.css'
10-
import {SendOutlined} from '@ant-design/icons-vue'
10+
import Icon, {SendOutlined} from '@ant-design/icons-vue'
1111
import Template from '@/views/template/Template.vue'
1212
import openai from '@/api/openai'
1313
import ChatGPT_logo from '@/assets/svg/ChatGPT_logo.svg'
14-
import Icon from '@ant-design/icons-vue'
1514
1615
const {$gettext} = useGettext()
1716

frontend/src/components/NginxControl/NginxControl.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
<script setup lang="ts">
22
import gettext from '@/gettext'
3-
4-
const {$gettext} = gettext
53
import ngx from '@/api/ngx'
64
import logLevel from '@/views/config/constants'
75
import {message} from 'ant-design-vue'
86
import {ReloadOutlined} from '@ant-design/icons-vue'
97
import Template from '@/views/template/Template.vue'
108
import {ref, watch} from 'vue'
119
10+
const {$gettext} = gettext
11+
1212
function get_status() {
1313
ngx.status().then(r => {
1414
if (r?.running === true) {

frontend/src/components/StdDataDisplay/StdBatchEdit.vue

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
11
<script setup lang="ts">
22
import {reactive, ref} from 'vue'
33
import gettext from '@/gettext'
4-
5-
const {$gettext} = gettext
6-
74
import StdDataEntry from '@/components/StdDataEntry'
85
import {message} from 'ant-design-vue'
96
7+
const {$gettext} = gettext
8+
109
const emit = defineEmits(['onSave'])
1110
1211
const props = defineProps(['api', 'beforeSave'])
@@ -49,23 +48,23 @@ async function ok() {
4948

5049
<template>
5150
<a-modal
52-
class="std-curd-edit-modal"
53-
:mask="false"
54-
:title="$gettext('Batch Modify')"
55-
v-model:visible="visible"
56-
:cancel-text="$gettext('Cancel')"
57-
:ok-text="$gettext('OK')"
58-
@ok="ok"
59-
:confirm-loading="loading"
60-
:width="600"
61-
destroyOnClose
51+
class="std-curd-edit-modal"
52+
:mask="false"
53+
:title="$gettext('Batch Modify')"
54+
v-model:visible="visible"
55+
:cancel-text="$gettext('Cancel')"
56+
:ok-text="$gettext('OK')"
57+
@ok="ok"
58+
:confirm-loading="loading"
59+
:width="600"
60+
destroyOnClose
6261
>
6362

6463
<std-data-entry
65-
ref="std_data_entry"
66-
:data-list="batchColumns"
67-
v-model:data-source="data"
68-
:error="error"
64+
ref="std_data_entry"
65+
:data-list="batchColumns"
66+
v-model:data-source="data"
67+
:error="error"
6968
/>
7069

7170
<slot name="extra"/>
@@ -74,4 +73,4 @@ async function ok() {
7473

7574
<style scoped>
7675
77-
</style>
76+
</style>

frontend/src/components/StdDataDisplay/StdCurd.vue

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import StdTable from './StdTable.vue'
44
55
import StdDataEntry from '@/components/StdDataEntry'
66
7-
import {reactive, ref} from 'vue'
7+
import {provide, reactive, ref} from 'vue'
88
import {message} from 'ant-design-vue'
99
1010
const {$gettext} = gettext
@@ -62,6 +62,7 @@ const props = defineProps({
6262
const visible = ref(false)
6363
const update = ref(0)
6464
const data: any = reactive({id: null})
65+
provide('data', data)
6566
const error: any = reactive({})
6667
const selected = ref([])
6768
@@ -146,12 +147,12 @@ const selectedRowKeys = ref([])
146147
</template>
147148

148149
<std-table
149-
ref="table"
150-
v-model:selected-row-keys="selectedRowKeys"
151-
v-bind="props"
152-
@clickEdit="edit"
153-
@selected="onSelect"
154-
:key="update"
150+
ref="table"
151+
v-model:selected-row-keys="selectedRowKeys"
152+
v-bind="props"
153+
@clickEdit="edit"
154+
@selected="onSelect"
155+
:key="update"
155156
>
156157
<template v-slot:actions="slotProps">
157158
<slot name="actions" :actions="slotProps.record"/>
@@ -160,26 +161,26 @@ const selectedRowKeys = ref([])
160161
</a-card>
161162

162163
<a-modal
163-
class="std-curd-edit-modal"
164-
:mask="false"
165-
:title="edit_text?edit_text:(data.id ? $gettext('Modify') : $gettext('Add'))"
166-
:visible="visible"
167-
:cancel-text="$gettext('Cancel')"
168-
:ok-text="$gettext('OK')"
169-
@cancel="cancel"
170-
@ok="ok"
171-
:width="modalWidth"
172-
destroyOnClose
164+
class="std-curd-edit-modal"
165+
:mask="false"
166+
:title="edit_text?edit_text:(data.id ? $gettext('Modify') : $gettext('Add'))"
167+
:visible="visible"
168+
:cancel-text="$gettext('Cancel')"
169+
:ok-text="$gettext('OK')"
170+
@cancel="cancel"
171+
@ok="ok"
172+
:width="modalWidth"
173+
destroyOnClose
173174
>
174175
<div class="before-edit" v-if="$slots.beforeEdit">
175176
<slot name="beforeEdit" :data="data"/>
176177
</div>
177178

178179
<std-data-entry
179-
ref="std_data_entry"
180-
:data-list="editableColumns()"
181-
v-model:data-source="data"
182-
:error="error"
180+
ref="std_data_entry"
181+
:data-list="editableColumns()"
182+
v-model:data-source="data"
183+
:error="error"
183184
/>
184185

185186
<slot name="edit" :data="data"/>

frontend/src/components/StdDataDisplay/StdPagination.vue

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ const pageSize = computed({
2424
<template>
2525
<div class="pagination-container" v-if="pagination.total>pagination.per_page">
2626
<a-pagination
27-
:current="pagination.current_page"
28-
v-model:pageSize="pageSize"
29-
:size="size"
30-
:total="pagination.total"
31-
@change="change"
27+
:current="pagination.current_page"
28+
v-model:pageSize="pageSize"
29+
:size="size"
30+
:total="pagination.total"
31+
@change="change"
3232
/>
3333
</div>
3434
</template>

frontend/src/components/StdDataEntry/components/StdPassword.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ function handle_generate() {
3434
<template>
3535
<a-input-group compact>
3636
<a-input-password
37-
v-if="!visibility"
38-
:class="{compact: generate}"
39-
v-model:value="M_value" :placeholoder="placeholder"/>
37+
v-if="!visibility"
38+
:class="{compact: generate}"
39+
v-model:value="M_value" :placeholoder="placeholder"/>
4040
<a-input v-else :class="{compact: generate}" v-model:value="M_value" :placeholoder="placeholder"/>
4141
<a-button @click="handle_generate" v-if="generate" type="primary">
4242
<translate>Generate</translate>
@@ -48,4 +48,4 @@ function handle_generate() {
4848
.compact {
4949
width: calc(100% - 91px)
5050
}
51-
</style>
51+
</style>

frontend/src/components/StdDataEntry/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import StdDataEntry from './StdDataEntry.js'
22
import {h} from 'vue'
3-
import {Input, Textarea, InputPassword, InputNumber} from 'ant-design-vue'
3+
import {Input, InputNumber, Textarea} from 'ant-design-vue'
44
import StdSelector from './components/StdSelector.vue'
55
import StdSelect from './components/StdSelect.vue'
66
import StdPassword from './components/StdPassword.vue'

frontend/src/routes/index.ts

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
import {createRouter, createWebHashHistory, createWebHistory} from 'vue-router'
1+
import {createRouter, createWebHashHistory} from 'vue-router'
22
import gettext from '../gettext'
33
import {useUserStore} from '@/pinia'
44

55
import {
66
CloudOutlined,
77
CodeOutlined,
88
FileOutlined,
9+
FileTextOutlined,
910
HomeOutlined,
1011
InfoCircleOutlined,
11-
UserOutlined,
12-
FileTextOutlined,
12+
SafetyCertificateOutlined,
1313
SettingOutlined,
14-
SafetyCertificateOutlined
14+
UserOutlined
1515
} from '@ant-design/icons-vue'
1616
import NProgress from 'nprogress'
1717
import 'nprogress/nprogress.css'
@@ -87,10 +87,22 @@ export const routes = [
8787
{
8888
path: 'cert',
8989
name: () => $gettext('Certification'),
90-
component: () => import('@/views/cert/Cert.vue'),
90+
component: () => import('@/layouts/BaseRouterView.vue'),
9191
meta: {
9292
icon: SafetyCertificateOutlined
93-
}
93+
},
94+
children: [
95+
{
96+
path: 'list',
97+
name: () => $gettext('Certification List'),
98+
component: () => import('@/views/cert/Cert.vue')
99+
},
100+
{
101+
path: 'dns_credential',
102+
name: () => $gettext('DNS Credentials'),
103+
component: () => import('@/views/cert/DNSCredential.vue')
104+
}
105+
]
94106
},
95107
{
96108
path: 'terminal',

0 commit comments

Comments
 (0)