Compare commits
2 Commits
master
...
fix-launch
Author | SHA1 | Message | Date |
---|---|---|---|
|
399fa01f97 |
add:打包时添加gpu相关参数
|
3 years ago |
|
20fbfaf1dd |
first commit
|
3 years ago |
-
2.gitignore
-
BINapp/main/assets/big.png
-
BINapp/main/assets/close-new.png
-
BINapp/main/assets/mainphoto.png
-
BINapp/main/assets/small.png
-
BINapp/main/assets/test1.pdf
-
3app/main/constant.js
-
152app/main/index.html
-
9app/main/windows/application.js
-
24app/main/windows/lib/common.js
-
2app/main/windows/lib/data.json
-
18app/main/windows/lib/preload.js
-
16app/main/windows/lib/store.js
-
77app/main/windows/main.js
-
4app/main/windows/screen.json
-
2app/main/windows/suspension.js
-
3app/package.json
-
3app/renderer/pages/suspension/index.html
-
253app/yarn.lock
-
2data.json
-
9package.json
-
2708yarn.lock
@ -1,3 +1,5 @@ |
|||
*.swp |
|||
node_modules |
|||
app/data.json |
|||
|
|||
*OutApp* |
Before Width: 60 | Height: 60 | Size: 969 B After Width: 60 | Height: 60 | Size: 969 B |
Before Width: 22 | Height: 22 | Size: 1.1 KiB After Width: 22 | Height: 22 | Size: 1.1 KiB |
Before Width: 24 | Height: 24 | Size: 623 B After Width: 24 | Height: 24 | Size: 623 B |
Before Width: 22 | Height: 22 | Size: 1.0 KiB After Width: 22 | Height: 22 | Size: 1.0 KiB |
@ -0,0 +1,152 @@ |
|||
<!DOCTYPE html> |
|||
<html> |
|||
|
|||
<head> |
|||
<meta charset="UTF-8"> |
|||
<title>系统运行监控</title> |
|||
<meta http-equiv="Pragma" content="no-cache"> |
|||
<META HTTP-EQUIV="Cache-Control" content="no-cache"> |
|||
<META HTTP-EQUIV="Expires" content="0"> |
|||
</head> |
|||
|
|||
<body class="main"> |
|||
<section style="-webkit-app-region: drag;width: 100%"> |
|||
<div class="heading"> |
|||
<div class="title"> |
|||
<img class="title-img" src="assets/mainphoto.png"> |
|||
<span class="head_title">系统运行监控</span> |
|||
</div> |
|||
<div class="use-btn" style="-webkit-app-region: no-drag"> |
|||
<a class="small" id="min" onclick="minFun()"></a> |
|||
<!-- <a class="big" id="max" onclick="maxFun()"></a> --> |
|||
<a class="close" id="closed" onclick="closeFun()"></a> |
|||
</div> |
|||
</div> |
|||
</section> |
|||
<div class="fromBox"> |
|||
<!-- <webview id="obj" class="obj" type="text/html" src="http://localhost:3806/TIS_PLATFORM?appId=TIS_APP_FRAME_YXJK&launcher=monitor"></webview> --> |
|||
<!-- <webview id="obj" class="obj" type="text/html" src="http://localhost:3806/TIS_PLATFORM/?appId=TIS_APP_FRAME_YXJK&launcher=monitor#/pc"></webview> --> |
|||
<!-- <webview id="obj" class="obj" type="text/html" src="http://10.12.33.74:3806/TIS_PLATFORM/?appId=TIS_APP_FRAME_YXJK&launcher=monitor#/pc"></webview> --> |
|||
<iframe src="./assets/test1.pdf" width="100%" height="100%" frameborder="0"></iframe> |
|||
</div> |
|||
<script type="text/javascript"> |
|||
function minFun() { |
|||
window.api && window.api.minimize() |
|||
} |
|||
function closeFun() { |
|||
window.api && window.api.exitSystem() |
|||
} |
|||
</script> |
|||
<style> |
|||
* { |
|||
margin: 0; |
|||
padding: 0; |
|||
} |
|||
|
|||
@font-face { |
|||
font-family: 思源黑体bold; |
|||
src: url("./font/SourceHanSansCN-Bold.otf"); |
|||
} |
|||
|
|||
.main { |
|||
display: flex; |
|||
flex-direction: column; |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
|
|||
.main .heading { |
|||
width: 100%; |
|||
height: 4vh; |
|||
/* line-height: 5vh; */ |
|||
display: flex; |
|||
flex-direction: row; |
|||
justify-content: space-between; |
|||
align-items: center; |
|||
background-image: linear-gradient(0deg, #212123 0%, #383839 40%, #4e4e4e 100%), |
|||
linear-gradient(#212123, |
|||
#212123); |
|||
background-blend-mode: normal, |
|||
normal; |
|||
border-radius: 10px 10px 0px 0px; |
|||
} |
|||
|
|||
.main .heading .title { |
|||
display: flex; |
|||
align-items: center; |
|||
padding: 0 0 0 1vw; |
|||
font-size: 1.6vw; |
|||
color: #d8d8d8; |
|||
height: 5vh; |
|||
line-height: 5vh; |
|||
} |
|||
|
|||
.main .heading .title img { |
|||
width: 2.6vh; |
|||
height: 2.6vh; |
|||
} |
|||
|
|||
.main .heading .title span { |
|||
display: block; |
|||
padding: 0 0 0 5px; |
|||
} |
|||
|
|||
.main .heading .use-btn { |
|||
display: flex; |
|||
flex-direction: row; |
|||
padding: 1.5vh 1vw; |
|||
} |
|||
|
|||
.main .heading .use-btn a { |
|||
margin-left: 3px; |
|||
width: 2vh; |
|||
height: 2vh; |
|||
} |
|||
|
|||
.main .fromBox { |
|||
display: flex; |
|||
width: 100%; |
|||
justify-content: center; |
|||
background-color: #000000; |
|||
height: 95vh; |
|||
border-radius: 0 0 10px 10px; |
|||
box-shadow: 4px 4px 10px 0px rgba(33, 33, 35, 0.35); |
|||
} |
|||
|
|||
.main .fromBox .obj { |
|||
height: 99%; |
|||
width: 99%; |
|||
} |
|||
|
|||
.big { |
|||
background: url("assets/big.png") no-repeat 0 0; |
|||
background-size: 100% 100%; |
|||
margin-right: 1vw; |
|||
} |
|||
|
|||
.small { |
|||
background: url("assets/small.png") no-repeat 0 0; |
|||
background-size: 100% 100%; |
|||
margin-right: 1vw; |
|||
} |
|||
|
|||
.close { |
|||
background: url("assets/close-new.png") no-repeat 0 0; |
|||
background-size: 100% 100%; |
|||
} |
|||
|
|||
.head_title { |
|||
width: 253px; |
|||
/* height: 54px; */ |
|||
font-family: 思源黑体bold; |
|||
font-size: 16px; |
|||
font-weight: normal; |
|||
font-stretch: normal; |
|||
line-height: 50px; |
|||
letter-spacing: 2px; |
|||
color: #ffffff; |
|||
} |
|||
</style> |
|||
</body> |
|||
|
|||
</html> |
@ -1 +1 @@ |
|||
{"test":{"a":1},"test2":{"name":"我是你爹"}} |
|||
{"firstInstall":false,"position":{"x":1155,"y":775}} |
@ -1,37 +1,52 @@ |
|||
const { MAIN_WINDOW_FLAG, MAIN_WINDOW_URL } = require("../constant") |
|||
const { createWindow } = require('./lib/common') |
|||
const { BrowserWindow } = require('electron') |
|||
const { create: createSuspensionWindow } = require('./suspension'); |
|||
|
|||
const {MAIN_WINDOW_FLAG, MAIN_WINDOW_URL} = require("../constant") |
|||
const {createWindow} = require('./lib/common') |
|||
const {BrowserWindow} = require('electron') |
|||
const {create: createSuspensionWindow} = require('./suspension'); |
|||
const screen = require("./screen.json"); |
|||
const create = () => { |
|||
const windows = BrowserWindow.getAllWindows() |
|||
const found = windows.find((window) => { |
|||
return window[MAIN_WINDOW_FLAG] |
|||
}) |
|||
|
|||
if (found) { |
|||
found.show(); |
|||
found.center(); |
|||
found.maximize(); |
|||
return found; |
|||
} else { |
|||
const win = createWindow(MAIN_WINDOW_URL,{ |
|||
fullscreen:true, |
|||
offScreen:false, |
|||
frame: false, //要创建无边框窗口
|
|||
show:true |
|||
const windows = BrowserWindow.getAllWindows() |
|||
const found = windows.find((window) => { |
|||
return window[MAIN_WINDOW_FLAG] |
|||
}) |
|||
win[MAIN_WINDOW_FLAG] = true |
|||
|
|||
// win.on('ready-to-show', () => {
|
|||
// win.show();
|
|||
// });
|
|||
win.on('hide', () => { |
|||
createSuspensionWindow(); |
|||
}); |
|||
return create(); |
|||
} |
|||
if (found) { |
|||
found.show(); |
|||
found.center(); |
|||
found.maximize(); |
|||
return found; |
|||
} else { |
|||
let areaSize = require('electron').screen.getPrimaryDisplay().workAreaSize; |
|||
let width = areaSize.width; |
|||
let height = areaSize.height; |
|||
let resizable = true; |
|||
if (screen.width > 0 && screen.height > 0) { |
|||
const ratios = screen.width / screen.height; |
|||
height = areaSize.height; |
|||
width = Math.floor(areaSize.height * ratios); |
|||
resizable = false; |
|||
} |
|||
const win = createWindow(MAIN_WINDOW_URL, { |
|||
//alwaysOnTop: true, //窗口是否总是显示在其他窗口之前
|
|||
fullscreen: true, |
|||
offScreen: false, |
|||
frame: false, //要创建无边框窗口
|
|||
width: width, //悬浮窗口的宽度 比实际DIV的宽度要多2px 因为有1px的边框
|
|||
height: height, //悬浮窗口的高度 比实际DIV的高度要多2px 因为有1px的边框
|
|||
resizable: resizable, //禁止窗口大小缩放
|
|||
show: false, //先不让窗口显示
|
|||
backgroundColor: "#0a0a0a" |
|||
}) |
|||
win[MAIN_WINDOW_FLAG] = true |
|||
|
|||
win.on('ready-to-show', () => { |
|||
win.show(); |
|||
}); |
|||
win.on('hide', () => { |
|||
createSuspensionWindow(); |
|||
}); |
|||
return create(); |
|||
} |
|||
} |
|||
|
|||
|
|||
module.exports = { create } |
|||
module.exports = {create} |
@ -0,0 +1,4 @@ |
|||
{ |
|||
"width":0, |
|||
"height":0 |
|||
} |
@ -1 +1 @@ |
|||
{"test":{"a":1},"test2":{"name":"hallo"},"position":{"x":1790,"y":327}} |
|||
{"test":{"a":1},"test2":{"name":"我是你爹"},"unReadMessage":[],"position":{"x":1243,"y":581}} |