feat: add popper theme

This commit is contained in:
Fine 2023-11-09 11:26:04 +08:00
parent 9f4bdf3286
commit b21e9019b8
16 changed files with 35 additions and 58 deletions

View File

@ -87,7 +87,7 @@ limitations under the License. -->
const pathNames = ref<{ path?: string; name: string; selected: boolean }[][]>([]); const pathNames = ref<{ path?: string; name: string; selected: boolean }[][]>([]);
const timeRange = ref<number>(0); const timeRange = ref<number>(0);
const pageTitle = ref<string>(""); const pageTitle = ref<string>("");
const theme = ref<boolean>(false); const theme = ref<boolean>(true);
changeTheme(); changeTheme();
resetDuration(); resetDuration();
@ -106,7 +106,6 @@ limitations under the License. -->
root.classList.remove("dark"); root.classList.remove("dark");
appStore.setTheme("light"); appStore.setTheme("light");
} }
console.log(appStore.theme);
} }
function getName(list: any[]) { function getName(list: any[]) {

View File

@ -28,10 +28,13 @@ html {
--layout-background: #f7f9fa; --layout-background: #f7f9fa;
--box-shadow-color: #ccc; --box-shadow-color: #ccc;
--el-border: 1px solid #000000; --el-border: 1px solid #000000;
--el-bg-color-overlay: #fff;
--el-border-color-light: #e4e7ed;
--popper-hover-bg: #eee;
} }
html.dark { html.dark {
--el-color-primary: #409eff; --el-color-primary: rgb(64, 158, 255);
--theme-background: #212224; --theme-background: #212224;
--font-color: #fafbfc; --font-color: #fafbfc;
--disabled-color: #ccc; --disabled-color: #ccc;
@ -41,8 +44,17 @@ html.dark {
--border-color-primary: #4b4b52; --border-color-primary: #4b4b52;
--layout-background: #000; --layout-background: #000;
--box-shadow-color: #666; --box-shadow-color: #666;
--el-bg-color-overlay: #1d1e1f;
--el-border-color-light: #414243;
--popper-hover-bg: rgb(64, 158, 255, 0.1);
} }
.el-popper.is-light {
background: var(--el-bg-color-overlay);
border: 1px solid var(--el-border-color-light);
}
$popper-hover-bg-color: var(--popper-hover-bg);
$box-shadow-color: var(--box-shadow-color); $box-shadow-color: var(--box-shadow-color);
$border-color-primary: var(--border-color-primary); $border-color-primary: var(--border-color-primary);
$layout-background: var(--layout-background); $layout-background: var(--layout-background);

View File

@ -87,7 +87,7 @@ limitations under the License. -->
&:hover { &:hover {
color: $active-color; color: $active-color;
background-color: #eee; background-color: $popper-hover-bg-color;
} }
} }

View File

@ -82,7 +82,7 @@ limitations under the License. -->
&:hover { &:hover {
color: $active-color; color: $active-color;
background-color: #eee; background-color: $popper-hover-bg-color;
} }
} }
</style> </style>

View File

@ -80,7 +80,7 @@ limitations under the License. -->
&:hover { &:hover {
color: $active-color; color: $active-color;
background-color: #eee; background-color: $popper-hover-bg-color;
} }
} }

View File

@ -93,7 +93,7 @@ limitations under the License. -->
&:hover { &:hover {
color: $active-color; color: $active-color;
background-color: #eee; background-color: $popper-hover-bg-color;
} }
} }

View File

@ -90,7 +90,7 @@ limitations under the License. -->
&:hover { &:hover {
color: $active-color; color: $active-color;
background-color: #eee; background-color: $popper-hover-bg-color;
} }
} }

View File

@ -79,7 +79,7 @@ limitations under the License. -->
&:hover { &:hover {
color: $active-color; color: $active-color;
background-color: #eee; background-color: $popper-hover-bg-color;
} }
} }

View File

@ -80,7 +80,7 @@ limitations under the License. -->
&:hover { &:hover {
color: $active-color; color: $active-color;
background-color: #eee; background-color: $popper-hover-bg-color;
} }
} }

View File

