mirror of
https://github.com/apache/skywalking-booster-ui.git
synced 2025-06-29 13:27:35 +00:00
add switch
This commit is contained in:
parent
060b009ed9
commit
1aad1ef141
@ -48,6 +48,15 @@ limitations under the License. -->
|
|||||||
@input="changeTimeRange"
|
@input="changeTimeRange"
|
||||||
/>
|
/>
|
||||||
<span> UTC{{ appStore.utcHour >= 0 ? "+" : "" }}{{ `${appStore.utcHour}:${appStore.utcMin}` }} </span>
|
<span> UTC{{ appStore.utcHour >= 0 ? "+" : "" }}{{ `${appStore.utcHour}:${appStore.utcMin}` }} </span>
|
||||||
|
<span class="ml-5">
|
||||||
|
<el-switch
|
||||||
|
v-model="dataMode"
|
||||||
|
inline-prompt
|
||||||
|
active-text="Set data to cold"
|
||||||
|
inactive-text="Set data to warm"
|
||||||
|
@change="changeDataMode"
|
||||||
|
/>
|
||||||
|
</span>
|
||||||
<span class="ml-5" ref="themeSwitchRef">
|
<span class="ml-5" ref="themeSwitchRef">
|
||||||
<el-switch
|
<el-switch
|
||||||
v-model="theme"
|
v-model="theme"
|
||||||
@ -96,6 +105,7 @@ limitations under the License. -->
|
|||||||
const pageTitle = ref<string>("");
|
const pageTitle = ref<string>("");
|
||||||
const theme = ref<boolean>(true);
|
const theme = ref<boolean>(true);
|
||||||
const themeSwitchRef = ref<HTMLElement>();
|
const themeSwitchRef = ref<HTMLElement>();
|
||||||
|
const dataMode = ref<boolean>(false);
|
||||||
|
|
||||||
const savedTheme = window.localStorage.getItem("theme-is-dark");
|
const savedTheme = window.localStorage.getItem("theme-is-dark");
|
||||||
if (savedTheme === "false") {
|
if (savedTheme === "false") {
|
||||||
@ -126,6 +136,14 @@ limitations under the License. -->
|
|||||||
window.localStorage.setItem("theme-is-dark", String(theme.value));
|
window.localStorage.setItem("theme-is-dark", String(theme.value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function changeDataMode() {
|
||||||
|
if (dataMode.value) {
|
||||||
|
// const gap = appStore.duration.end.getTime() - appStore.duration.start.getTime();
|
||||||
|
// const dates: Date[] = [new Date(new Date().getTime() - gap), new Date()];
|
||||||
|
// appStore.setDuration(timeFormat(dates));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function handleChangeTheme() {
|
function handleChangeTheme() {
|
||||||
const x = themeSwitchRef.value?.offsetLeft ?? 0;
|
const x = themeSwitchRef.value?.offsetLeft ?? 0;
|
||||||
const y = themeSwitchRef.value?.offsetTop ?? 0;
|
const y = themeSwitchRef.value?.offsetTop ?? 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user