fix(mikrotikConfigRoutes): enhance script execution logic to find script ID before running
Publish Fast Tabler Docker image / build-and-push-fast (push) Successful in 2m9s

This commit is contained in:
2026-02-03 23:47:39 +07:00
parent d4a1643a25
commit 61c87e69ef
2 changed files with 15 additions and 10 deletions
+9 -8
View File
@@ -23,16 +23,19 @@ function createRosClient(opts) {
const auth = Buffer.from(`${user}:${password || ''}`).toString('base64');
const cleanPath = (urlPath.startsWith('/') ? urlPath.slice(1) : urlPath).replace(/\\/g, '/');
const pathStr = `/rest/${cleanPath}`.replace(/\/+/g, '/');
const bodyStr = (body !== null && body !== undefined) ? JSON.stringify(body) : '';
const headers = {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': `Basic ${auth}`,
};
if (bodyStr) headers['Content-Length'] = Buffer.byteLength(bodyStr, 'utf8');
const options = {
hostname: host,
port,
path: pathStr,
method,
headers: {
'Content-Type': 'application/json',
'Accept': 'application/json',
'Authorization': `Basic ${auth}`,
},
headers,
rejectUnauthorized: secure,
};
@@ -57,9 +60,7 @@ function createRosClient(opts) {
});
req.on('error', reject);
if (body !== null && body !== undefined) {
req.write(JSON.stringify(body));
}
if (bodyStr) req.write(bodyStr);
req.end();
});
};