From 3fea4a972af543bb559a13ba0cd9a666371a2660 Mon Sep 17 00:00:00 2001 From: swpa Date: Wed, 13 May 2026 18:31:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=B0=8E=E5=85=A5=20SSE=20=E4=B8=B2?= =?UTF-8?q?=E6=B5=81=E6=A9=9F=E5=88=B6=E8=88=87=20API=20=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E6=A8=99=E6=BA=96=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. 實作 StreamingResponse 即時回傳爬蟲進度。2. 新增 IS_SCANNING 全域變數防止併發掃描。3. 統一 main.py 路由前綴,修復心跳機制 404 錯誤。 --- cmts_leaf_options_cache.json | 9485 +++++++++++++++++++++++++++++++++- cmts_scraper.py | 20 +- main.py | 14 +- routers/leaf_options.py | 113 +- routers/lock.py | 3 +- static/api.js | 37 + static/app.js | 91 +- 7 files changed, 9557 insertions(+), 206 deletions(-) diff --git a/cmts_leaf_options_cache.json b/cmts_leaf_options_cache.json index e65c821..6c7fb5f 100644 --- a/cmts_leaf_options_cache.json +++ b/cmts_leaf_options_cache.json @@ -6,13 +6,6 @@ "current_value": null, "updated_at": 1778217240 }, - "clock": { - "hint": "Possible completions:\ntimezone", - "options": [], - "type": "string_or_number", - "current_value": null, - "updated_at": 1778217229 - }, "cable": { "hint": "Possible completions:\naqm-global Enable/disable AQM globally\naqm-global-ds Enable/disable DS AQM globally\naqm-global-us Enable/disable US AQM globally\nasf-qos-profile\naux-core The Auxiliary cores\nbpi-enforce\nbundle\ncm-status CM-STATUS Configuration\ncmts-steering\ncore-type Core type configuration sub menue\nds-channel-admission-control-profile Downstream admission control profile configuration\nds-phy-profile\nds-rf-port\ndsg\ndsi Configure dsi sub-configuration\ndynamic-secret\nevent\nfdx-rba-schedule\nfdx-resource\nfiber-node Add or change configuration for a fiber-node\nfilter\nflap-list\n\u001b[7m--More--\u001b[27m\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b freq-range\ngcp\nl2vpn\nlawful-intercept\nload-balance\nmac-address\nmac-domain\nmac-domain-address-oui MAC domain OUI, XX:XX:XX\nmcast Configure multicast global configuration\nmd-downstream-qos-profile Downstream QOS profile\nmd-upstream-qos-profile Upstream QOS profile\nmod-prof-ofdma\nmodem\nmodulation-profile\nmtu-enhance\nndf-rf-port\nndr-rf-port\nnit-replace NIT replace profile\nofdm-guard-band\nofdma-ucd-refresh Preserve/Increase OFDMA UCD Config Change Count on UCD refresh\noob-core The OOB Core ID\noob-dest The OOB Destination ID\noudp-leakage Enable OUDP-leakage feature.\n\u001b[7m--More--\u001b[27m\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b privacy\nproto-throttle Protocol throttling\nprovisioning\nproxy-arp\nproxy-nd\nptp\nrcp\nrip\nrpd Remote Phy Device\nrpn\nscn-restrict\nservice-class\nservice-flow\nservice-group\nsid-allocation\nsource-verify\nssh-public-key\nsub-bundle\nsubmgmt\nsyslog-rpd-cfg Syslog configuration\ntag The tags for TLV type matching rule are created and configured in this section\ntemplate\nus-channel-admission-control-profile Upstream admission control profile configuration\n\u001b[7m--More--\u001b[27m\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b us-ext-port\nus-rf-port\nus-scheduler\nutilization-interval-sec Configuration of the period of utilization calculation (in seconds)", "options": [], @@ -98715,13 +98708,6 @@ "current_value": "enabled", "updated_at": 1778469843 }, - "hostname": { - "hint": "Possible completions:\n[SERCOMM-COS-02]", - "options": [], - "type": "string_or_number", - "current_value": "SERCOMM-COS-02", - "updated_at": 1778469880 - }, "cable mac-domain 13:0/0.0 map-advance extra-usec": { "hint": "Description: Map Advance Algorithm Delay\nPossible completions:\n[100]", "options": [], @@ -99022,13 +99008,6 @@ "current_value": "show cluster server", "updated_at": 1778486476 }, - "no": { - "hint": "Possible completions:\naaa COS AAA\nalias Create command alias.\nbanner Customize text messagees (banners) which are to be displayed before login/pass prompt\ncli Global CLI configuration\nclock\nhostname Hostname for CableOS Server Cluster\ninterface Configuration of PON and Ethernet networks\nipdr\nlogging Logging sub configuration\nnetwork\nprivilege\nradius-server\nsnmp\nsnmp-server\nspanning-tree\nssh Configure SSH access to CLI\nsystem\ntacacs-server\nusername Establish a username-based authentication system\n---\nservice Modify use of network based services\n\u001b[7m--More--\u001b[27m\b\b\b\b\b\b\b\b \b\b\b\b\b\b\b\b ", - "options": [], - "type": "string_or_number", - "current_value": null, - "updated_at": 1778489033 - }, "cable mac-domain 13:0/0.0 shared-secret": { "hint": "Description: shared-secret {0 | 7}\nPossible completions:\n[7] ", "options": [], @@ -99053,13 +99032,6 @@ "current_value": "disabled", "updated_at": 1778566706 }, - "logging buffered": { - "hint": "Possible completions:\nseverity size-mb", - "options": [], - "type": "string_or_number", - "current_value": null, - "updated_at": 1778570349 - }, "cable rip": { "hint": "Possible completions:\nallow-subnet Allowed subnets for RIP routes\nauthentication", "options": [], @@ -99095,53 +99067,6 @@ "current_value": "10", "updated_at": 1778582997 }, - "logging evt 1024 description": { - "hint": "Description: Enter a meaningful description\nPossible completions:\n[Cold Start]", - "options": [], - "type": "string_or_number", - "current_value": "Cold Start", - "updated_at": 1778643770 - }, - "logging evt 1024 name": { - "hint": "Description: Short Description\nPossible completions:\n[cold-start]", - "options": [], - "type": "string_or_number", - "current_value": "cold-start", - "updated_at": 1778644476 - }, - "logging evt 1024 priority": { - "hint": "Description: Event Priority\nPossible completions:\n[notice] alert critical debug emergency error information notice warning", - "options": [ - "alert", - "critical", - "debug", - "emergency", - "error", - "information", - "notice", - "warning" - ], - "type": "list", - "current_value": "notice", - "updated_at": 1778644476 - }, - "logging evt 1024 active": { - "hint": "Description: Enable/Disable the event\nPossible completions:\n[enabled] disabled enabled", - "options": [ - "disabled", - "enabled" - ], - "type": "list", - "current_value": "enabled", - "updated_at": 1778644476 - }, - "logging evt 1024 destination": { - "hint": "Description: Event destination \nPossible completions:\n[]", - "options": [], - "type": "string_or_number", - "current_value": null, - "updated_at": 1778644476 - }, "radius-server timeout": { "hint": "Possible completions:\n[5]", "options": [], @@ -99183,5 +99108,9415 @@ "type": "string_or_number", "current_value": "\\u@SERCOMM-COS-02>", "updated_at": 1778654885 + }, + "cli prompt2": { + "hint": "Description: Prompt for configure mode\nPossible completions:\n[\\u@SERCOMM-COS-02\\M# ]", + "options": [], + "type": "string_or_number", + "current_value": "\\u@SERCOMM-COS-02\\M#", + "updated_at": 1778657974 + }, + "snmp-server": { + "hint": "Description: Administrative state of the snmp-server\nPossible completions:\n[enabled] access-list community community-encryption contact disabled enable enabled engineID group host informs location monitor name user view", + "options": [ + "access-list", + "community", + "community-encryption", + "contact", + "disabled", + "enable", + "enabled", + "engineID", + "group", + "host", + "informs", + "location", + "monitor", + "name", + "user", + "view" + ], + "type": "list", + "current_value": "enabled", + "updated_at": 1778658084 + }, + "ipdr exporter": { + "hint": "Possible completions:\n[disabled]\nack-timeout-secs Acknowledged records timeout count.\nconnection\ndisabled\nenabled\nkeep-alive-secs Keepalive timer count.\nmax-unacked Number of unacknowledged records.", + "options": [ + "ack-timeout-secs", + "connection", + "disabled", + "enabled", + "keep-alive-secs", + "max-unacked" + ], + "type": "list", + "current_value": "disabled", + "updated_at": 1778658116 + }, + "privilege 0 password": { + "hint": "Description: The password for enable the level\nPossible completions:\n[$1$W4MeEvQ9$eSZE3/3U5JIAUrWXTJurz.]", + "options": [], + "type": "string_or_number", + "current_value": "$1$W4MeEvQ9$eSZE3/3U5JIAUrWXTJurz.", + "updated_at": 1778662687 + }, + "privilege 1 password": { + "hint": "Description: The password for enable the level\nPossible completions:\n[$1$W4MeEvQ9$eSZE3/3U5JIAUrWXTJurz.]", + "options": [], + "type": "string_or_number", + "current_value": "$1$W4MeEvQ9$eSZE3/3U5JIAUrWXTJurz.", + "updated_at": 1778662687 + }, + "privilege 15 password": { + "hint": "Description: The password for enable the level\nPossible completions:\n[$1$W4MeEvQ9$eSZE3/3U5JIAUrWXTJurz.]", + "options": [], + "type": "string_or_number", + "current_value": "$1$W4MeEvQ9$eSZE3/3U5JIAUrWXTJurz.", + "updated_at": 1778662687 + }, + "system proto-throttle total rate-pps": { + "hint": "Possible completions:\n[5000]", + "options": [], + "type": "string_or_number", + "current_value": "5000", + "updated_at": 1778662752 + }, + "system proto-throttle total max-burst-pkts": { + "hint": "Possible completions:\n[500]", + "options": [], + "type": "string_or_number", + "current_value": "500", + "updated_at": 1778662752 + }, + "system proto-throttle other rate-pps": { + "hint": "Possible completions:\n[500]", + "options": [], + "type": "string_or_number", + "current_value": "500", + "updated_at": 1778662752 + }, + "system proto-throttle other max-burst-pkts": { + "hint": "Possible completions:\n[100]", + "options": [], + "type": "string_or_number", + "current_value": "100", + "updated_at": 1778662752 + }, + "system proto-throttle arp rate-pps": { + "hint": "Possible completions:\n[2500]", + "options": [], + "type": "string_or_number", + "current_value": "2500", + "updated_at": 1778662752 + }, + "system proto-throttle arp max-burst-pkts": { + "hint": "Possible completions:\n[500]", + "options": [], + "type": "string_or_number", + "current_value": "500", + "updated_at": 1778662752 + }, + "system proto-throttle dhcp rate-pps": { + "hint": "Possible completions:\n[500]", + "options": [], + "type": "string_or_number", + "current_value": "500", + "updated_at": 1778662752 + }, + "system proto-throttle dhcp max-burst-pkts": { + "hint": "Possible completions:\n[250]", + "options": [], + "type": "string_or_number", + "current_value": "250", + "updated_at": 1778662752 + }, + "system proto-throttle dhcpv6 rate-pps": { + "hint": "Possible completions:\n[500]", + "options": [], + "type": "string_or_number", + "current_value": "500", + "updated_at": 1778662752 + }, + "system proto-throttle dhcpv6 max-burst-pkts": { + "hint": "Possible completions:\n[250]", + "options": [], + "type": "string_or_number", + "current_value": "250", + "updated_at": 1778662752 + }, + "system proto-throttle nd rate-pps": { + "hint": "Possible completions:\n[2500]", + "options": [], + "type": "string_or_number", + "current_value": "2500", + "updated_at": 1778662752 + }, + "system proto-throttle nd max-burst-pkts": { + "hint": "Possible completions:\n[500]", + "options": [], + "type": "string_or_number", + "current_value": "500", + "updated_at": 1778662752 + }, + "system proto-throttle rip rate-pps": { + "hint": "Possible completions:\n[100]", + "options": [], + "type": "string_or_number", + "current_value": "100", + "updated_at": 1778662752 + }, + "system proto-throttle rip max-burst-pkts": { + "hint": "Possible completions:\n[50]", + "options": [], + "type": "string_or_number", + "current_value": "50", + "updated_at": 1778662752 + }, + "system public-services ip-address": { + "hint": "Description: Public services interface IPv4 address\nPossible completions:\n[10.14.23.4]", + "options": [], + "type": "string_or_number", + "current_value": "10.14.23.4", + "updated_at": 1778662752 + }, + "system public-services ip-gw-address": { + "hint": "Description: Public services interface gateway IPv4 address\nPossible completions:\n[10.14.23.1/24]", + "options": [], + "type": "string_or_number", + "current_value": "10.14.23.1/24", + "updated_at": 1778662752 + }, + "system public-services ipv6-address": { + "hint": "Description: Public services interface IPv6 address\nPossible completions:\n[2001:50:5:23::4]", + "options": [], + "type": "string_or_number", + "current_value": "2001:50:5:23::4", + "updated_at": 1778662752 + }, + "system public-services ipv6-gw-address": { + "hint": "Description: Public services interface gateway IPv6 address\nPossible completions:\n[2001:50:5:23::1/64]", + "options": [], + "type": "string_or_number", + "current_value": "2001:50:5:23::1/64", + "updated_at": 1778662752 + }, + "system public-services vlan-id": { + "hint": "Description: Public services interface vlan id\nPossible completions:\n[110]", + "options": [], + "type": "string_or_number", + "current_value": "110", + "updated_at": 1778662752 + }, + "system scep admin-state": { + "hint": "Description: Scep Administrative State [default down]\nPossible completions:\n[down] down up", + "options": [ + "down", + "up" + ], + "type": "list", + "current_value": "down", + "updated_at": 1778662752 + }, + "system scep fingerprint": { + "hint": "Description: CA fingerprint\nPossible completions:\n[]", + "options": [], + "type": "string_or_number", + "current_value": null, + "updated_at": 1778662752 + }, + "system scep number-certs": { + "hint": "Description: Scep certificates chain size (1-4)\nPossible completions:\n[4]", + "options": [], + "type": "string_or_number", + "current_value": "4", + "updated_at": 1778662752 + }, + "system scep server": { + "hint": "Description: server URL\nPossible completions:\n[http://127.0.0.1:80/scep]", + "options": [], + "type": "string_or_number", + "current_value": "http://127.0.0.1:80/scep", + "updated_at": 1778662752 + }, + "system scep timeout": { + "hint": "Description: timeout value\nPossible completions:\n[1000]", + "options": [], + "type": "string_or_number", + "current_value": "1000", + "updated_at": 1778662752 + }, + "system scep cnf": { + "hint": "Description: CNF filepath\nPossible completions:\n[default.cnf]", + "options": [], + "type": "string_or_number", + "current_value": "default.cnf", + "updated_at": 1778662752 + }, + "system scep renew": { + "hint": "Description: Renew days count\nPossible completions:\n[30]", + "options": [], + "type": "string_or_number", + "current_value": "30", + "updated_at": 1778662752 + }, + "system scep common-name": { + "hint": "Description: Common name\nPossible completions:\n[common_name]", + "options": [], + "type": "string_or_number", + "current_value": "common_name", + "updated_at": 1778662752 + }, + "system proto-filter": { + "hint": "Possible completions:\nds-broadcast", + "options": [], + "type": "string_or_number", + "current_value": null, + "updated_at": 1778662752 + }, + "system cluster": { + "hint": "Possible completions:\nserver-count", + "options": [], + "type": "string_or_number", + "current_value": null, + "updated_at": 1778662752 + }, + "system server-cpu-core-count": { + "hint": "Possible completions:\n[24]", + "options": [], + "type": "string_or_number", + "current_value": "24", + "updated_at": 1778662752 + }, + "system tftp watchdog control": { + "hint": "Description: Enable/disable tftp watchdog\nPossible completions:\n[disabled] disabled enabled", + "options": [ + "disabled", + "enabled" + ], + "type": "list", + "current_value": "disabled", + "updated_at": 1778662777 + }, + "system tftp watchdog restart-timeout": { + "hint": "Description: This attribute specifies the number of seconds to wait before restarting the TFTP client.\nPossible completions:\n[600]", + "options": [], + "type": "string_or_number", + "current_value": "600", + "updated_at": 1778662777 + }, + "system tftp watchdog max-completion-time": { + "hint": "Description: This attribute specifies the maximum number of seconds the TFTP client is allowed to complete all download requests.\nPossible completions:\n[2000]", + "options": [], + "type": "string_or_number", + "current_value": "2000", + "updated_at": 1778662777 + }, + "system management ip-address": { + "hint": "Description: COS manager IPv4 address\nPossible completions:\n[10.14.110.4]", + "options": [], + "type": "string_or_number", + "current_value": "10.14.110.4", + "updated_at": 1778662777 + }, + "system management ip-gw-address": { + "hint": "Description: COS manager gateway IPv4 address\nPossible completions:\n[10.14.110.1/24]", + "options": [], + "type": "string_or_number", + "current_value": "10.14.110.1/24", + "updated_at": 1778662777 + }, + "system management mtu": { + "hint": "Description: COS manager interface MTU\nPossible completions:\n[1500]", + "options": [], + "type": "string_or_number", + "current_value": "1500", + "updated_at": 1778662777 + }, + "system management sonar-service": { + "hint": "Description: Enable/Disable sonar agent service\nPossible completions:\n[disabled]\ndisabled\nenabled\npassword Password for sonar user", + "options": [ + "disabled", + "enabled", + "password" + ], + "type": "list", + "current_value": "disabled", + "updated_at": 1778662777 + }, + "system management snmp": { + "hint": "Possible completions:\nfast-counters Enable snmp fast-counters", + "options": [], + "type": "string_or_number", + "current_value": null, + "updated_at": 1778662777 + }, + "system management cli-devel-log": { + "hint": "Description: Enable/Disable confd developer's logging\nPossible completions:\n[enabled]\ndisabled\nenabled\nseverity To choose severity for logging", + "options": [ + "disabled", + "enabled", + "severity" + ], + "type": "list", + "current_value": "enabled", + "updated_at": 1778662777 + }, + "system management cli-devel-log severity": { + "hint": "Description: To choose severity for logging\nPossible completions:\n[info] error info trace", + "options": [ + "error", + "info", + "trace" + ], + "type": "list", + "current_value": "info", + "updated_at": 1778662777 + }, + "system management sshd": { + "hint": "Possible completions:\ninsecure-mode Enable/Disable sshd insecure ssh algorithm parameters", + "options": [], + "type": "string_or_number", + "current_value": null, + "updated_at": 1778662777 + }, + "system ipsec tunnel admin-state": { + "hint": "Description: Administrative State of IPsec tunnel [default down]\nPossible completions:\n[down] down up", + "options": [ + "down", + "up" + ], + "type": "list", + "current_value": "down", + "updated_at": 1778662777 + }, + "system ipsec tunnel dscp": { + "hint": "Possible completions:\n AF11 AF12 AF13 AF21 AF22 AF23 AF31 AF32 AF33 AF41 AF42 AF43 CS1 CS2 CS3 CS4 CS5 CS6 CS7 EF default", + "options": [], + "type": "string_or_number", + "current_value": null, + "updated_at": 1778662777 + }, + "ipdr exporter keep-alive-secs": { + "hint": "Description: Keepalive timer count.\nPossible completions:\n[300]", + "options": [], + "type": "string_or_number", + "current_value": "300", + "updated_at": 1778662816 + }, + "ipdr exporter ack-timeout-secs": { + "hint": "Description: Acknowledged records timeout count.\nPossible completions:\n[60]", + "options": [], + "type": "string_or_number", + "current_value": "60", + "updated_at": 1778662816 + }, + "ipdr exporter max-unacked": { + "hint": "Description: Number of unacknowledged records.\nPossible completions:\n[200]", + "options": [], + "type": "string_or_number", + "current_value": "200", + "updated_at": 1778662816 + }, + "ipdr exporter connection": { + "hint": "Possible completions:\n[accept] accept initiate", + "options": [ + "accept", + "initiate" + ], + "type": "list", + "current_value": "accept", + "updated_at": 1778662816 + }, + "snmp-server engineID": { + "hint": "Possible completions:\nlocal", + "options": [], + "type": "string_or_number", + "current_value": null, + "updated_at": 1778662835 + }, + "snmp-server informs timeout": { + "hint": "Possible completions:\n