diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index b52e6bef..cce7d11c 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -25,5 +25,6 @@ limitations under the License. --> .app-main { height: calc(100% - 40px); background: #f7f9fa; + overflow: auto; } diff --git a/src/locales/lang/en.ts b/src/locales/lang/en.ts index ae262ac7..f39229f7 100644 --- a/src/locales/lang/en.ts +++ b/src/locales/lang/en.ts @@ -182,7 +182,7 @@ const msg = { iframeWidgetTip: "Add a link to a widget", iframeSrc: "Iframe Link", generateLink: "Generate Link", - setDuration: "Set Duration", + setDuration: "Lock Query Duration", openFunction: "OpenFunction", seconds: "Seconds", hourTip: "Select Hour", @@ -202,7 +202,7 @@ const msg = { topology: "Topology", trace: "Trace", alarm: "Alerting", - auto: "Auto", + auto: "Auto Fresh", reload: "Reload", version: "Version", copy: "Copy", diff --git a/src/locales/lang/es.ts b/src/locales/lang/es.ts index 16ce8d41..df7e54c7 100644 --- a/src/locales/lang/es.ts +++ b/src/locales/lang/es.ts @@ -165,7 +165,7 @@ const msg = { iframeWidgetTip: "Añadir enlaces a los gadgets", iframeSrc: "Enlace Iframe", generateLink: "Generar enlaces", - setDuration: "Establecer la duración", + setDuration: "Duración de la consulta de bloqueo", openFunction: "OpenFunction", seconds: "Segundos", hourTip: "Seleccione Hora", @@ -200,7 +200,7 @@ const msg = { topology: "Topología", trace: "Traza", alarm: "Recordatorio en curso", - auto: "Auto", + auto: "Auto Fresh", reload: "Recargar", version: "Versión", copy: "Copiar", diff --git a/src/locales/lang/zh.ts b/src/locales/lang/zh.ts index ab93799a..d43cdeb0 100644 --- a/src/locales/lang/zh.ts +++ b/src/locales/lang/zh.ts @@ -179,7 +179,7 @@ const msg = { iframeWidgetTip: "添加widget的链接", iframeSrc: "Iframe链接", generateLink: "生成链接", - setDuration: "设置时间区间", + setDuration: "锁定查询持续时间", openFunction: "OpenFunction", seconds: "秒", hourTip: "选择小时", @@ -199,7 +199,7 @@ const msg = { trace: "追踪", alarm: "告警", event: "事件", - auto: "自动", + auto: "自动更新", reload: "刷新", editmode: "编辑模式", version: "版本", diff --git a/src/views/dashboard/Edit.vue b/src/views/dashboard/Edit.vue index 7b78e9e3..88cf5c8f 100644 --- a/src/views/dashboard/Edit.vue +++ b/src/views/dashboard/Edit.vue @@ -32,6 +32,7 @@ limitations under the License. --> diff --git a/src/views/dashboard/Widget.vue b/src/views/dashboard/Widget.vue index bfdbff21..0858e1fc 100644 --- a/src/views/dashboard/Widget.vue +++ b/src/views/dashboard/Widget.vue @@ -54,6 +54,7 @@ limitations under the License. --> import { useQueryProcessor, useSourceProcessor, useGetMetricEntity } from "@/hooks/useMetricsProcessor"; import graphs from "./graphs"; import { EntityType } from "./data"; + import timeFormat from "@/utils/timeFormat"; export default defineComponent({ name: "WidgetPage", @@ -77,9 +78,20 @@ limitations under the License. --> async function init() { dashboardStore.setLayer(route.params.layer); dashboardStore.setEntity(route.params.entity); + const { auto } = config.value; + + if (auto) { + await setDuration(); + appStoreWithOut.setReloadTimer(setInterval(setDuration, auto)); + } await setSelector(); await queryMetrics(); } + async function setDuration() { + const dates: Date[] = [new Date(new Date().getTime() - config.value.auto), new Date()]; + + appStoreWithOut.setDuration(timeFormat(dates)); + } async function setSelector() { const { serviceId, podId, processId, destServiceId, destPodId, destProcessId, entity } = route.params; if (serviceId) { diff --git a/src/views/dashboard/components/WidgetLink.vue b/src/views/dashboard/components/WidgetLink.vue index 4e5c3437..06ec361e 100644 --- a/src/views/dashboard/components/WidgetLink.vue +++ b/src/views/dashboard/components/WidgetLink.vue @@ -15,18 +15,23 @@ limitations under the License. -->