Skip to content

Commit b89d962

Browse files
committed
feat: edit-site collapsible locations #65, #30
1 parent f8488a1 commit b89d962

File tree

3 files changed

+48
-34
lines changed

3 files changed

+48
-34
lines changed

frontend/components.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ declare module '@vue/runtime-core' {
1313
AButton: typeof import('ant-design-vue/es')['Button']
1414
ACard: typeof import('ant-design-vue/es')['Card']
1515
ACol: typeof import('ant-design-vue/es')['Col']
16+
ACollapse: typeof import('ant-design-vue/es')['Collapse']
17+
ACollapsePanel: typeof import('ant-design-vue/es')['CollapsePanel']
1618
AConfigProvider: typeof import('ant-design-vue/es')['ConfigProvider']
1719
ADivider: typeof import('ant-design-vue/es')['Divider']
1820
ADrawer: typeof import('ant-design-vue/es')['Drawer']

frontend/src/views/dashboard/DashBoard.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ onMounted(() => {
6161
disk_io_analytic[0].data = disk_io_analytic[0].data.concat(r.disk_io.writes)
6262
disk_io_analytic[1].data = disk_io_analytic[1].data.concat(r.disk_io.reads)
6363
64-
websocket = ws('api/analytic')
64+
websocket = ws('/api/analytic')
6565
websocket.onmessage = wsOnMessage
6666
6767
})

frontend/src/views/domain/ngx_conf/LocationEditor.vue

Lines changed: 45 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -40,43 +40,48 @@ function remove(index: number) {
4040
<h2 v-translate>Locations</h2>
4141
<a-empty v-if="!locations"/>
4242
<draggable
43+
v-else
4344
:list="locations"
4445
item-key="name"
4546
class="list-group"
4647
ghost-class="ghost"
47-
handle=".ant-card-head"
48+
handle=".ant-collapse-header"
4849
>
4950
<template #item="{ element: v, index }">
50-
<a-card :key="index" size="small">
51-
<template #title>
52-
<HolderOutlined/>
53-
{{ $gettext('Location') }}
54-
</template>
55-
<template #extra v-if="!readonly">
56-
<a-popconfirm @confirm="remove(index)"
57-
:title="$gettext('Are you sure you want to remove this location?')"
58-
:ok-text="$gettext('Yes')"
59-
:cancel-text="$gettext('No')">
60-
<a-button type="text">
61-
<template #icon>
62-
<DeleteOutlined style="font-size: 14px;"/>
63-
</template>
64-
</a-button>
65-
</a-popconfirm>
66-
</template>
67-
68-
<a-form layout="vertical">
69-
<a-form-item :label="$gettext('Comments')">
70-
<a-textarea v-model:value="v.comments" :bordered="false"/>
71-
</a-form-item>
72-
<a-form-item :label="$gettext('Path')">
73-
<a-input addon-before="location" v-model:value="v.path"/>
74-
</a-form-item>
75-
<a-form-item :label="$gettext('Content')">
76-
<code-editor v-model:content="v.content" default-height="200px" style="width: 100%;"/>
77-
</a-form-item>
78-
</a-form>
79-
</a-card>
51+
<a-collapse :bordered="false">
52+
<a-collapse-panel>
53+
<template #header>
54+
<div>
55+
<HolderOutlined/>
56+
{{ $gettext('Location') }}
57+
{{ v.path }}
58+
</div>
59+
</template>
60+
<template #extra v-if="!readonly">
61+
<a-popconfirm @confirm="remove(index)"
62+
:title="$gettext('Are you sure you want to remove this location?')"
63+
:ok-text="$gettext('Yes')"
64+
:cancel-text="$gettext('No')">
65+
<a-button type="text" size="small">
66+
<template #icon>
67+
<DeleteOutlined style="font-size: 14px;"/>
68+
</template>
69+
</a-button>
70+
</a-popconfirm>
71+
</template>
72+
<a-form layout="vertical">
73+
<a-form-item :label="$gettext('Comments')">
74+
<a-textarea v-model:value="v.comments" :bordered="false"/>
75+
</a-form-item>
76+
<a-form-item :label="$gettext('Path')">
77+
<a-input addon-before="location" v-model:value="v.path"/>
78+
</a-form-item>
79+
<a-form-item :label="$gettext('Content')">
80+
<code-editor v-model:content="v.content" default-height="200px" style="width: 100%;"/>
81+
</a-form-item>
82+
</a-form>
83+
</a-collapse-panel>
84+
</a-collapse>
8085
</template>
8186
</draggable>
8287

@@ -100,8 +105,15 @@ function remove(index: number) {
100105
</template>
101106

102107
<style lang="less" scoped>
103-
.ant-card {
108+
.ant-collapse {
104109
margin: 10px 0;
105-
box-shadow: unset;
110+
}
111+
112+
.ant-collapse-item {
113+
border: 0 !important;
114+
}
115+
116+
.ant-collapse-header {
117+
align-items: center;
106118
}
107119
</style>

0 commit comments

Comments
 (0)