feat(steady): 实现稳态校验任务功能重构
- 添加influxdb配置支持和资源文件打包 - 实现校验任务表格组件和相关工具函数 - 重构校验工作台为任务创建对话框模式 - 实现校验详情面板支持多种异常类型展示 - 更新校验概览表格显示任务基本信息 - 优化校验查询参数和API接口定义 - 实现搜索表单组件化和过滤功能增强
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
/**
|
||||
* 判断路径中是否包含非 ASCII 字符。
|
||||
@@ -16,6 +17,29 @@ function getDriveRoot(targetPath = '') {
|
||||
return path.parse(resolvedPath).root;
|
||||
}
|
||||
|
||||
function resolvePackagedRuntime() {
|
||||
const resourcesPath = process.resourcesPath;
|
||||
const packagedBaseDir = resourcesPath ? path.dirname(resourcesPath) : '';
|
||||
const hasPackagedResources = resourcesPath
|
||||
&& fs.existsSync(path.join(resourcesPath, 'extraResources'))
|
||||
&& fs.existsSync(path.join(packagedBaseDir, 'mysql'));
|
||||
|
||||
if (hasPackagedResources) {
|
||||
return {
|
||||
isPackaged: true,
|
||||
baseDir: packagedBaseDir,
|
||||
resourcesPath
|
||||
};
|
||||
}
|
||||
|
||||
const baseDir = path.join(__dirname, '..');
|
||||
return {
|
||||
isPackaged: false,
|
||||
baseDir,
|
||||
resourcesPath: path.join(baseDir, 'build', 'extraResources')
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* 解析运行期路径策略。
|
||||
* - 安全路径:继续直接使用应用目录
|
||||
@@ -38,5 +62,6 @@ function resolveRuntimeStrategy(baseDir) {
|
||||
module.exports = {
|
||||
hasNonAscii,
|
||||
getDriveRoot,
|
||||
resolvePackagedRuntime,
|
||||
resolveRuntimeStrategy
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user