1
1
<template >
2
- <n-grid x-gap =" 6" :cols =" 2" >
2
+ <n-grid x-gap =" 6" :cols =" 2" style = " margin-bottom : .25 em ; " >
3
3
<n-gi >
4
4
<n-card bordered shadow =" always" style =" margin-bottom : .25em ;" class =" text-center" >
5
5
<h2 style =" margin : .5em 0 ;" >@Hydro/XCPC-TOOLS</h2 >
6
- <h1 style =" margin : .25em 0 ;" >Setup Tool</h1 >
6
+ <div style =" display : flex ; justify-content : center ; align-items : center ;" >
7
+ <h1 style =" margin : .25em 0 ;" >Setup Tool</h1 >
8
+ <img src =" /hydro.png" alt =" logo" style =" width : 3em ; height : 3em ; margin-left : .25em ;" />
9
+ </div >
7
10
</n-card >
8
11
<n-card bordered shadow =" always" >
9
12
<n-input placeholder =" 请输入座位号" v-model:value =" editSeat" type =" text" size =" large" style =" width : 100% ; margin-bottom : .5em ;" />
18
21
</n-card >
19
22
</n-gi >
20
23
<n-gi >
21
- <n-card bordered shadow =" always" >
24
+ <n-card bordered shadow =" always" style = " margin-bottom : .25 em ; " >
22
25
<n-popconfirm @positive-click =" checkAll(false)" positive-text =" 开始检查" negative-text =" 强制开始" @negative-click =" checkAll(true)" >
23
26
<template #trigger >
24
27
<n-button type =" primary" style =" width : 100% ;" >完成设备配置</n-button >
30
33
</n-popconfirm >
31
34
</n-card >
32
35
<n-card bordered shadow =" always" class =" text-center" >
33
- <h1 style =" margin : 0 ;" >座位号</h1 >
34
- <h1 style =" font-size : 5em ; margin : 0 ;" >{{ nowSeat || 'XX-XX' }}</h1 >
36
+ <div style =" display : flex ; justify-content : center ; align-items : center ;" >
37
+ <h1 style =" margin : 0 ;" >座位号</h1 >
38
+ <n-tag v-if =" !nowSeat" type =" error" style =" margin-left : .5em ;" >未设置座位号</n-tag >
39
+ </div >
40
+ <h1 style =" font-size : 45px ; margin : .35em 0 ;" >{{ nowSeat || 'XXXX-XXX' }}</h1 >
35
41
</n-card >
36
42
</n-gi >
37
43
</n-grid >
@@ -63,7 +69,7 @@ const saveSeat = async () => {
63
69
const showSeat = async () => {
64
70
try {
65
71
console .log (' show seat' , nowSeat .value );
66
- const res = await os .execCommand (` zenity --info --text "<span font='256'>${nowSeat .value }</span>" ` );
72
+ const res = await os .execCommand (` zenity --info --text "<span font='${ nowSeat . value . length > 4 ? 128 : 256 } '>${nowSeat .value }</span>" > /dev/null 2>&1 & ` );
67
73
if (res .stdErr ) throw new Error (res .stdErr );
68
74
} catch (error ) {
69
75
console .error (error );
@@ -72,6 +78,7 @@ const showSeat = async () => {
72
78
};
73
79
74
80
const checkAll = async (force = false ) => {
81
+ window .$notification .info ({ title: ' 海内存知己,天涯若比邻' , content: ' 正在检查设备配置,请稍后...' , duration: 3000 });
75
82
if (force ) {
76
83
if (! nowSeat .value ) {
77
84
window .$notification .error ({ title: ' 未设置座位号' , content: ' 请先设置座位号' , duration: 3000 });
@@ -91,7 +98,7 @@ const checkAll = async (force = false) => {
91
98
await os .execCommand (` systemctl enable heartbeat.timer --now ` );
92
99
window .$notification .success ({ title: ' 已成功完成配置' , content: ' 5s后程序自动关闭' , duration: 5000 });
93
100
setTimeout (() => app .exit (), 5000 );
94
- os .execCommand (` zenity --info --text "<span font='256'>${nowSeat .value }\n </span><span font='128'>${window .ip }</span>" > /dev/null 2>&1 & ` );
101
+ os .execCommand (` zenity --info --text "<span font='${ nowSeat . value . length > 4 ? 128 : 256 } '>${nowSeat .value }\n </span><span font='128'>${window .ip }</span>" > /dev/null 2>&1 & ` );
95
102
};
96
103
97
104
const getIp = () => window .ip ;
0 commit comments