@ -15,7 +15,7 @@ limitations under the License. -->
<template> <template>
<div class="content-wrapper flex-v"> <div class="content-wrapper flex-v">
<div class="title">Task Timeline</div> <div class="title">Task Timeline</div>
<el-popover placement="bottom" trigger="click" :width="100" v-if="dashboardStore.editMode" :effect="appStore.theme"> <el-popover placement="bottom" trigger="click" :width="100" v-if="dashboardStore.editMode">
<template #reference> <template #reference>
<span class="operation cp"> <span class="operation cp">
<Icon iconName="ellipsis_v" size="middle" /> <Icon iconName="ellipsis_v" size="middle" />
@ -32,7 +32,6 @@ limitations under the License. -->
import type { PropType } from "vue"; import type { PropType } from "vue";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { useDashboardStore } from "@/store/modules/dashboard"; import { useDashboardStore } from "@/store/modules/dashboard";
import { useAppStoreWithOut } from "@/store/modules/app";
import Content from "../related/task-timeline/Content.vue"; import Content from "../related/task-timeline/Content.vue";
/*global defineProps */ /*global defineProps */
@ -46,7 +45,6 @@ limitations under the License. -->
}); });
const { t } = useI18n(); const { t } = useI18n();
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
const appStore = useAppStoreWithOut();
function removeWidget() { function removeWidget() {
dashboardStore.removeControls(props.data); dashboardStore.removeControls(props.data);
@ -81,7 +79,7 @@ limitations under the License. -->
&:hover { &:hover {
color: $active-color; color: $active-color;
background-color: #eee; background-color: $popper-hover-bg-color;
} }
} }

View File

