Skip to content

Commit 6661eb8

Browse files
committed
feat(ui): auto-discovery pool adds refresh button
1 parent c371f1d commit 6661eb8

File tree

1 file changed

+17
-1
lines changed
  • cmdb-ui/src/modules/cmdb/views/discoveryCI

1 file changed

+17
-1
lines changed

cmdb-ui/src/modules/cmdb/views/discoveryCI/index.vue

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<div class="discovery-ci-header">
3737
<a-input-search
3838
:placeholder="$t('cmdb.components.pleaseSearch')"
39-
:style="{ width: '200px', marginRight: '20px' }"
39+
:style="{ width: '200px' }"
4040
@search="handleSearch"
4141
allowClear
4242
/>
@@ -46,6 +46,15 @@
4646
<span @click="batchDelete">{{ $t('delete') }}</span>
4747
<span>{{ $t('cmdb.ci.selectRows', { rows: selectedCount }) }}</span>
4848
</span>
49+
<a-button
50+
type="primary"
51+
class="ops-button-ghost"
52+
ghost
53+
@click="getAdc()"
54+
>
55+
<ops-icon type="veops-refresh" />
56+
{{ $t('refresh') }}
57+
</a-button>
4958
<a-button
5059
type="primary"
5160
ghost
@@ -68,6 +77,7 @@
6877
:height="tableHeight"
6978
:scroll-y="{ enabled: true, gt: 50 }"
7079
:scroll-x="{ enabled: true, gt: 0 }"
80+
:loading="loading"
7181
@checkbox-change="onSelectChange"
7282
@checkbox-all="onSelectChange"
7383
@checkbox-range-end="onSelectChange"
@@ -222,6 +232,7 @@ export default {
222232
logTextArray: [],
223233
acceptByFilters: [],
224234
selectedCount: 0,
235+
loading: false
225236
}
226237
},
227238
computed: {
@@ -289,6 +300,7 @@ export default {
289300
this.$refs.xTable.getVxetableRef().clearSort()
290301
},
291302
getAdc(isInit) {
303+
this.loading = true
292304
getAdc({
293305
type_id: this.currentType,
294306
page_size: 100000,
@@ -320,6 +332,9 @@ export default {
320332
xTable.refreshColumn()
321333
}
322334
})
335+
.finally(() => {
336+
this.loading = false
337+
})
323338
},
324339
getColumns(data, attrList) {
325340
const width = document.getElementById('discovery-ci').clientWidth - 50
@@ -470,6 +485,7 @@ export default {
470485
.discovery-ci-header {
471486
display: flex;
472487
align-items: center;
488+
column-gap: 20px;
473489
padding-top: 18px;
474490
padding-bottom: 10px;
475491
}

0 commit comments

Comments
 (0)