mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-05-01 16:13:04 +00:00
fix: independent widget duration (#319)
This commit is contained in:
parent
63e97edae7
commit
310fff4b28
@ -87,10 +87,12 @@ limitations under the License. -->
|
|||||||
dashboardStore.setLayer(route.params.layer);
|
dashboardStore.setLayer(route.params.layer);
|
||||||
dashboardStore.setEntity(route.params.entity);
|
dashboardStore.setEntity(route.params.entity);
|
||||||
const { auto, autoPeriod } = config.value;
|
const { auto, autoPeriod } = config.value;
|
||||||
|
|
||||||
if (auto) {
|
if (auto) {
|
||||||
await setDuration();
|
await setDuration();
|
||||||
appStoreWithOut.setReloadTimer(setInterval(setDuration, autoPeriod * 1000));
|
appStoreWithOut.setReloadTimer(setInterval(setDuration, autoPeriod * 1000));
|
||||||
|
} else {
|
||||||
|
const duration = JSON.parse(route.params.duration as string);
|
||||||
|
appStoreWithOut.setDuration(duration);
|
||||||
}
|
}
|
||||||
await setSelector();
|
await setSelector();
|
||||||
await queryMetrics();
|
await queryMetrics();
|
||||||
|
@ -20,14 +20,9 @@ limitations under the License. -->
|
|||||||
</div>
|
</div>
|
||||||
<div v-if="hasDuration">
|
<div v-if="hasDuration">
|
||||||
<label>{{ t("duration") }}</label>
|
<label>{{ t("duration") }}</label>
|
||||||
<TimePicker
|
<TimePicker :value="duration" position="right" format="YYYY-MM-DD HH:mm" @input="changeTimeRange" />
|
||||||
:value="[appStore.durationRow.start, appStore.durationRow.end]"
|
|
||||||
position="right"
|
|
||||||
format="YYYY-MM-DD HH:mm"
|
|
||||||
@input="changeTimeRange"
|
|
||||||
/>
|
|
||||||
</div>
|
</div>
|
||||||
<div v-if="!hasDuration">
|
<div v-else>
|
||||||
<label>{{ t("auto") }}</label>
|
<label>{{ t("auto") }}</label>
|
||||||
<el-switch class="mr-5" v-model="auto" style="height: 25px" />
|
<el-switch class="mr-5" v-model="auto" style="height: 25px" />
|
||||||
<Selector v-model="freshOpt" :options="RefreshOptions" size="small" />
|
<Selector v-model="freshOpt" :options="RefreshOptions" size="small" />
|
||||||
@ -72,6 +67,7 @@ limitations under the License. -->
|
|||||||
const auto = ref<boolean>(true);
|
const auto = ref<boolean>(true);
|
||||||
const period = ref<number>(6);
|
const period = ref<number>(6);
|
||||||
const freshOpt = ref<string>(RefreshOptions[0].value);
|
const freshOpt = ref<string>(RefreshOptions[0].value);
|
||||||
|
const duration = ref<string>(JSON.parse(JSON.stringify([appStore.durationRow.start, appStore.durationRow.end])));
|
||||||
|
|
||||||
function changeTimeRange(val: Date[] | any) {
|
function changeTimeRange(val: Date[] | any) {
|
||||||
dates.value = val;
|
dates.value = val;
|
||||||
@ -127,7 +123,10 @@ limitations under the License. -->
|
|||||||
tips: encodeURIComponent(widget.tips || ""),
|
tips: encodeURIComponent(widget.tips || ""),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
if (auto.value) {
|
if (hasDuration.value) {
|
||||||
|
opt.auto = 0;
|
||||||
|
opt.autoPeriod = 0;
|
||||||
|
} else {
|
||||||
const f = RefreshOptions.filter((d: { value: string }) => d.value === freshOpt.value)[0] || {};
|
const f = RefreshOptions.filter((d: { value: string }) => d.value === freshOpt.value)[0] || {};
|
||||||
opt.auto = Number(f.value) * 60 * 1000;
|
opt.auto = Number(f.value) * 60 * 1000;
|
||||||
opt.autoPeriod = period.value;
|
opt.autoPeriod = period.value;
|
||||||
|
@ -64,7 +64,7 @@ export default ({ mode }: ConfigEnv): UserConfig => {
|
|||||||
preprocessorOptions: {
|
preprocessorOptions: {
|
||||||
//define global scss variable
|
//define global scss variable
|
||||||
scss: {
|
scss: {
|
||||||
additionalData: `@import "@/styles/light.scss";`,
|
additionalData: `@use "@/styles/light.scss" as *;`,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user