@ -15,13 +15,7 @@ limitations under the License. -->
<template> <template>
<div class="text"> <div class="text">
<div class="header"> <div class="header">
<el-popover <el-popover placement="bottom" trigger="click" :width="100" v-if="dashboardStore.editMode">
placement="bottom"
trigger="click"
:width="100"
v-if="dashboardStore.editMode"
:effect="appStore.theme"
>
<template #reference> <template #reference>
<span> <span>
<Icon iconName="ellipsis_v" size="middle" class="operation" /> <Icon iconName="ellipsis_v" size="middle" class="operation" />
@ -61,7 +55,6 @@ limitations under the License. -->
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { useDashboardStore } from "@/store/modules/dashboard"; import { useDashboardStore } from "@/store/modules/dashboard";
import { TextColors } from "@/views/dashboard/data"; import { TextColors } from "@/views/dashboard/data";
import { useAppStoreWithOut } from "@/store/modules/app";
/*global defineProps */ /*global defineProps */
const props = defineProps({ const props = defineProps({
@ -74,7 +67,6 @@ limitations under the License. -->
const { t } = useI18n(); const { t } = useI18n();
const graph = computed(() => props.data.graph || {}); const graph = computed(() => props.data.graph || {});
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
const appStore = useAppStoreWithOut();
function removeTopo() { function removeTopo() {
dashboardStore.removeControls(props.data); dashboardStore.removeControls(props.data);
@ -120,7 +112,7 @@ limitations under the License. -->
&:hover { &:hover {
color: $active-color; color: $active-color;
background-color: #eee; background-color: $popper-hover-bg-color;
} }
} }
</style> </style>

View File

@ -15,13 +15,7 @@ limitations under the License. -->
<template> <template>
<div class="text"> <div class="text">
<div class="header"> <div class="header">
<el-popover <el-popover placement="bottom" trigger="click" :width="100" v-if="dashboardStore.editMode">
placement="bottom"
trigger="click"
:width="100"
v-if="dashboardStore.editMode"
:effect="appStore.theme"
>
<template #reference> <template #reference>
<span> <span>
<Icon iconName="ellipsis_v" size="middle" class="operation" /> <Icon iconName="ellipsis_v" size="middle" class="operation" />
@ -53,7 +47,6 @@ limitations under the License. -->
import type { PropType } from "vue"; import type { PropType } from "vue";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { useDashboardStore } from "@/store/modules/dashboard"; import { useDashboardStore } from "@/store/modules/dashboard";
import { useAppStoreWithOut } from "@/store/modules/app";
/*global defineProps */ /*global defineProps */
const props = defineProps({ const props = defineProps({
@ -65,7 +58,6 @@ limitations under the License. -->
}); });
const { t } = useI18n(); const { t } = useI18n();
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
const appStore = useAppStoreWithOut();
const widget = computed(() => props.data.widget || {}); const widget = computed(() => props.data.widget || {});
function removeTopo() { function removeTopo() {
@ -111,7 +103,7 @@ limitations under the License. -->
&:hover { &:hover {
color: $active-color; color: $active-color;
background-color: #eee; background-color: $popper-hover-bg-color;
} }
} }

View File

@ -15,13 +15,7 @@ limitations under the License. -->
<template> <template>
<div class="time-range"> <div class="time-range">
<div class="header"> <div class="header">
<el-popover <el-popover placement="bottom" trigger="click" :width="100" v-if="dashboardStore.editMode">
placement="bottom"
trigger="click"
:width="100"
v-if="dashboardStore.editMode"
:effect="appStore.theme"
>
<template #reference> <template #reference>
<span> <span>
<Icon iconName="ellipsis_v" size="middle" class="operation" /> <Icon iconName="ellipsis_v" size="middle" class="operation" />
@ -182,7 +176,7 @@ limitations under the License. -->
&:hover { &:hover {
color: $active-color; color: $active-color;
background-color: #eee; background-color: $popper-hover-bg-color;
} }
} }
</style> </style>

View File

@ -15,13 +15,7 @@ limitations under the License. -->
<template> <template>
<div class="topology flex-v"> <div class="topology flex-v">
<div class="operation"> <div class="operation">
<el-popover <el-popover placement="bottom" trigger="click" :width="100" v-if="dashboardStore.editMode">
placement="bottom"
trigger="click"
:width="100"
v-if="dashboardStore.editMode"
:effect="appStore.theme"
>
<template #reference> <template #reference>
<span> <span>
<Icon iconName="ellipsis_v" size="middle" /> <Icon iconName="ellipsis_v" size="middle" />
@ -43,7 +37,6 @@ limitations under the License. -->
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { useDashboardStore } from "@/store/modules/dashboard"; import { useDashboardStore } from "@/store/modules/dashboard";
import Topology from "../related/topology/Index.vue"; import Topology from "../related/topology/Index.vue";
import { useAppStoreWithOut } from "@/store/modules/app";
/*global defineProps */ /*global defineProps */
const props = defineProps({ const props = defineProps({
@ -55,7 +48,6 @@ limitations under the License. -->
}); });
const { t } = useI18n(); const { t } = useI18n();
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
const appStore = useAppStoreWithOut();
function removeTopo() { function removeTopo() {
dashboardStore.removeControls(props.data); dashboardStore.removeControls(props.data);
@ -89,7 +81,7 @@ limitations under the License. -->
&:hover { &:hover {
color: $active-color; color: $active-color;
background-color: #eee; background-color: $popper-hover-bg-color;
} }
} }

View File

@ -14,7 +14,7 @@ See the License for the specific language governing permissions and
limitations under the License. --> limitations under the License. -->
<template> <template>
<div class="trace-wrapper flex-v"> <div class="trace-wrapper flex-v">
<el-popover placement="bottom" trigger="click" :width="100" v-if="dashboardStore.editMode" :effect="appStore.theme"> <el-popover placement="bottom" trigger="click" :width="100" v-if="dashboardStore.editMode">
<template #reference> <template #reference>
<span class="delete cp"> <span class="delete cp">
<Icon iconName="ellipsis_v" size="middle" class="operation" /> <Icon iconName="ellipsis_v" size="middle" class="operation" />
@ -41,7 +41,6 @@ limitations under the License. -->
import TraceDetail from "../related/trace/Detail.vue"; import TraceDetail from "../related/trace/Detail.vue";
import { useI18n } from "vue-i18n"; import { useI18n } from "vue-i18n";
import { useDashboardStore } from "@/store/modules/dashboard"; import { useDashboardStore } from "@/store/modules/dashboard";
import { useAppStoreWithOut } from "@/store/modules/app";
/*global defineProps */ /*global defineProps */
const props = defineProps({ const props = defineProps({
@ -55,7 +54,6 @@ limitations under the License. -->
provide("options", props.data); provide("options", props.data);
const { t } = useI18n(); const { t } = useI18n();
const dashboardStore = useDashboardStore(); const dashboardStore = useDashboardStore();
const appStore = useAppStoreWithOut();
function removeWidget() { function removeWidget() {
dashboardStore.removeControls(props.data); dashboardStore.removeControls(props.data);
} }
@ -91,7 +89,7 @@ limitations under the License. -->
&:hover { &:hover {
color: $active-color; color: $active-color;
background-color: #eee; background-color: $popper-hover-bg-color;
} }
} }

View File

@ -26,7 +26,7 @@ limitations under the License. -->
<Icon iconName="info_outline" size="sm" class="operation" v-show="widget.tips" /> <Icon iconName="info_outline" size="sm" class="operation" v-show="widget.tips" />
</span> </span>
</el-tooltip> </el-tooltip>
<el-popover placement="bottom" trigger="click" :width="100" :effect="appStore.theme"> <el-popover placement="bottom" trigger="click" :width="100">
<template #reference> <template #reference>
<span> <span>
<Icon iconName="ellipsis_v" size="middle" class="operation" /> <Icon iconName="ellipsis_v" size="middle" class="operation" />
@ -294,7 +294,7 @@ limitations under the License. -->
&:hover { &:hover {
color: $active-color; color: $active-color;
background-color: #eee; background-color: $popper-hover-bg-color;
} }
} }