update log

This commit is contained in:
Qiuxia Fan 2022-03-24 19:53:36 +08:00
parent ae09693c15
commit 6345c15f00
10 changed files with 23 additions and 20 deletions

View File

@ -96,7 +96,6 @@ export function useECharts(
} }
function setOptions(options: ECOption, clear = true) { function setOptions(options: ECOption, clear = true) {
console.log(options);
cacheOptions.value = options; cacheOptions.value = options;
if (unref(elRef)?.offsetHeight === 0) { if (unref(elRef)?.offsetHeight === 0) {
useTimeoutFn(() => { useTimeoutFn(() => {

View File

@ -122,8 +122,8 @@ const msg = {
viewWarning: "You are entering view mode", viewWarning: "You are entering view mode",
virtualDatabase: "Virtual Database", virtualDatabase: "Virtual Database",
reloadDashboards: "Reload dashboards", reloadDashboards: "Reload dashboards",
kubernetesService: "Kubernetes Service", kubernetesService: "Service",
kubernetesCluster: "Kubernetes Cluster", kubernetesCluster: "Cluster",
kubernetes: "Kubernetes", kubernetes: "Kubernetes",
hourTip: "Select Hour", hourTip: "Select Hour",
minuteTip: "Select Minute", minuteTip: "Select Minute",

View File

@ -122,8 +122,8 @@ const msg = {
viewWarning: "你正在进入预览模式", viewWarning: "你正在进入预览模式",
virtualDatabase: "虚拟数据库", virtualDatabase: "虚拟数据库",
reloadDashboards: "重新加载仪表盘", reloadDashboards: "重新加载仪表盘",
kubernetesService: "Kubernetes服务", kubernetesService: "服务",
kubernetesCluster: "Kubernetes集群", kubernetesCluster: "集群",
kubernetes: "Kubernetes", kubernetes: "Kubernetes",
hourTip: "选择小时", hourTip: "选择小时",
minuteTip: "选择分钟", minuteTip: "选择分钟",

View File

@ -136,7 +136,7 @@ export default defineComponent({
} }
function setStatus(p: boolean) { function setStatus(p: boolean) {
isEdit.value = p; isEdit.value = true;
} }
function cancelConfig() { function cancelConfig() {

View File

@ -111,7 +111,7 @@ const props = defineProps({
intervalTime: { type: Array as PropType<string[]>, default: () => [] }, intervalTime: { type: Array as PropType<string[]>, default: () => [] },
isEdit: { type: Boolean, default: false }, isEdit: { type: Boolean, default: false },
}); });
const emit = defineEmits(["changeOpt"]); // const emit = defineEmits(["changeOpt"]);
const selectorStore = useSelectorStore(); const selectorStore = useSelectorStore();
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
const chartLoading = ref<boolean>(false); const chartLoading = ref<boolean>(false);
@ -187,8 +187,10 @@ async function searchList() {
watch( watch(
() => [props.config.metricTypes, props.config.metrics], () => [props.config.metricTypes, props.config.metrics],
async () => { async () => {
await queryEndpointMetrics(endpoints.value); if (props.isEdit) {
emit("changeOpt", false); queryEndpointMetrics(endpoints.value);
}
// emit("changeOpt", false);
} }
); );
watch( watch(

View File

@ -128,6 +128,7 @@ const props = defineProps({
}, },
intervalTime: { type: Array as PropType<string[]>, default: () => [] }, intervalTime: { type: Array as PropType<string[]>, default: () => [] },
needQuery: { type: Boolean, default: false }, needQuery: { type: Boolean, default: false },
isEdit: { type: Boolean, default: false },
}); });
const selectorStore = useSelectorStore(); const selectorStore = useSelectorStore();
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
@ -151,14 +152,11 @@ async function queryInstance() {
} }
searchInstances.value = selectorStore.pods; searchInstances.value = selectorStore.pods;
instances.value = searchInstances.value.splice(0, pageSize); instances.value = searchInstances.value.splice(0, pageSize);
if (!instances.value.length || props.config.isEdit) {
return;
}
queryInstanceMetrics(instances.value); queryInstanceMetrics(instances.value);
} }
async function queryInstanceMetrics(currentInstances: Instance[]) { async function queryInstanceMetrics(currentInstances: Instance[]) {
if (!instances.value.length) { if (!currentInstances.length) {
return; return;
} }
const { metrics } = props.config; const { metrics } = props.config;

View File

@ -122,6 +122,7 @@ const props = defineProps({
default: () => ({ dashboardName: "", fontSize: 12 }), default: () => ({ dashboardName: "", fontSize: 12 }),
}, },
intervalTime: { type: Array as PropType<string[]>, default: () => [] }, intervalTime: { type: Array as PropType<string[]>, default: () => [] },
isEdit: { type: Boolean, default: false },
}); });
const selectorStore = useSelectorStore(); const selectorStore = useSelectorStore();
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
@ -143,9 +144,6 @@ async function queryServices() {
ElMessage.error(resp.errors); ElMessage.error(resp.errors);
} }
setServices(selectorStore.services); setServices(selectorStore.services);
if (!services.value.length || props.config.isEdit) {
return;
}
queryServiceMetrics(services.value); queryServiceMetrics(services.value);
} }
@ -182,7 +180,6 @@ function setServices(arr: (Service & { merge: boolean })[]) {
services.value = sortServices.value.filter( services.value = sortServices.value.filter(
(d: Service, index: number) => index < pageSize (d: Service, index: number) => index < pageSize
); );
console.log(services.value);
} }
function clickService(scope: any) { function clickService(scope: any) {
@ -200,6 +197,9 @@ function clickService(scope: any) {
router.push(path); router.push(path);
} }
async function queryServiceMetrics(currentServices: Service[]) { async function queryServiceMetrics(currentServices: Service[]) {
if (!currentServices.length) {
return;
}
const { metrics } = props.config; const { metrics } = props.config;
if (metrics.length && metrics[0]) { if (metrics.length && metrics[0]) {
@ -253,9 +253,6 @@ function searchList() {
watch( watch(
() => [props.config.metricTypes, props.config.metrics], () => [props.config.metricTypes, props.config.metrics],
() => { () => {
if (!services.value.length) {
return;
}
queryServiceMetrics(services.value); queryServiceMetrics(services.value);
} }
); );

View File

@ -114,6 +114,7 @@ function setCurrentLog(log: any) {
} }
.serviceInstanceName, .serviceInstanceName,
.endpointName,
.serviceName { .serviceName {
width: 200px; width: 200px;
} }

View File

@ -82,6 +82,7 @@ function showSelectSpan() {
} }
.serviceInstanceName, .serviceInstanceName,
.endpointName,
.serviceName { .serviceName {
width: 200px; width: 200px;
} }
@ -98,6 +99,7 @@ function showSelectSpan() {
border: 1px solid transparent; border: 1px solid transparent;
border-right: 1px dotted silver; border-right: 1px dotted silver;
overflow: hidden; overflow: hidden;
height: 30px;
line-height: 30px; line-height: 30px;
text-overflow: ellipsis; text-overflow: ellipsis;
white-space: nowrap; white-space: nowrap;

View File

@ -24,6 +24,10 @@ export const ServiceLogConstants = [
label: "serviceInstanceName", label: "serviceInstanceName",
value: "instance", value: "instance",
}, },
{
label: "endpointName",
value: "endpoint",
},
{ {
label: "timestamp", label: "timestamp",
value: "time", value: "time",