diff --git a/src/features/nodes/view.ts b/src/features/nodes/view.ts index 66730698..994012d3 100644 --- a/src/features/nodes/view.ts +++ b/src/features/nodes/view.ts @@ -1,5 +1,4 @@ import {isNodeLink} from '../../dae/nodes'; -export {isNodeLink} from '../../dae/nodes'; import type {Capabilities, ConfigSource, HealthObservation, Node, Provider, ProviderCreate} from '../../api/model'; import {enumLabel} from '../../i18n/enum'; import { @@ -220,7 +219,6 @@ export function providerRows(providers: Provider[], nodes: Node[], entries: Subs return {list: [...pseudo, ...rows]}; } -// Null selects loose nodes; built-in outbounds have their own provenance. // The provider the link names while it is listed; a stale one falls back to the first real source, not every node. export function selectedProvider(list: ProviderRow[], requested: string | null): string | null { if (requested !== null && list.some(item => item.id === requested)) return requested; diff --git a/src/features/rules/useRuleEditor.ts b/src/features/rules/useRuleEditor.ts index f8ad647f..7268bcfc 100644 --- a/src/features/rules/useRuleEditor.ts +++ b/src/features/rules/useRuleEditor.ts @@ -12,15 +12,15 @@ import {addRuleReason, addRuleTip, removalView, ruleDraftView, type ReasonKeys, import {useDraftGuard} from '../../shell/draft'; // A rule of either list as the editor needs it: GET /rules and GET /dns/rules entries share these fields. -export type EditedRule = {rule_id: string; kind: 'rule' | 'fallback'; expression: string; source: RuleSource | null}; +type EditedRule = {rule_id: string; kind: 'rule' | 'fallback'; expression: string; source: RuleSource | null}; // An edit starts from the located source condition and the listed target. -export type Opened = {kind: 'add'; preset?: RuleSeed} | {kind: 'remove'; rule: R} | {kind: 'edit'; rule: R; outbound: string; must: boolean}; +type Opened = {kind: 'add'; preset?: RuleSeed} | {kind: 'remove'; rule: R} | {kind: 'edit'; rule: R; outbound: string; must: boolean}; type Dialog = Opened & { generation: string; sources: ConfigSource[]; rules: R[]; }; -export type RuleForm = {condition: string; outbound: string; must: boolean; before: string}; +type RuleForm = {condition: string; outbound: string; must: boolean; before: string}; export type RuleEditorModel = { canWrite: boolean; busy: boolean; @@ -46,7 +46,7 @@ export type RuleEditorModel = { // Why the switch back to Select was refused, shown under the expression. expressionHint: string | null; }; -export type RuleEditorOptions = { +type RuleEditorOptions = { canWrite: boolean; // The listed rules and the configuration they were read with; an edit needs both from one generation. list: {rules: R[]; generation_id: string} | undefined; diff --git a/src/features/rules/useRuleTemplates.ts b/src/features/rules/useRuleTemplates.ts index 093967a3..5925d863 100644 --- a/src/features/rules/useRuleTemplates.ts +++ b/src/features/rules/useRuleTemplates.ts @@ -38,7 +38,6 @@ import { // If-Match names, so a change on disk since is refused rather than overwritten. `withDns` is the same write with the // DNS split appended, offered while the configuration has no `dns` block. type Pending = { - options: TemplateOptions; optionImpact: string[]; choice: TemplateChoice; source: ConfigSource; @@ -159,7 +158,6 @@ export function useRuleTemplates({go, query}: PageProps): RuleTemplatesModel { setAddDns(true); setInvalid(null); setDialog({ - options, optionImpact: templateOptionKeys .filter(key => view.current && options[key] !== view[key]) .map(key => t(templateOptionText[key][options[key] ? 'on' : 'off'])), @@ -176,7 +174,6 @@ export function useRuleTemplates({go, query}: PageProps): RuleTemplatesModel { }); }, dialog: dialog && { - options: dialog.options, optionImpact: dialog.optionImpact, choice: dialog.choice, source: dialog.source, diff --git a/src/features/rules/useTraceForm.ts b/src/features/rules/useTraceForm.ts index 01ee7287..4d87367a 100644 --- a/src/features/rules/useTraceForm.ts +++ b/src/features/rules/useTraceForm.ts @@ -14,7 +14,7 @@ const blankForm = { pname: '', dscp: '', mark: '', - // Null until the backend says what it offers: live when it can resolve, else none. + // Null keeps resolution automatic: live or DNS query for a domain when offered, otherwise none. resolve: null as TraceResolve | null }; // Held by the rules page rather than the trace tab, so what was typed survives a tab switch. A link that names a diff --git a/src/features/shared/limitCauses.ts b/src/features/shared/limitCauses.ts index 6ce7c008..34576682 100644 --- a/src/features/shared/limitCauses.ts +++ b/src/features/shared/limitCauses.ts @@ -2,7 +2,7 @@ import {configManagement, engineOf, type EngineAction, type EngineReason} from ' import type {Capabilities, RuntimeSettings, Version} from '../../api/model'; // The resources the overview's feature list shows, in its order. -export const limitResources = [ +const limitResources = [ 'connections', 'flows', 'routing_trace', @@ -28,7 +28,7 @@ const unlisted = ['dns_rules', 'reload', 'suspend', 'resume'] as const; export type LimitId = Resource | (typeof unlisted)[number] | EngineAction; // Why features are off, in the order the overview lists them. -export const limitCauses = [ +const limitCauses = [ 'configNotLoaded', 'configReadOnly', 'mainReadOnly', @@ -42,7 +42,7 @@ export const limitCauses = [ 'notProvided' ] as const; export type LimitCause = (typeof limitCauses)[number]; -export type LimitClass = {cause: LimitCause; ids: LimitId[]}; +type LimitClass = {cause: LimitCause; ids: LimitId[]}; // The group a resource that is off joins by the engine's reason; one the engine gives no such reason for is not // provided, or, for flows that are off, idle. diff --git a/src/features/shared/link.ts b/src/features/shared/link.ts index 4277b67c..b10fff22 100644 --- a/src/features/shared/link.ts +++ b/src/features/shared/link.ts @@ -29,7 +29,7 @@ export function outboundTag(name: string | null, groups: ReadonlyArray<{id: stri // The routing trace with its form filled in from a link: the target, and the source and process when the link knows // them. The person runs the trace. -export type TraceLink = {network: 'tcp' | 'udp'; domain: string; dst_ip: string; dst_port: string; src_ip: string; src_port: string; pname: string}; +type TraceLink = {network: 'tcp' | 'udp'; domain: string; dst_ip: string; dst_port: string; src_ip: string; src_port: string; pname: string}; const traceKeys = ['network', 'domain', 'dst_ip', 'dst_port', 'src_ip', 'src_port', 'pname'] as const; export const traceQuery = (link: Partial) => within('', {tab: 'trace', ...Object.fromEntries(traceKeys.map(key => [key, link[key] || null]))}); // Null when the link names no target, so a plain visit to the tab keeps what was typed. diff --git a/src/features/shared/rule.ts b/src/features/shared/rule.ts index 7bcbdf9c..0f24b2d8 100644 --- a/src/features/shared/rule.ts +++ b/src/features/shared/rule.ts @@ -55,7 +55,7 @@ export const answerAddresses = (answers: ReadonlyArray answer.type === 'A' || answer.type === 'AAAA').map(answer => answer.data)) ]; -export type RuleTarget = {kind: RuleConditionKind; condition: string}; +type RuleTarget = {kind: RuleConditionKind; condition: string}; // Every condition the seed allows in a list, the default first, each address as one host; a value dae cannot hold is // left out. Routing: the exact domain, then its subdomains and keyword, the destination IP and the source IP. A DNS request: the // exact name, then its subdomains, and the client. A DNS response: each answered address, and the client. @@ -156,7 +156,7 @@ export function acceptedRule(rules: RoutingRule[], condition: string, outbound: } // A listed rule as the duplicate notice compares it: its condition, and what it writes after its arrow. -export type ListedTarget = {kind: 'rule' | 'fallback'; index: number; expression: string; target: string}; +type ListedTarget = {kind: 'rule' | 'fallback'; index: number; expression: string; target: string}; // Where the list already holds a rule with this condition and target, or a rule held for it does, as the dialog says // it; null when neither does. The accepted rule is named first, since it already applies. DNS upstream names compare // without regard to case, as honk resolves them. diff --git a/src/features/shared/usePendingApply.ts b/src/features/shared/usePendingApply.ts index 8e885468..3b4c309b 100644 --- a/src/features/shared/usePendingApply.ts +++ b/src/features/shared/usePendingApply.ts @@ -9,7 +9,7 @@ import {byFile, failureToast, insertRules, partialFailure, ruleFailure} from './ import {ruleWritten} from './ruleNotice'; // How many rules reached their files, and the failure that stopped the rest, if any. -export type ApplyOutcome = {written: number; failure: PendingFailure | null}; +type ApplyOutcome = {written: number; failure: PendingFailure | null}; type FileOutcome = {written: boolean; failure: PendingFailure | null}; const reread = () => void refetchAll();