Repository navigation
Conversation
2 of 3 tasks
Two duplications between code that works on the same data:
- useBot (Threats) and useTraffic (Traffic) each built the same
URL-synced filter state (period, source, host, custom from/to, time
range), the same period presets and the same range/domain-filter logic.
useWebLogsFilters holds it once. The 7-day / 30-day preset labels were
hardcoded French ("7j", "30j") and are now translated.
- useNetwork and NetworkTopologyConfig each implemented port discovery
from container mappings and the per-host port config bootstrap, both
mutating the same v-model'd hostPortConfig array. The logic moves to
utils/networkPorts.ts (typed; useNetwork's copy used `any`).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Rem7474
force-pushed
the
refactor/share-network-port-helpers
branch
from
September 30, 2026 19:31
26988d8 to
7697a99
Compare
|
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
useWebLogsFilters(new): the URL-synced filter state (period, source, host, custom from/to,timeRange), period presets,applyTimeRange()anddetailFilters()thatuseBot(Threats) anduseTraffic(Traffic) each implemented. Fixes the hardcoded French7j/30jpreset labels (security.period7dLabel/period30dLabel).utils/networkPorts.ts(new):buildDiscoveredPortsByHost,ensureHostPortConfig,getHostPortEntry,createDefaultPortSettingand their types — previously duplicated inuseNetwork.ts(untyped) andNetworkTopologyConfig.vue, both mutating the same v-model'dhostPortConfig.handleSearch) stays per page: Threats opens the ban-capable timeline, Traffic the read-only one.Stacked on #430.
Test plan
useWebLogsFilters(URL init, custom/preset ranges, URL mirroring, translated presets) andnetworkPorts(dedup by port+protocol, container-only ports, config bootstrap without overwriting user settings)npm run test,typecheck,lint,lint:i18n🤖 Generated with Claude Code