Javascript 和 Python 增加内置函数 QLAPI.notify

This commit is contained in:
whyour
2024-07-21 01:15:16 +08:00
parent 1b39d3ab48
commit eb5cc3943d
8 changed files with 42 additions and 15 deletions
+4
View File
@@ -41,6 +41,8 @@ const systemLogPath = path.join(dataPath, 'syslog/');
const envFile = path.join(preloadPath, 'env.sh');
const jsEnvFile = path.join(preloadPath, 'env.js');
const pyEnvFile = path.join(preloadPath, 'env.py');
const jsNotifyFile = path.join(preloadPath, 'notify.js');
const pyNotifyFile = path.join(preloadPath, 'notify.py');
const confFile = path.join(configPath, 'config.sh');
const crontabFile = path.join(configPath, 'crontab.list');
const authConfigFile = path.join(configPath, 'auth.json');
@@ -92,6 +94,8 @@ export default {
envFile,
jsEnvFile,
pyEnvFile,
jsNotifyFile,
pyNotifyFile,
dbPath,
uploadPath,
configPath,
+5
View File
@@ -28,6 +28,8 @@ const sampleNotifyJsFile = path.join(samplePath, 'notify.js');
const sampleNotifyPyFile = path.join(samplePath, 'notify.py');
const scriptNotifyJsFile = path.join(scriptPath, 'sendNotify.js');
const scriptNotifyPyFile = path.join(scriptPath, 'notify.py');
const jsNotifyFile = path.join(preloadPath, 'notify.js');
const pyNotifyFile = path.join(preloadPath, 'notify.py');
const TaskBeforeFile = path.join(configPath, 'task_before.sh');
const TaskAfterFile = path.join(configPath, 'task_after.sh');
const homedir = os.homedir();
@@ -102,6 +104,9 @@ export default async () => {
await fs.writeFile(confFile, await fs.readFile(sampleConfigFile));
}
await fs.writeFile(jsNotifyFile, await fs.readFile(sampleNotifyJsFile));
await fs.writeFile(pyNotifyFile, await fs.readFile(sampleNotifyPyFile));
if (!scriptNotifyJsFileExist) {
await fs.writeFile(
scriptNotifyJsFile,