Skip to content

Commit

Permalink
feat: Console.logLevel
Browse files Browse the repository at this point in the history
Update arguments-builder.config.ts
Update boxjs.settings.json
Update package-lock.json
Update response.dev.js
Update request.dev.js
Update database.mjs
Update response.js
Update request.js
Update setENV.mjs
Update types.d.ts
  • Loading branch information
VirgilClyne committed Dec 10, 2024
1 parent ab9c536 commit 25d677b
Show file tree
Hide file tree
Showing 14 changed files with 531 additions and 321 deletions.
15 changes: 15 additions & 0 deletions arguments-builder.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,20 @@ export default defineConfig({
],
type: "string",
},
{
key: "LogLevel",
name: "[调试] 日志等级",
type: "string",
defaultValue: "WARN",
description: "选择脚本日志的输出等级,低于所选等级的日志将全部输出。",
options: [
{ key: "OFF", label: "关闭" },
{ key: "ERROR", label: "❌ 错误" },
{ key: "WARN", label: "⚠️ 警告" },
{ key: "INFO", label: "ℹ️ 信息" },
{ key: "DEBUG", label: "🅱️ 调试" },
{ key: "ALL", label: "全部" },
],
},
],
});
138 changes: 55 additions & 83 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"node-polyfill-webpack-plugin": "^4.1.0"
},
"dependencies": {
"@nsnanocat/util": "^1.7.5",
"@nsnanocat/util": "^1.7.6",
"@protobuf-ts/runtime": "^2.9.3"
}
}
66 changes: 35 additions & 31 deletions src/class/GEOPDPlaceRequest.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -4,35 +4,39 @@ import { PDPlaceRequest, RequestType } from "../proto/apple/geo/GEOPDPlaceReques
//import { GeoServiceTag_ServiceType } from "../proto/apple/geo/GEOPDAnalyticMetadata.js";
import { ComponentType } from "../proto/apple/geo/GEOPDComponentInfo.js";
export default class GEOPDPlaceRequest {
static decode(rawBody = new Uint8Array([])) {
Console.log("☑️ GEOPDPlaceRequest.decode");
const body = PDPlaceRequest.fromBinary(rawBody);
if (typeof body?.analyticMetadata?.serviceTag !== "undefined") body.analyticMetadata.serviceTag.map(serviceTag => {
if (typeof serviceTag.serviceType !== "undefined") serviceTag.serviceType = GeoServiceTag_ServiceType[serviceTag.serviceType];
return serviceTag;
});
if (typeof body?.requestedComponents !== "undefined") body.requestedComponents.map(requestedComponent => {
if (typeof requestedComponent.type !== "undefined") requestedComponent.type = ComponentType[requestedComponent.type];
return requestedComponent;
});
if (typeof body.requestType !== "undefined") body.requestType = RequestType[body.requestType];
Console.log("✅ GEOPDPlaceRequest.decode");
return body;
};
static decode(rawBody = new Uint8Array([])) {
Console.log("☑️ GEOPDPlaceRequest.decode");
const body = PDPlaceRequest.fromBinary(rawBody);
if (typeof body?.analyticMetadata?.serviceTag !== "undefined")
body.analyticMetadata.serviceTag.map(serviceTag => {
if (typeof serviceTag.serviceType !== "undefined") serviceTag.serviceType = GeoServiceTag_ServiceType[serviceTag.serviceType];
return serviceTag;
});
if (typeof body?.requestedComponents !== "undefined")
body.requestedComponents.map(requestedComponent => {
if (typeof requestedComponent.type !== "undefined") requestedComponent.type = ComponentType[requestedComponent.type];
return requestedComponent;
});
if (typeof body.requestType !== "undefined") body.requestType = RequestType[body.requestType];
Console.log("✅ GEOPDPlaceRequest.decode");
return body;
}

static encode(body = {}) {
Console.log("☑️ GEOPDPlaceRequest.encode");
if (typeof body?.analyticMetadata?.serviceTag !== "undefined") body.analyticMetadata.serviceTag.map(serviceTag => {
if (typeof serviceTag.serviceType !== "undefined") serviceTag.serviceType = GeoServiceTag_ServiceType[serviceTag.serviceType];
return serviceTag;
});
if (typeof body?.requestedComponents !== "undefined") body.requestedComponents.map(requestedComponent => {
if (typeof requestedComponent.type !== "undefined") requestedComponent.type = ComponentType[requestedComponent.type];
return requestedComponent;
});
if (typeof body.requestType !== "undefined") body.requestType = RequestType[body.requestType];
const rawBody = PDPlaceRequest.toBinary(body);
Console.log("✅ GEOPDPlaceRequest.encode");
return rawBody;
};
};
static encode(body = {}) {
Console.log("☑️ GEOPDPlaceRequest.encode");
if (typeof body?.analyticMetadata?.serviceTag !== "undefined")
body.analyticMetadata.serviceTag.map(serviceTag => {
if (typeof serviceTag.serviceType !== "undefined") serviceTag.serviceType = GeoServiceTag_ServiceType[serviceTag.serviceType];
return serviceTag;
});
if (typeof body?.requestedComponents !== "undefined")
body.requestedComponents.map(requestedComponent => {
if (typeof requestedComponent.type !== "undefined") requestedComponent.type = ComponentType[requestedComponent.type];
return requestedComponent;
});
if (typeof body.requestType !== "undefined") body.requestType = RequestType[body.requestType];
const rawBody = PDPlaceRequest.toBinary(body);
Console.log("✅ GEOPDPlaceRequest.encode");
return rawBody;
}
}
4 changes: 2 additions & 2 deletions src/class/GEOResourceManifest.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default class GEOResourceManifest {
case "VECTOR_TRAFFIC_SKELETON_WITH_HISTORICAL": // 28 交通状况骨架(卫星地图:显示历史交通状况)?
case "VECTOR_TRAFFIC_V2": // 86 交通状况V2
//Console.warn(`Traffic style: ${tile?.style}`);
/*
/*
switch (settings.TileSet.Traffic) {
case "HYBRID":
default:
Expand Down Expand Up @@ -319,7 +319,7 @@ export default class GEOResourceManifest {
case "VMAP4_ELEVATION_POLAR": // 93 VMAP4 高程(极地)?
case "CELLULAR_COVERAGE_PLMN": // 94 蜂窝覆盖 PLMN?
case "UNUSED_99": // 99 未使用
break;
break;
default:
Console.warn(`default style: ${tile?.style}`);
/*
Expand Down
Loading

0 comments on commit 25d677b

Please sign in to comment.