fix: update

This commit is contained in:
Fine 2023-06-09 17:02:03 +08:00
parent fe28289bc0
commit e377b95858
5 changed files with 18 additions and 12 deletions

View File

@ -105,6 +105,7 @@ export const ebpfStore = defineStore({
if (!params.taskId) {
return new Promise((resolve) => resolve({}));
}
params.taskId = "808b68c847a4de58c3d068b1d62e0c93428cd3b7a9ae64952b52f3503b663fe9";
const res: AxiosResponse = await graphql.query("getEBPFSchedules").params({ ...params });
if (res.data.errors) {

View File

@ -212,3 +212,6 @@ div.vis-tooltip {
div:has(> a.menu-title) {
display: none;
}
.el-input-number .el-input__inner {
text-align: left !important;
}

View File

@ -139,7 +139,7 @@ limitations under the License. -->
}
function changeThreshold(index: number) {
let regex = /^(100(\.0{1,2})?|[1-9]?\d(\.\d{1,2})?)%$/;
let regex = /^(100(\.0{1,2})?|[1-9]?\d(\.\d{1,2})?)$/;
if (MonitorType[1].value === states.checkItems[index].type) {
regex = /^\d+$/;
}
@ -151,7 +151,7 @@ limitations under the License. -->
}
if (!regex.test(states.checkItems[index].threshold)) {
return ElMessage.warning(getNotice(states.checkItems[index].type));
return ElMessage.error(getNotice(states.checkItems[index].type));
}
emits("edit", states, props.order);
}
@ -190,11 +190,11 @@ limitations under the License. -->
function getNotice(type: string) {
const map: { [key: string]: string } = {
PROCESS_CPU: "It should be percentage data",
PROCESS_THREAD_COUNT: "It should be a positive integer",
SYSTEM_LOAD: "It should be a floating point number",
HTTP_ERROR_RATE: "It should be percentage data",
HTTP_AVG_RESPONSE_TIME: "It should be a response time in milliseconds",
PROCESS_CPU: "It is a percentage data",
PROCESS_THREAD_COUNT: "It is a positive integer",
SYSTEM_LOAD: "It is a floating point number",
HTTP_ERROR_RATE: "It is percentage data",
HTTP_AVG_RESPONSE_TIME: "It is a response time in milliseconds",
};
return map[type];

View File

@ -15,9 +15,6 @@ limitations under the License. -->
<template>
<div class="content" v-if="taskTimelineStore.selectedTask.targetType === TargetTypes[2].value">
<process-topology v-if="networkProfilingStore.nodes.length" :config="config" />
<div class="text" v-else>
{{ t("noData") }}
</div>
</div>
<div
class="content"
@ -30,12 +27,16 @@ limitations under the License. -->
<EBPFStack />
</div>
</div>
<div class="text" v-if="!(ebpfStore.analyzeTrees.length || networkProfilingStore.nodes.length)">
{{ t("noData") }}
</div>
</template>
<script lang="ts" setup>
import type { PropType } from "vue";
import { useI18n } from "vue-i18n";
import { useTaskTimelineStore } from "@/store/modules/task-timeline";
import { useNetworkProfilingStore } from "@/store/modules/network-profiling";
import { useEbpfStore } from "@/store/modules/ebpf";
import { TargetTypes } from "../../continuous-profiling/data";
import ProcessTopology from "@/views/dashboard/related/network-profiling/components/ProcessTopology.vue";
import EBPFSchedules from "@/views/dashboard/related/ebpf/components/EBPFSchedules.vue";
@ -51,6 +52,7 @@ limitations under the License. -->
const { t } = useI18n();
const taskTimelineStore = useTaskTimelineStore();
const networkProfilingStore = useNetworkProfilingStore();
const ebpfStore = useEbpfStore();
</script>
<style lang="scss" scoped>
.content {
@ -65,7 +67,7 @@ limitations under the License. -->
.text {
width: 100%;
text-align: center;
margin-top: 30px;
margin-top: 100px;
}
.item {

View File

@ -150,7 +150,7 @@ limitations under the License. -->
}
}
watch(
() => selectorStore.currentProcess,
() => selectorStore.currentPod,
() => {
init();
},