Merge pull request #403 from gnh1201/dev

All updates until 2026-04-18
This commit is contained in:
Namhyeon Go 2026-04-18 12:34:59 +09:00 committed by GitHub
commit d89cdd5ada
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 81 additions and 2 deletions

View File

@ -2418,8 +2418,12 @@ var NullProtoObjectViaSc64bit = function () {
sc64bit.Language = 'JScript';
return sc64bit.Eval('Object');
} catch (error) {
// Throw explicit error if ScriptControl is not available in 64-bit environment
throw new Error('A compatible ScriptControl version is required to support null-prototype objects on 64-bit environments.');
// If all attempts to retrieve a new object from an external instance fail,
// the existing object is returned.
// This prevents errors during the key deletion process using enumBugKeys afterward.
return function () {
return {};
};
}
}

View File

@ -0,0 +1,19 @@
{
"mcpServers": {
"local-tools": {
"command": "C:/Windows/SysWOW64/cscript",
"args": [
"/nologo",
"C:/Users/user/Documents/GitHub/welsonjs/app.js",
"mcploader",
"/quiet"
]
}
},
"preferences": {
"coworkScheduledTasksEnabled": false,
"ccdScheduledTasksEnabled": false,
"coworkWebSearchEnabled": true,
"sidebarMode": "chat"
}
}

View File

@ -0,0 +1,56 @@
// fix_excel_format.js
// This script requires the WelsonJS framework.
var Office = require("lib/msoffice");
function main(args) {
var excel = new Office.Excel(); // Create a Excel instance
excel.open("data\\fulllist.xlsx"); // Open a Excel window
// select the worksheet
excel.selectWorksheet(2);
for (var i = 0; i < 34; i++) {
var rownum = 2 + i;
var company_name = excel.getCellByPosition(rownum, 3).getValue();
var reservation_time = excel.getCellByPosition(rownum, 7).getValue();
var resource_name = excel.getCellByPosition(rownum, 8).getValue();
var port_number = excel.getCellByPosition(rownum, 9).getValue();
var bandwidth = excel.getCellByPosition(rownum, 10).getValue();
console.log("================");
console.log("Company Name: " + company_name);
console.log("Reservation Time: " + reservation_time);
console.log("Resource Name: " + resource_name);
console.log("Port Number: " + port_number);
console.log("Bandwidth: " + bandwidth);
console.log("================");
make_card_file({
"company_name": company_name,
"reservation_time": reservation_time,
"resource_name": resource_name,
"port_number": port_number,
"bandwidth": bandwidth
});
}
}
function make_card_file(data) {
var excel = new Office.Excel();
excel.open("card_format.xlsx");
excel.getCellByPosition(2, 1).setValue(data.company_name);
excel.getCellByPosition(2, 2).setValue(!data.resource_name ? "127.0.0.1" : data.resource_name);
excel.getCellByPosition(2, 3).setValue(!data.port_number ? "80" : data.port_number);
excel.getCellByPosition(2, 4).setValue(!data.bandwidth ? "100M" : data.bandwidth);
excel.getCellByPosition(2, 5).setValue(data.reservation_time);
var file_name = String(data.company_name) + "_card.xlsx";
excel.saveAs("data\\" + file_name);
excel.close();
}
exports.main = main;