1
0
mirror of https://gitee.com/sui-feng-cb/AzurLaneAutoScript1 synced 2026-03-23 07:28:02 +08:00
Files
AzurLaneAutoScript/webapp/packages/main/src/config.ts

18 lines
814 B
TypeScript
Raw Normal View History

2024-06-05 23:20:28 +08:00
const yaml = require('yaml');
const fs = require('fs');
const path = require('path');
2025-09-03 13:59:51 +08:00
// export const alasPath = 'D:/AzurLaneAutoScript';
export const alasPath = process.cwd();
2024-06-05 23:20:28 +08:00
const file = fs.readFileSync(path.join(alasPath, './config/deploy.yaml'), 'utf8');
2025-09-03 13:59:51 +08:00
const config = yaml.parse(file);
2024-06-05 23:20:28 +08:00
const PythonExecutable = config.Deploy.Python.PythonExecutable;
const WebuiPort = config.Deploy.Webui.WebuiPort.toString();
2025-09-03 13:59:51 +08:00
export const pythonPath = (path.isAbsolute(PythonExecutable) ? PythonExecutable : path.join(alasPath, PythonExecutable));
2024-06-05 23:20:28 +08:00
export const webuiUrl = `http://127.0.0.1:${WebuiPort}`;
export const webuiPath = 'gui.py';
export const webuiArgs = ['--port', WebuiPort, '--electron'];
2025-09-03 13:59:51 +08:00
export const dpiScaling = Boolean(config.Deploy.Webui.DpiScaling) || (config.Deploy.Webui.DpiScaling === undefined) ;