Skip to content

Commit fc876ce

Browse files
committed
machine-setup: only pack machine-setup-linux & fix
1 parent e2a7791 commit fc876ce

File tree

9 files changed

+43
-24
lines changed

9 files changed

+43
-24
lines changed

.github/workflows/release.yml

+12-4
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,13 @@ jobs:
1818
with:
1919
node-version: 20
2020
- run: yarn
21-
- name: Build
21+
- name: Build Tools Core
2222
run: yarn build
23+
- name: Build Machine Setup App
24+
run: |
25+
cd packages/machine-setup
26+
yarn neu update
27+
yarn neu build --clean
2328
2429
release:
2530
needs: build
@@ -42,13 +47,16 @@ jobs:
4247
run: tar -czvf /tmp/xcpc-tools-macos.tar.gz dist/pkg/xcpc-tools-macos
4348
- name: Create Tar for Linux
4449
run: tar -czvf /tmp/xcpc-tools-linux.tar.gz dist/pkg/xcpc-tools-linux
45-
- name: Build Machine Setup package
50+
- name: Build Machine Setup App
4651
run: |
4752
cd packages/machine-setup
4853
yarn neu update
4954
yarn neu build --clean
5055
- name: Create Tar for Machine Setup
51-
run: tar -czvf /tmp/xcpc-tools-machine-setup.tar.gz packages/machine-setup/dist/hydro-xcpctools-machine-setup
56+
run: |
57+
cd packages/machine-setup/dist/hydro-xcpctools-machine-setup
58+
chmod +x hydro-xcpctools-machine-setup-linux_*
59+
tar -czvf /tmp/xcpc-tools-machine-setup-linux.tar.gz resources.neu hydro-xcpctools-machine-setup-linux_*
5260
- name: Get release version and commit
5361
id: tag
5462
run: |
@@ -63,6 +71,6 @@ jobs:
6371
/tmp/xcpc-tools-win.zip
6472
/tmp/xcpc-tools-macos.tar.gz
6573
/tmp/xcpc-tools-linux.tar.gz
66-
/tmp/xcpc-tools-machine-setup.tar.gz
74+
/tmp/xcpc-tools-machine-setup-linux.tar.gz
6775
env:
6876
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

packages/machine-setup/frontend/index.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset="UTF-8" />
5-
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
5+
<link rel="icon" type="image/png" href="/hydro.png" />
66
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
77
<script src="__neutralino_globals.js"></script>
88
<title>@Hydro/XCPC-TOOLS/MACHINE-SETUP</title>
3.53 KB
Loading

packages/machine-setup/frontend/public/vite.svg

-1
This file was deleted.

packages/machine-setup/frontend/src/components/BasicInfo.vue

