修复bug

This commit is contained in:
2026-08-09 18:58:48 +08:00
parent 6f3ff91b29
commit b9a86e0e6b
3 changed files with 45 additions and 22 deletions
@@ -59,29 +59,45 @@ struct Aircraft_List_JSON_Service_O {
static Psc::JSON view_model() {
auto columns = Psc::JSON::array();
const auto add_column = [&columns](const char* key, const char* label, const char* type,
const char* default_sort_order = nullptr) {
const char* default_sort_order = nullptr,
const char* fixed = nullptr,
const std::uint32_t width = 110) {
auto column = Psc::JSON::object();
column.append({"key", key});
column.append({"label", label});
column.append({"type", type});
column.append({"width", width});
column.append({"sortable", std::string(type) != "index"});
if (std::string(type) == "number") {
column.append({"filter", "range"});
} else if (std::string(type) == "text") {
column.append({"filter", "text"});
} else if (std::string(type) == "boolean") {
column.append({"filter", "boolean"});
}
if (default_sort_order != nullptr) {
column.append({"defaultSortOrder", default_sort_order});
}
if (fixed != nullptr) {
column.append({"fixed", fixed});
}
columns.append(std::move(column));
};
add_column("index", "序号", "index");
add_column("index", "序号", "index", nullptr, "left", 64);
add_column("hex", "识别码(ICAO", "text", nullptr, "left", 132);
add_column("fli", "呼号", "text", nullptr, "left", 120);
auto time_column = Psc::JSON::object();
time_column.append({"key", "time"});
time_column.append({"label", "时间"});
time_column.append({"type", "timestamp"});
time_column.append({"width", 190});
time_column.append({"sortable", true});
time_column.append({"secondsKey", "uti"});
time_column.append({"nanosecondsKey", "ns"});
columns.append(std::move(time_column));
add_column("times", "<mode_s>消息数", "number");
add_column("hex", "识别码<ICAO>", "text");
add_column("fli", "航班编号", "text");
add_column("times", "Mode-S 消息数", "number", nullptr, nullptr, 132);
add_column("ava", "数据来源标识", "text");
add_column("src", "首选数据源", "text");
add_column("cla", "ADS-B数据子类", "text");
@@ -90,7 +106,7 @@ struct Aircraft_List_JSON_Service_O {
add_column("alt", "高度(米)", "number");
add_column("spd", "地速(节)", "number");
add_column("trk", "航向(真)", "number");
add_column("vrt", "垂直速度(<ft/min>", "number");
add_column("vrt", "垂直速度(ft/min", "number", nullptr, nullptr, 150);
add_column("gda", "空中/地面状态", "text");
add_column("cat", "机型分类", "text");
add_column("org", "起飞机场", "text");
@@ -102,28 +118,28 @@ struct Aircraft_List_JSON_Service_O {
add_column("cou", "国家", "text");
add_column("dis", "接收器距离", "number");
add_column("tru", "信任值", "number");
add_column("dbm", "信号强度(<dBm>", "number");
add_column("dbm", "信号强度(dBm", "number", nullptr, nullptr, 140);
add_column("lla", "位置数据延迟(秒)", "number");
add_column("tmp", "温度(℃)", "number");
add_column("wsp", "风速(节)", "number");
add_column("wdi", "风向(°)", "number");
add_column("mop", "ADS-B协议版本", "number");
add_column("spi", "识别应答(<SPI>", "text");
add_column("spi", "识别应答(SPI", "text");
add_column("alr", "告警状态", "boolean");
add_column("ias", "指示空速(<IAS>", "number");
add_column("tas", "真空速(<TAS>", "number");
add_column("ias", "指示空速(IAS", "number", nullptr, nullptr, 132);
add_column("tas", "真空速(TAS", "number", nullptr, nullptr, 132);
add_column("hdgm", "磁航向", "number");
add_column("hdgt", "真航向", "text");
add_column("qnhs", "气压设定(<QNH>", "text");
add_column("qnhs", "气压设定(QNH", "text", nullptr, nullptr, 140);
add_column("alts", "选择高度", "text");
add_column("hdgs", "选择航向", "number");
add_column("altg", "GNSS椭球高度(英尺)", "number");
add_column("pic", "<Asterix PIC>", "text");
add_column("pic", "Asterix PIC", "text");
add_column("tcm", "防撞系统状态", "text");
add_column("ape", "自动驾驶启用", "text");
add_column("sil", "系统完整性等级(<SIL>", "number");
add_column("sda", "系统设计保证(<SDA>", "text");
add_column("nacp", "位置精度(<NACp>", "number");
add_column("sil", "系统完整性等级(SIL", "number", nullptr, nullptr, 160);
add_column("sda", "系统设计保证(SDA", "text", nullptr, nullptr, 160);
add_column("nacp", "位置精度(NACp", "number", nullptr, nullptr, 150);
add_column("pest", "位置估算次数每秒", "number");
add_column("nocl", "提供数据的接收机数", "number");
add_column("tq", "时间质量", "text");