代码拉取完成,页面将自动刷新
同步操作将从 IceWhale Team/CasaOS-UI 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
/*
* @LastEditors: zhanghengxin ezreal.zhang@icewhale.org
* @LastEditTime: 2023/1/3 下午8:51
* @FilePath: /CasaOS-UI/message_bus.build.js
* @Description:
*
* Copyright (c) 2022 by IceWhale, All Rights Reserved.
*/
const events = require('./src/events/message_bus.js');
const fs = require('fs');
const path = require('path');
const outPath = './build/sysroot/var/lib/casaos/';
const outName = 'ui-message-bus.json';
const registerShellPath = './build/sysroot/etc/casaos/start.d/';
var array = [];
// Parse the event to array
Object.keys(events).forEach((key) => {
events[key]().then(eventObj => {
eventObj.propertyTypeList = Object.keys(eventObj.properties)
eventObj.propertyTypeList = eventObj.propertyTypeList.map((key) => {
return {
"name": key,
"discription": "",
"example": ""
}
});
delete eventObj.properties
array.push(eventObj);
});
});
// Create the output folder
fs.mkdir(outPath, {recursive: true}, (err) => {
if (err) {
console.log(err);
} else {
// Write the output file
fs.writeFile(path.join(outPath, outName), JSON.stringify(array, "", "\t"), (err) => {
if (err) {
console.log(err);
} else {
console.log('The json file has been saved!');
}
});
}
});
// Copy the register shell file to the output folder
fs.mkdir(registerShellPath, {recursive: true}, (err) => {
if (err) {
console.log(err);
} else {
fs.copyFile('./register-ui-events.sh', path.join(registerShellPath, 'register-ui-events.sh'), (err) => {
if (err) {
console.log(err);
} else {
console.log('The shell file has been saved!');
}
});
}
});
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。