+14-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<template>
2-
<n-grid x-gap="6" :cols="2">
2+
<n-grid x-gap="6" :cols="2" style="margin-bottom: .25em;">
33
<n-gi>
44
<n-card bordered shadow="always" style="margin-bottom: .25em;" class="text-center">
55
<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>
710
</n-card>
811
<n-card bordered shadow="always">
912
<n-input placeholder="请输入座位号" v-model:value="editSeat" type="text" size="large" style="width: 100%; margin-bottom: .5em;" />
@@ -18,7 +21,7 @@
1821
</n-card>
1922
</n-gi>
2023
<n-gi>
21-
<n-card bordered shadow="always">
24+
<n-card bordered shadow="always" style="margin-bottom: .25em;">
2225
<n-popconfirm @positive-click="checkAll(false)" positive-text="开始检查" negative-text="强制开始" @negative-click="checkAll(true)">
2326
<template #trigger>
2427
<n-button type="primary" style="width: 100%;">完成设备配置</n-button>
@@ -30,8 +33,11 @@
3033
</n-popconfirm>
3134
</n-card>
3235
<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>
3541
</n-card>
3642
</n-gi>
3743
</n-grid>
@@ -63,7 +69,7 @@ const saveSeat = async () => {
6369
const showSeat = async () => {
6470
try {
6571
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 &`);
6773
if (res.stdErr) throw new Error(res.stdErr);
6874
} catch (error) {
6975
console.error(error);
@@ -72,6 +78,7 @@ const showSeat = async () => {
7278
};
7379
7480
const checkAll = async (force = false) => {
81+
window.$notification.info({ title: '海内存知己,天涯若比邻', content: '正在检查设备配置,请稍后...', duration: 3000 });
7582
if (force) {
7683
if (!nowSeat.value) {
7784
window.$notification.error({ title: '未设置座位号', content: '请先设置座位号', duration: 3000 });
@@ -91,7 +98,7 @@ const checkAll = async (force = false) => {
9198
await os.execCommand(`systemctl enable heartbeat.timer --now`);
9299
window.$notification.success({ title: '已成功完成配置', content: '5s后程序自动关闭', duration: 5000 });
93100
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 &`);
95102
};
96103
97104
const getIp = () => window.ip;

packages/machine-setup/frontend/src/components/HeartbeatInfo.vue

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<template>
2-
<n-card bordered shadow="always">
2+
<n-card bordered shadow="always" style="margin-bottom: .25em;">
33
<n-grid x-gap="12" :cols="2">
44
<n-gi>
5-
<n-tag :type="!nowHeartbeat ? 'error' : 'success'">{{ nowHeartbeat || 'no center' }}</n-tag>
5+
<p><n-tag :type="!nowHeartbeat ? 'error' : 'success'">{{ nowHeartbeat || 'no center' }}</n-tag></p>
66
<n-space>
77
<n-tag :type="onHeartbeat ? 'success' : 'error'">{{ onHeartbeat ? '已开启上报' : '未开启上报' }}</n-tag>
88
<n-button type="warning" size="small" @click="getHeartbeatVersion(nowHeartbeat)">中心状态</n-button>
@@ -85,8 +85,8 @@ const saveHeartbeat = async (force = false) => {
8585
}
8686
console.log('save heartbeat', url);
8787
await filesystem.writeFile('/etc/default/icpc-heartbeat', `HEARTBEATURL=${url}`);
88-
const res2 = await os.execCommand('systemctl enable heartbeat.timer --now');
89-
console.log('run enable heartbeat on save', res2);
88+
const res = await os.execCommand('systemctl enable heartbeat.timer --now');
89+
console.log('run enable heartbeat on save', res);
9090
nowHeartbeat.value = url;
9191
onHeartbeat.value = true;
9292
window.$notification.success({ title: '保存心跳上报URL成功', content: '请查看心跳上报状态', duration: 3000 });

packages/machine-setup/frontend/src/components/SystemInfo.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<n-card bordered title="Machine Info" shadow="always">
2+
<n-card bordered title="Machine Info" shadow="always" style="margin-bottom: .25em;">
33
<n-grid x-gap="12" :cols="2">
44
<n-gi>
55
<p>CPU: {{ cpuInfo }}</p>

packages/machine-setup/frontend/src/components/VideoInfo.vue

+10-5
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,24 @@
22
<n-card bordered shadow="always">
33
<n-grid x-gap="12" :cols="2">
44
<n-gi>
5-
<n-space>
5+
<div style="display: flex; justify-content: center; align-items: center;">
66
<p>摄像头服务:</p>
7-
<n-tag :type="hasCamera ? 'success' : 'error'">{{ hasCamera ? '已连接' : '未连接' }}</n-tag>
8-
<n-tag :type="runCamera ? 'success' : 'error'">{{ runCamera ? '运行中' : '未运行' }}</n-tag>
9-
</n-space>
7+
<n-space>
8+
<n-tag :type="hasCamera ? 'success' : 'error'">{{ hasCamera ? '已连接' : '未连接' }}</n-tag>
9+
<n-tag :type="runCamera ? 'success' : 'error'">{{ runCamera ? '运行中' : '未运行' }}</n-tag>
10+
</n-space>
11+
</div>
1012
<n-space>
1113
<n-button size="small" type="primary" @click="runService('vlc-webcam', 'restart')">启动</n-button>
1214
<n-button size="small" type="error" @click="runService('vlc-webcam', 'stop')">停止</n-button>
1315
<n-button size="small" type="info" @click="runVLC('webcam')">测试</n-button>
1416
<n-button size="small" type="warning" @click="runService('vlc-webcam', 'enable')">激活</n-button>
1517
<n-button size="small" @click="statusService('vlc-webcam')">状态</n-button>
1618
</n-space>
17-
<p>屏幕捕获服务:<n-tag :type="runScreen ? 'success' : 'error'">{{ runScreen ? '运行中' : '未运行' }}</n-tag></p>
19+
<div style="display: flex; justify-content: center; align-items: center;">
20+
<p>屏幕捕获服务:</p>
21+
<n-tag :type="runScreen ? 'success' : 'error'">{{ runScreen ? '运行中' : '未运行' }}</n-tag>
22+
</div>
1823
<n-space>
1924
<n-button size="small" type="primary" @click="runService('vlc-screen', 'restart')">启动</n-button>
2025
<n-button size="small" type="error" @click="runService('vlc-screen', 'stop')">停止</n-button>

packages/machine-setup/neutralino.config.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"center": true,
3131
"fullScreen": false,
3232
"alwaysOnTop": false,
33-
"icon": "/frontend/public/vite.svg",
33+
"icon": "/frontend/public/hydro.png",
3434
"enableInspector": false,
3535
"borderless": false,
3636
"maximize": false,

0 commit comments

Comments
 (0)