search alarms

This commit is contained in:
Qiuxia Fan 2022-03-09 11:41:12 +08:00
parent bd6e3c9ba9
commit d3ba3a4dbf
4 changed files with 35 additions and 21 deletions

View File

@ -187,7 +187,7 @@ const msg = {
list: "List", list: "List",
tree: "Tree", tree: "Tree",
filterScope: "Filter Scope", filterScope: "Filter Scope",
searchKeyword: "Search Keyword", searchKeyword: "Keyword",
quarterHourCutTip: "Last 15 mins", quarterHourCutTip: "Last 15 mins",
halfHourCutTip: "Last 30 mins", halfHourCutTip: "Last 30 mins",
hourCutTip: "Last 1 hour", hourCutTip: "Last 1 hour",

View File

@ -189,7 +189,7 @@ const msg = {
list: "列表", list: "列表",
tree: "树结构", tree: "树结构",
filterScope: "过滤范围", filterScope: "过滤范围",
searchKeyword: "关键字搜索", searchKeyword: "关键字",
quarterHourCutTip: "最近15分钟", quarterHourCutTip: "最近15分钟",
halfHourCutTip: "最近30分钟", halfHourCutTip: "最近30分钟",
hourCutTip: "最近1小时", hourCutTip: "最近1小时",

View File

@ -18,12 +18,11 @@ limitations under the License. -->
v-for="(i, index) in alarmStore.alarms" v-for="(i, index) in alarmStore.alarms"
:key="index" :key="index"
class="clear timeline-item" class="clear timeline-item"
@click="showDetails(i)"
> >
<div class="g-sm-3 grey sm hide-xs time-line tr"> <div class="g-sm-3 grey sm hide-xs time-line tr">
{{ dateFormat(parseInt(i.startTime)) }} {{ dateFormat(parseInt(i.startTime)) }}
</div> </div>
<div class="timeline-table-i g-sm-9"> <div class="timeline-table-i g-sm-9" @click="showDetails(i)">
<div class="message mb-5 b"> <div class="message mb-5 b">
{{ i.message }} {{ i.message }}
</div> </div>
@ -42,6 +41,7 @@ limitations under the License. -->
</div> </div>
</div> </div>
</div> </div>
<div v-if="!alarmStore.alarms.length" class="tips">{{ t("noData") }}</div>
</div> </div>
<el-dialog <el-dialog
v-model="isShowDetails" v-model="isShowDetails"
@ -126,15 +126,15 @@ limitations under the License. -->
</span> </span>
<span v-else-if="eventKey.class === 'source'" class="source"> <span v-else-if="eventKey.class === 'source'" class="source">
<span <span
>{{ t("currentService") }}: >{{ t("service") }}:
{{ currentEvent[eventKey.class].service }}</span {{ currentEvent[eventKey.class].service }}</span
> >
<div v-show="currentEvent[eventKey.class].endpoint"> <div v-show="currentEvent[eventKey.class].endpoint">
{{ t("currentEndpoint") }}: {{ t("endpoint") }}:
{{ currentEvent[eventKey.class].endpoint }} {{ currentEvent[eventKey.class].endpoint }}
</div> </div>
<div v-show="currentEvent[eventKey.class].serviceInstance"> <div v-show="currentEvent[eventKey.class].serviceInstance">
{{ t("currentInstance") }}: {{ t("instance") }}:
{{ currentEvent[eventKey.class].serviceInstance }} {{ currentEvent[eventKey.class].serviceInstance }}
</div> </div>
</span> </span>
@ -180,4 +180,11 @@ function viewEventDetail(event: Event) {
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
@import "./index.scss"; @import "./index.scss";
.tips {
width: 100%;
margin: 20px 0;
text-align: center;
font-size: 14px;
}
</style> </style>

View File

@ -22,7 +22,7 @@ limitations under the License. -->
:options="AlarmOptions" :options="AlarmOptions"
placeholder="Select a layer" placeholder="Select a layer"
@change="changeEntity" @change="changeEntity"
class="selectors" class="alarm-tool-input"
size="small" size="small"
/> />
</div> </div>
@ -34,10 +34,11 @@ limitations under the License. -->
@change="refreshAlarms({ pageNum: 1 })" @change="refreshAlarms({ pageNum: 1 })"
/> />
</div> </div>
<div class="pagination">
<el-pagination <el-pagination
v-model:currentPage="pageNum" v-model:currentPage="pageNum"
v-model:page-size="pageSize" v-model:page-size="pageSize"
layout="prev, pager, next, jumper" layout="prev, jumper, total, next"
:total="alarmStore.total" :total="alarmStore.total"
@current-change="changePage" @current-change="changePage"
:pager-count="5" :pager-count="5"
@ -45,6 +46,7 @@ limitations under the License. -->
:style="`--el-pagination-bg-color: #f0f2f5; --el-pagination-button-disabled-bg-color: #f0f2f5;`" :style="`--el-pagination-bg-color: #f0f2f5; --el-pagination-button-disabled-bg-color: #f0f2f5;`"
/> />
</div> </div>
</div>
<ConditionTags <ConditionTags
:type="'ALARM'" :type="'ALARM'"
@update="(data) => refreshAlarms({ pageNum: 1, tagsMap: data.tagsMap })" @update="(data) => refreshAlarms({ pageNum: 1, tagsMap: data.tagsMap })"
@ -91,6 +93,7 @@ async function refreshAlarms(param: { pageNum: number; tagsMap?: any }) {
function changeEntity(param: any) { function changeEntity(param: any) {
entity.value = param[0].value; entity.value = param[0].value;
refreshAlarms({ pageNum: 1 });
} }
function changePage(p: number) { function changePage(p: number) {
@ -104,9 +107,7 @@ function changePage(p: number) {
border-bottom: 1px solid #c1c5ca41; border-bottom: 1px solid #c1c5ca41;
background-color: #f0f2f5; background-color: #f0f2f5;
padding: 10px; padding: 10px;
// color: #efefef; position: relative;
flex-shrink: 0;
justify-content: space-between;
} }
.alarm-tool-input { .alarm-tool-input {
@ -116,4 +117,10 @@ function changePage(p: number) {
width: 250px; width: 250px;
border-radius: 3px; border-radius: 3px;
} }
.pagination {
position: absolute;
top: 10px;
right: 5px;
}
</style> </style>