fix Style
parent
f78b38226c
commit
5751cea1c4
|
@ -43,7 +43,7 @@ class PowerMonitor {
|
||||||
if (event === 'shutdown' && process.platform === 'win32') {
|
if (event === 'shutdown' && process.platform === 'win32') {
|
||||||
if (!this._shutdownCallback) {
|
if (!this._shutdownCallback) {
|
||||||
this._shutdownCallback = async () => {
|
this._shutdownCallback = async () => {
|
||||||
await Promise.all(this._listeners.map((fn) => fn()))
|
await Promise.all(this._listeners.map(fn => fn()))
|
||||||
releaseShutdownBlock()
|
releaseShutdownBlock()
|
||||||
}
|
}
|
||||||
insertWndProcHook(this._shutdownCallback)
|
insertWndProcHook(this._shutdownCallback)
|
||||||
|
@ -57,7 +57,7 @@ class PowerMonitor {
|
||||||
|
|
||||||
off (event, listener) {
|
off (event, listener) {
|
||||||
if (event === 'shutdown' && process.platform === 'win32') {
|
if (event === 'shutdown' && process.platform === 'win32') {
|
||||||
this._listeners = this._listeners.filter((fn) => fn !== listener)
|
this._listeners = this._listeners.filter(fn => fn !== listener)
|
||||||
} else {
|
} else {
|
||||||
return _powerMonitor.off(event, listener)
|
return _powerMonitor.off(event, listener)
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,14 +1,60 @@
|
||||||
|
<script>
|
||||||
|
import createMenus from '@/view/router/menu'
|
||||||
|
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'App',
|
||||||
|
components: {
|
||||||
|
},
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
locale: zhCN,
|
||||||
|
info: {},
|
||||||
|
menus: undefined,
|
||||||
|
config: undefined
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
themeClass () {
|
||||||
|
return `theme-${this.config.app.theme}`
|
||||||
|
},
|
||||||
|
theme () {
|
||||||
|
return this.config.app.theme
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created () {
|
||||||
|
this.menus = createMenus(this)
|
||||||
|
this.config = this.$global.config
|
||||||
|
this.$api.info.get().then((ret) => {
|
||||||
|
this.info = ret
|
||||||
|
})
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleClick (e) {
|
||||||
|
console.log('click', e)
|
||||||
|
},
|
||||||
|
titleClick (e) {
|
||||||
|
console.log('titleClick', e)
|
||||||
|
},
|
||||||
|
menuClick (item) {
|
||||||
|
console.log('menu click', item)
|
||||||
|
this.$router.replace(item.path)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<a-config-provider :locale="locale">
|
<a-config-provider :locale="locale">
|
||||||
<div class="ds_layout" :class="themeClass">
|
<div class="ds_layout" :class="themeClass">
|
||||||
<a-layout>
|
<a-layout>
|
||||||
<a-layout-sider :theme="theme">
|
<a-layout-sider :theme="theme">
|
||||||
<div class="logo"></div>
|
<div class="logo" />
|
||||||
<div class="aside">
|
<div class="aside">
|
||||||
<a-menu
|
<a-menu
|
||||||
mode="inline"
|
mode="inline"
|
||||||
:defaultSelectedKeys="[$route.fullPath]"
|
:default-selected-keys="[$route.fullPath]"
|
||||||
:defaultOpenKeys="['/plugin']"
|
:default-open-keys="['/plugin']"
|
||||||
>
|
>
|
||||||
<template v-for="(item) of menus">
|
<template v-for="(item) of menus">
|
||||||
<a-sub-menu v-if="item.children && item.children.length > 0" :key="item.path" @titleClick="titleClick(item)">
|
<a-sub-menu v-if="item.children && item.children.length > 0" :key="item.path" @titleClick="titleClick(item)">
|
||||||
|
@ -28,7 +74,7 @@
|
||||||
<a-layout>
|
<a-layout>
|
||||||
<!-- <a-layout-header>Header</a-layout-header> -->
|
<!-- <a-layout-header>Header</a-layout-header> -->
|
||||||
<a-layout-content>
|
<a-layout-content>
|
||||||
<router-view></router-view>
|
<router-view />
|
||||||
</a-layout-content>
|
</a-layout-content>
|
||||||
<a-layout-footer>
|
<a-layout-footer>
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
|
@ -41,51 +87,6 @@
|
||||||
</a-config-provider>
|
</a-config-provider>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
|
||||||
import createMenus from '@/view/router/menu'
|
|
||||||
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
|
|
||||||
export default {
|
|
||||||
name: 'App',
|
|
||||||
components: {
|
|
||||||
},
|
|
||||||
data () {
|
|
||||||
return {
|
|
||||||
locale: zhCN,
|
|
||||||
info: {},
|
|
||||||
menus: undefined,
|
|
||||||
config: undefined
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
|
||||||
themeClass () {
|
|
||||||
return 'theme-' + this.config.app.theme
|
|
||||||
},
|
|
||||||
theme () {
|
|
||||||
return this.config.app.theme
|
|
||||||
}
|
|
||||||
},
|
|
||||||
created () {
|
|
||||||
this.menus = createMenus(this)
|
|
||||||
this.config = this.$global.config
|
|
||||||
this.$api.info.get().then(ret => {
|
|
||||||
this.info = ret
|
|
||||||
})
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
handleClick (e) {
|
|
||||||
console.log('click', e)
|
|
||||||
},
|
|
||||||
titleClick (e) {
|
|
||||||
console.log('titleClick', e)
|
|
||||||
},
|
|
||||||
menuClick (item) {
|
|
||||||
console.log('menu click', item)
|
|
||||||
this.$router.replace(item.path)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<style lang="scss">
|
<style lang="scss">
|
||||||
body{
|
body{
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
import lodash from 'lodash'
|
|
||||||
import { ipcRenderer, shell } from 'electron'
|
import { ipcRenderer, shell } from 'electron'
|
||||||
|
import lodash from 'lodash'
|
||||||
|
|
||||||
let inited = false
|
let inited = false
|
||||||
let apiObj = null
|
let apiObj = null
|
||||||
export function apiInit (app) {
|
export function apiInit (app) {
|
||||||
const invoke = (api, args) => {
|
const invoke = (api, args) => {
|
||||||
return ipcRenderer.invoke('apiInvoke', [api, args]).catch(e => {
|
return ipcRenderer.invoke('apiInvoke', [api, args]).catch((e) => {
|
||||||
app.$notification.error({
|
app.$notification.error({
|
||||||
message: 'Api invoke error',
|
message: 'Api invoke error',
|
||||||
description: e.message
|
description: e.message
|
||||||
|
@ -42,7 +43,7 @@ export function apiInit (app) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!inited) {
|
if (!inited) {
|
||||||
return invoke('getApiList').then(list => {
|
return invoke('getApiList').then((list) => {
|
||||||
inited = true
|
inited = true
|
||||||
for (const item of list) {
|
for (const item of list) {
|
||||||
bindApi(item)
|
bindApi(item)
|
||||||
|
@ -52,7 +53,7 @@ export function apiInit (app) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Promise(resolve => {
|
return new Promise((resolve) => {
|
||||||
resolve(apiObj)
|
resolve(apiObj)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
import { apiInit, useApi } from './api'
|
|
||||||
import modules from '../bridge/front'
|
import modules from '../bridge/front'
|
||||||
|
import { apiInit, useApi } from './api'
|
||||||
import status from './status'
|
import status from './status'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
initApi: apiInit,
|
initApi: apiInit,
|
||||||
async initPre (Vue, api) {
|
async initPre (Vue, api) {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
import lodash from 'lodash'
|
import lodash from 'lodash'
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
|
|
||||||
const status = {
|
const status = {
|
||||||
server: {
|
server: {
|
||||||
enabled: false
|
enabled: false
|
||||||
|
|
Loading…
Reference in New Issue