Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion console/atest-ui/index.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<!DOCTYPE html>
<html lang="en">
<html lang="en" class="">
<head>
<meta charset="UTF-8">
<link rel="icon" href="/favicon.ico">
Expand Down
192 changes: 83 additions & 109 deletions console/atest-ui/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions console/atest-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
"@vueuse/core": "^10.11.0",
"codemirror": "^5.65.17",
"diff-match-patch": "^1.0.5",
"element-plus": "^2.9.6",
"element-plus": "^2.10.2",
"intro.js": "^7.0.1",
"jsonlint-mod": "^1.7.6",
"jsonpath-plus": "^10.0.7",
"jsonpath-plus": "^10.3.0",
"skywalking-client-js": "^0.10.0",
"vue": "^3.3.4",
"vue-codemirror": "^5.1.0",
"vue-i18n": "^9.2.2",
"vue-i18n": "^11.1.2",
"vue-json-viewer": "^3.0.4",
"vue-router": "^4.2.2"
},
Expand Down
2 changes: 2 additions & 0 deletions console/atest-ui/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,8 @@ const toHistoryPanel = ({ ID: selectID, panelName: historyPanelName }) => {
</el-dropdown-menu>
</template>
</el-dropdown>

<el-switch type="primary" data-intro="Switch light and dark modes" v-model="asDarkMode"/>
</el-col>
</div>
<TestingPanel v-if="panelName === 'testing'" @toHistoryPanel="toHistoryPanel"/>
Expand Down
1 change: 1 addition & 0 deletions console/atest-ui/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import en from './locales/en.json'
import zh from './locales/zh.json'
import ClientMonitor from 'skywalking-client-js'
import { name, version } from '../package'
import 'element-plus/theme-chalk/dark/css-vars.css'

const app = createApp(App)

Expand Down
26 changes: 1 addition & 25 deletions console/atest-ui/src/theme.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,3 @@
const lightTheme: { [k: string]: string } = {
'--color-background': 'var(--vt-c-white)',
'--color-background-soft': 'var(--vt-c-white-soft)',
'--color-background-mute': 'var(--vt-c-white-mute)',
'--color-border': 'var(--vt-c-divider-light-2)',
'--color-border-hover': 'var(--vt-c-divider-light-1)',
'--color-heading': 'var(--vt-c-text-light-1)',
'--color-text': 'var(--vt-c-text-light-1)'
}

const darkTheme: { [k: string]: string } = {
'--color-background': 'var(--vt-c-black)',
'--color-background-soft': 'var(--vt-c-black-soft)',
'--color-background-mute': 'var(--vt-c-black-mute)',
'--color-border': 'var(--vt-c-divider-dark-2)',
'--color-border-hover': 'var(--vt-c-divider-dark-1)',
'--color-heading': 'var(--vt-c-text-dark-1)',
'--color-text': 'var(--vt-c-text-dark-2)'
}


export default function setAsDarkTheme(darkMode: boolean) {
const theme = darkMode ? darkTheme : lightTheme
Object.keys(theme).forEach((key) => {
document.documentElement.style.setProperty(key, theme[key])
})
document.documentElement.className = darkMode ? 'dark' : 'light'
}
Loading