Merge branch 'master-dev' into feature-Beta-dev-renpy

# Conflicts:
#	src/style.less
This commit is contained in:
任珮宇 2024-02-03 11:24:27 +08:00
commit ed052e34e0
3 changed files with 104 additions and 102 deletions

View File

@ -81,7 +81,6 @@ body {
width: calc(100% + 11px) !important;
}
}
&-thead {
> tr {
th {

View File

@ -3,7 +3,8 @@
<a-row type="flex" :gutter="10">
<a-col flex="335px">
<span class="item-label">Database name</span>
<a-select style="width:180px"
<a-select
style="width: 180px"
v-model="value.hostId"
placeholder="select..."
:filter-option="filterOption"
@ -17,7 +18,8 @@
</a-col>
<a-col flex="265px">
<span class="item-label">Time</span>
<a-select style="width:180px"
<a-select
style="width: 180px"
v-model="timer"
placeholder="select..."
show-arrow
@ -39,63 +41,59 @@
<div class="monitor-search-btns">
<a-button class="monitor-search-btns-ant" @click="handleRefresh">
<img class="icon-add" src="@/assets/images/global/reset-pwd.png" alt="" />
<span style="margin-left: 10px;">
Refresh
</span>
<span style="margin-left: 10px"> Refresh </span>
</a-button>
</div>
</div>
</template>
<script>
import moment from 'moment';
import moment from 'moment'
import dateFormat from '@/components/jeecg/JEasyCron/format-date'
import { getAction, postAction, httpAction, deleteAction } from '@/api/manage'
export default {
props: {
value: {
type: Object,
required: true
}
required: true,
},
},
data() {
return {
timer: 1,
DbOptions: [],
timerOptions: [
{label: "1Hours",value: 1},
{label: "2Hours",value: 2},
{label: "3Hours",value: 3},
{label: "user-defined",value: 0},
]
{ label: '1Hours', value: 1 },
{ label: '2Hours', value: 2 },
{ label: '3Hours', value: 3 },
{ label: 'user-defined', value: 0 },
],
}
},
created() {
this.getBeforeHours(1)
},
mounted() {
this.getDbList();
this.getDbList()
},
methods: {
getBeforeHours(num) {
let currentTime = moment()
let oneHourAgo = moment().subtract(num, 'hours');
let oneHourAgo = moment().subtract(num, 'hours')
this.value.start = oneHourAgo.format('YYYY-MM-DD HH:mm:ss')
this.value.end = currentTime.format('YYYY-MM-DD HH:mm:ss')
},
moment,
filterOption(input, option) {
return (
option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
);
return option.componentOptions.children[0].text.toLowerCase().indexOf(input.toLowerCase()) >= 0
},
getDbList() {
getAction("/sysDatabase/sourceList").then(res => {
getAction('/sysDatabase/sourceList').then((res) => {
if (res.success) {
const sourceId = this.$route.query.id
// urlsourceId
if (sourceId) {
const find = res.result.find(item => item.sourceId == sourceId)
const find = res.result.find((item) => item.sourceId == sourceId)
if (find) {
this.value.hostId = find.hostId
}
@ -104,15 +102,16 @@ export default {
this.value.hostId = res.result[0].hostId
}
this.DbOptions = res.result.map(item => {
this.DbOptions = res.result.map((item, index) => {
let str = `my${index}`
return {
label: item.sourceName,
value: item.hostId
value: item.hostId || str,
}
})
this.$emit('change')
} else {
this.$message.warning("This operation fails. Contact your system administrator")
this.$message.warning('This operation fails. Contact your system administrator')
}
})
},
@ -133,7 +132,7 @@ export default {
handleRefresh() {
this.$emit('refresh')
}
},
},
}
</script>

View File

@ -363,7 +363,7 @@ export default {
methods: {
//
async getData() {
// const hide = this.$message.loading('loading...', 0)
if (!this.queryParams.hostId.includes('my')) {
this.spinning = true
try {
const { success, result, message } = await getAction('/systemMonitor/dbDetail', this.queryParams)
@ -392,6 +392,10 @@ export default {
// hide()
this.spinning = false
}
} else {
this.$message.error('No monitoring information')
}
// const hide = this.$message.loading('loading...', 0)
},
//
generateChart() {