fix: lint

This commit is contained in:
purocean
2021-07-11 13:51:23 +08:00
parent 5357b0098e
commit c1a910f2dc
3 changed files with 11 additions and 7 deletions
+2 -2
View File
@@ -23,7 +23,7 @@ export function getColorScheme () {
return theme
}
export function setTheme(name: 'system' | 'dark' | 'light') {
export function setTheme (name: 'system' | 'dark' | 'light') {
document.documentElement.setAttribute('app-theme', name)
bus.emit('theme.change', name)
storage.set('app.theme', name)
@@ -39,4 +39,4 @@ window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', ()
if (getThemeName() === 'system') {
setTheme('system')
}
});
})
+1 -1
View File
@@ -28,7 +28,7 @@ const EChartsPlugin = (md: Markdown) => {
let charts: {[key: string]: any} = {}
const update = (theme: string | null = null, animation: boolean | undefined = undefined, renderImg = false) => {
const update = (theme: string | undefined = undefined, animation: boolean | undefined = undefined, renderImg = false) => {
theme ??= getColorScheme()
Object.values(charts).forEach(x => x.chart.dispose())
+8 -4
View File
@@ -46,10 +46,14 @@ if (FLAG_DEMO) {
const method = (init && init.method) || 'GET'
if (uri.startsWith('/api/settings')) {
return Promise.resolve({ status: 'ok', message: '获取成功', data: {
repositories: { test: '/path_test' },
shell: 'bash'
} })
return Promise.resolve({
status: 'ok',
message: '获取成功',
data: {
repositories: { test: '/path_test' },
shell: 'bash'
}
})
}
if (uri.startsWith('/api/mark')) {