addCssFile('modules/WecomCenter/assets/l2topology/style.css?v=20261108'); $base = '/modules/WecomCenter/assets/l2topology/'; $snapJson = (string) ($data['snap_json'] ?? 'null'); $cfgJson = (string) ($data['cfg_json'] ?? '{}'); $snapSafe = str_replace('', '<\/', $snapJson); $cfgSafe = str_replace('', '<\/', $cfgJson); $i18nKeys = [ 'l2.title','l2.search_ph','l2.show_term','l2.only_off','l2.auto_refresh','l2.min', 'l2.refresh_now','l2.fit','l2.alarms','l2.offline','l2.time_live','l2.time_btn', 'l2.time_label','l2.no_data','l2.offline_empty','l2.alarm_empty','l2.updated', 'l2.pause','l2.resume','l2.legend_speed','l2.legend_tier','l2.legend_lat','l2.core','l2.main','l2.dist','l2.access', 'l2.lat_norm','l2.term_on','l2.term_off','l2.term_title','l2.term_mac','l2.term_rate','l2.term_switch','l2.term_port','l2.term_ip','l2.zoom_in','l2.zoom_out','l2.snapshot','l2.showing','l2.live_tag', 'l2.unit_sw','l2.tile_hint','l2.not_in_topo','l2.click_hint','l2.floor_na', 'l2.net_surve','l2.net_office','l2.net_other', 'l2.terminals','l2.offline_short','l2.last_online','l2.history','l2.history_live', 'l2.history_live_hint','l2.history_empty' ]; $i18n = []; foreach ($i18nKeys as $k) { $i18n[$k] = I18n::t($k); } $i18nJson = str_replace('', '<\/', json_encode($i18n, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES)); $hist = $data['history'] ?? []; $isLive = !empty($data['is_live']); $usedTs = (int) ($data['used_ts'] ?? 0); $tsOpts = ''; foreach ($hist as $h) { $sel = (!$isLive && $usedTs === (int) $h['ts']) ? ' selected' : ''; $tsOpts .= ''; } $refreshSec = (int) ($data['cfg_refresh'] ?? 300); if (!function_exists('l2e')) { function l2e($v) { return htmlspecialchars((string) $v, ENT_QUOTES, 'UTF-8'); } } ?>