feat: 天地图瓦片缓存(tile-cache)、拓扑标注助手与文档更新
- tile-cache: 瓦片缓存服务(vec/cva)、启动探针、详细日志、上游超时可配置(UPSTREAM_TIMEOUT_MS) - central: docker-compose 集成 tile-cache,env.example 增加 TILE_CACHE_* / TIANDITU_TK - topology-editor: 天地图/缓存加载、GPS 安全来源错误提示、TIANDITU 文档(403/白名单、localhost 测试说明) - doc: README 部署步骤与 GPS 安全来源说明,TIANDITU_CONFIG 完善 Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -31,13 +31,14 @@ ONVIF_TEMP=$(mktemp)
|
||||
PING_TEMP=$(mktemp)
|
||||
|
||||
# 处理CSV文件(跳过注释行和标题行)
|
||||
tail -n +2 "$CSV_FILE" | grep -v '^#' | while IFS=',' read -r type ip device group network device_type model location username password onvif_port lat lon; do
|
||||
# 列顺序: type,ip,name,role,parent,uplink_type,network,device_type,model,location,username,password,onvif_port,lat,lon
|
||||
tail -n +2 "$CSV_FILE" | grep -v '^#' | while IFS=',' read -r type ip name role parent uplink_type network device_type model location username password onvif_port lat lon; do
|
||||
# 去除空格
|
||||
type=$(echo "$type" | xargs)
|
||||
ip=$(echo "$ip" | xargs)
|
||||
|
||||
# 跳过空行
|
||||
if [ -z "$type" ] || [ -z "$ip" ]; then
|
||||
if [ -z "$type" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
@@ -84,22 +85,34 @@ tail -n +2 "$CSV_FILE" | grep -v '^#' | while IFS=',' read -r type ip device gro
|
||||
|
||||
elif [ "$type" = "ping" ]; then
|
||||
# 处理 Ping 目标
|
||||
device=$(echo "$device" | xargs)
|
||||
group=$(echo "$group" | xargs)
|
||||
device=$(echo "$name" | xargs) # name 作为 device 标签
|
||||
role=$(echo "$role" | xargs)
|
||||
parent=$(echo "$parent" | xargs)
|
||||
uplink_type=$(echo "$uplink_type" | xargs)
|
||||
network=$(echo "$network" | xargs)
|
||||
|
||||
labels="{
|
||||
\"device\": \"$device\""
|
||||
|
||||
if [ -n "$group" ]; then
|
||||
if [ -n "$uplink_type" ]; then
|
||||
labels="$labels,
|
||||
\"group\": \"$group\""
|
||||
\"uplink_type\": \"$uplink_type\""
|
||||
fi
|
||||
|
||||
if [ -n "$network" ]; then
|
||||
labels="$labels,
|
||||
\"network\": \"$network\""
|
||||
fi
|
||||
|
||||
if [ -n "$role" ]; then
|
||||
labels="$labels,
|
||||
\"role\": \"$role\""
|
||||
fi
|
||||
|
||||
if [ -n "$parent" ]; then
|
||||
labels="$labels,
|
||||
\"parent\": \"$parent\""
|
||||
fi
|
||||
|
||||
labels="$labels
|
||||
}"
|
||||
|
||||
Reference in New Issue
Block a user