optimize widgets

This commit is contained in:
Qiuxia Fan 2022-06-15 16:59:11 +08:00
parent 7813c92673
commit 30efdbc09e
8 changed files with 39 additions and 10 deletions

View File

@ -29,7 +29,7 @@ limitations under the License. -->
<span>{{ t("delete") }}</span>
</div>
</el-popover>
<Header />
<Header :needQuery="needQuery" />
<Content />
</div>
</template>
@ -47,6 +47,7 @@ const props = defineProps({
default: () => ({ graph: {} }),
},
activeIndex: { type: String, default: "" },
needQuery: { type: Boolean, default: true },
});
const { t } = useI18n();
const dashboardStore = useDashboardStore();

View File

@ -30,7 +30,7 @@ limitations under the License. -->
</div>
</el-popover>
<div class="header">
<Header />
<Header :needQuery="needQuery" />
</div>
<div class="log">
<List />
@ -50,6 +50,7 @@ const props = defineProps({
default: () => ({}),
},
activeIndex: { type: String, default: "" },
needQuery: { type: Boolean, default: true },
});
const { t } = useI18n();
const dashboardStore = useDashboardStore();

View File

@ -29,7 +29,7 @@ limitations under the License. -->
<span>{{ t("delete") }}</span>
</div>
</el-popover>
<Header />
<Header :needQuery="needQuery" />
<Content />
</div>
</template>
@ -47,6 +47,7 @@ const props = defineProps({
default: () => ({ graph: {} }),
},
activeIndex: { type: String, default: "" },
needQuery: { type: Boolean, default: true },
});
const { t } = useI18n();
const dashboardStore = useDashboardStore();

View File

@ -30,7 +30,7 @@ limitations under the License. -->
</div>
</el-popover>
<div class="header">
<Filter />
<Filter :needQuery="needQuery" />
</div>
<div class="trace flex-h">
<TraceList />
@ -53,6 +53,7 @@ const props = defineProps({
default: () => ({ graph: {} }),
},
activeIndex: { type: String, default: "" },
needQuery: { type: Boolean, default: true },
});
const { t } = useI18n();
const dashboardStore = useDashboardStore();

View File

@ -39,6 +39,10 @@ import { useDashboardStore } from "@/store/modules/dashboard";
import { useAppStoreWithOut } from "@/store/modules/app";
import { EntityType } from "../../data";
/*global defineProps */
const props = defineProps({
needQuery: { type: Boolean, default: true },
});
const ebpfStore = useEbpfStore();
const appStore = useAppStoreWithOut();
const selectorStore = useSelectorStore();
@ -46,7 +50,9 @@ const dashboardStore = useDashboardStore();
const { t } = useI18n();
const newTask = ref<boolean>(false);
searchTasks();
if (props.needQuery) {
searchTasks();
}
async function searchTasks() {
const serviceId =

View File

@ -142,6 +142,10 @@ import { ElMessage } from "element-plus";
import { EntityType } from "../../data";
import { ErrorCategory } from "./data";
/*global defineProps */
const props = defineProps({
needQuery: { type: Boolean, default: true },
});
const { t } = useI18n();
const appStore = useAppStoreWithOut();
const selectorStore = useSelectorStore();
@ -161,8 +165,9 @@ const state = reactive<any>({
service: { value: "", label: "" },
category: { value: "ALL", label: "All" },
});
init();
if (props.needQuery) {
init();
}
async function init() {
const resp = await logStore.getLogsByKeywords();

View File

@ -59,6 +59,10 @@ import { useDashboardStore } from "@/store/modules/dashboard";
import { useAppStoreWithOut } from "@/store/modules/app";
import { EntityType } from "../../data";
/*global defineProps */
const props = defineProps({
needQuery: { type: Boolean, default: true },
});
const profileStore = useProfileStore();
const appStore = useAppStoreWithOut();
const selectorStore = useSelectorStore();
@ -67,8 +71,10 @@ const { t } = useI18n();
const endpointName = ref<string>("");
const newTask = ref<boolean>(false);
searchTasks();
searchEndpoints("");
if (props.needQuery) {
searchTasks();
searchEndpoints("");
}
async function searchEndpoints(keyword: string) {
if (!selectorStore.currentService) {
@ -109,6 +115,7 @@ watch(
() => selectorStore.currentService,
() => {
searchTasks();
console.log("service");
}
);
watch(

View File

@ -104,6 +104,10 @@ import ConditionTags from "@/views/components/ConditionTags.vue";
import { ElMessage } from "element-plus";
import { EntityType } from "../../data";
/*global defineProps */
const props = defineProps({
needQuery: { type: Boolean, default: true },
});
const { t } = useI18n();
const appStore = useAppStoreWithOut();
const selectorStore = useSelectorStore();
@ -121,7 +125,10 @@ const state = reactive<any>({
service: { value: "", label: "" },
});
init();
if (props.needQuery) {
init();
}
async function init() {
if (dashboardStore.entity === EntityType[1].value) {
await getServices();