mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
chore: Re-enable no-redundant-type-constituents rule.
This commit is contained in:
@@ -15,7 +15,6 @@
|
|||||||
"oxc/no-async-endpoint-handlers": "off",
|
"oxc/no-async-endpoint-handlers": "off",
|
||||||
"oxc/no-map-spread": "off",
|
"oxc/no-map-spread": "off",
|
||||||
"typescript/no-extraneous-class": "off",
|
"typescript/no-extraneous-class": "off",
|
||||||
"typescript/no-redundant-type-constituents": "off",
|
|
||||||
"typescript/no-unnecessary-template-expression": "off",
|
"typescript/no-unnecessary-template-expression": "off",
|
||||||
"typescript/no-unsafe-type-assertion": "off",
|
"typescript/no-unsafe-type-assertion": "off",
|
||||||
"unicorn/consistent-function-scoping": "off",
|
"unicorn/consistent-function-scoping": "off",
|
||||||
|
|||||||
@@ -80,7 +80,7 @@ export type AppViewState = {
|
|||||||
configApplying: boolean;
|
configApplying: boolean;
|
||||||
updateRunning: boolean;
|
updateRunning: boolean;
|
||||||
configSnapshot: ConfigSnapshot | null;
|
configSnapshot: ConfigSnapshot | null;
|
||||||
configSchema: unknown | null;
|
configSchema: unknown;
|
||||||
configSchemaLoading: boolean;
|
configSchemaLoading: boolean;
|
||||||
configUiHints: Record<string, unknown>;
|
configUiHints: Record<string, unknown>;
|
||||||
configForm: Record<string, unknown> | null;
|
configForm: Record<string, unknown> | null;
|
||||||
@@ -130,7 +130,7 @@ export type AppViewState = {
|
|||||||
debugStatus: StatusSummary | null;
|
debugStatus: StatusSummary | null;
|
||||||
debugHealth: HealthSnapshot | null;
|
debugHealth: HealthSnapshot | null;
|
||||||
debugModels: unknown[];
|
debugModels: unknown[];
|
||||||
debugHeartbeat: unknown | null;
|
debugHeartbeat: unknown;
|
||||||
debugCallMethod: string;
|
debugCallMethod: string;
|
||||||
debugCallParams: string;
|
debugCallParams: string;
|
||||||
debugCallResult: string | null;
|
debugCallResult: string | null;
|
||||||
|
|||||||
@@ -164,7 +164,7 @@ export class OpenClawApp extends LitElement {
|
|||||||
@state() updateRunning = false;
|
@state() updateRunning = false;
|
||||||
@state() applySessionKey = this.settings.lastActiveSessionKey;
|
@state() applySessionKey = this.settings.lastActiveSessionKey;
|
||||||
@state() configSnapshot: ConfigSnapshot | null = null;
|
@state() configSnapshot: ConfigSnapshot | null = null;
|
||||||
@state() configSchema: unknown | null = null;
|
@state() configSchema: unknown = null;
|
||||||
@state() configSchemaVersion: string | null = null;
|
@state() configSchemaVersion: string | null = null;
|
||||||
@state() configSchemaLoading = false;
|
@state() configSchemaLoading = false;
|
||||||
@state() configUiHints: ConfigUiHints = {};
|
@state() configUiHints: ConfigUiHints = {};
|
||||||
@@ -225,7 +225,7 @@ export class OpenClawApp extends LitElement {
|
|||||||
@state() debugStatus: StatusSummary | null = null;
|
@state() debugStatus: StatusSummary | null = null;
|
||||||
@state() debugHealth: HealthSnapshot | null = null;
|
@state() debugHealth: HealthSnapshot | null = null;
|
||||||
@state() debugModels: unknown[] = [];
|
@state() debugModels: unknown[] = [];
|
||||||
@state() debugHeartbeat: unknown | null = null;
|
@state() debugHeartbeat: unknown = null;
|
||||||
@state() debugCallMethod = "";
|
@state() debugCallMethod = "";
|
||||||
@state() debugCallParams = "{}";
|
@state() debugCallParams = "{}";
|
||||||
@state() debugCallResult: string | null = null;
|
@state() debugCallResult: string | null = null;
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export type ConfigState = {
|
|||||||
configApplying: boolean;
|
configApplying: boolean;
|
||||||
updateRunning: boolean;
|
updateRunning: boolean;
|
||||||
configSnapshot: ConfigSnapshot | null;
|
configSnapshot: ConfigSnapshot | null;
|
||||||
configSchema: unknown | null;
|
configSchema: unknown;
|
||||||
configSchemaVersion: string | null;
|
configSchemaVersion: string | null;
|
||||||
configSchemaLoading: boolean;
|
configSchemaLoading: boolean;
|
||||||
configUiHints: ConfigUiHints;
|
configUiHints: ConfigUiHints;
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ export type DebugState = {
|
|||||||
debugStatus: StatusSummary | null;
|
debugStatus: StatusSummary | null;
|
||||||
debugHealth: HealthSnapshot | null;
|
debugHealth: HealthSnapshot | null;
|
||||||
debugModels: unknown[];
|
debugModels: unknown[];
|
||||||
debugHeartbeat: unknown | null;
|
debugHeartbeat: unknown;
|
||||||
debugCallMethod: string;
|
debugCallMethod: string;
|
||||||
debugCallParams: string;
|
debugCallParams: string;
|
||||||
debugCallResult: string | null;
|
debugCallResult: string | null;
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import { analyzeConfigSchema, renderNode, schemaType, type JsonSchema } from "./
|
|||||||
type ChannelConfigFormProps = {
|
type ChannelConfigFormProps = {
|
||||||
channelId: string;
|
channelId: string;
|
||||||
configValue: Record<string, unknown> | null;
|
configValue: Record<string, unknown> | null;
|
||||||
schema: unknown | null;
|
schema: unknown;
|
||||||
uiHints: ConfigUiHints;
|
uiHints: ConfigUiHints;
|
||||||
disabled: boolean;
|
disabled: boolean;
|
||||||
onPatch: (path: Array<string | number>, value: unknown) => void;
|
onPatch: (path: Array<string | number>, value: unknown) => void;
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export type ChannelsProps = {
|
|||||||
whatsappQrDataUrl: string | null;
|
whatsappQrDataUrl: string | null;
|
||||||
whatsappConnected: boolean | null;
|
whatsappConnected: boolean | null;
|
||||||
whatsappBusy: boolean;
|
whatsappBusy: boolean;
|
||||||
configSchema: unknown | null;
|
configSchema: unknown;
|
||||||
configSchemaLoading: boolean;
|
configSchemaLoading: boolean;
|
||||||
configForm: Record<string, unknown> | null;
|
configForm: Record<string, unknown> | null;
|
||||||
configUiHints: ConfigUiHints;
|
configUiHints: ConfigUiHints;
|
||||||
|
|||||||
@@ -132,7 +132,7 @@ export function renderNode(params: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check if it's a set of literal values (enum-like)
|
// Check if it's a set of literal values (enum-like)
|
||||||
const extractLiteral = (v: JsonSchema): unknown | undefined => {
|
const extractLiteral = (v: JsonSchema): unknown => {
|
||||||
if (v.const !== undefined) {
|
if (v.const !== undefined) {
|
||||||
return v.const;
|
return v.const;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ export type ConfigProps = {
|
|||||||
applying: boolean;
|
applying: boolean;
|
||||||
updating: boolean;
|
updating: boolean;
|
||||||
connected: boolean;
|
connected: boolean;
|
||||||
schema: unknown | null;
|
schema: unknown;
|
||||||
schemaLoading: boolean;
|
schemaLoading: boolean;
|
||||||
uiHints: ConfigUiHints;
|
uiHints: ConfigUiHints;
|
||||||
formMode: "form" | "raw";
|
formMode: "form" | "raw";
|
||||||
@@ -450,12 +450,23 @@ export function renderConfig(props: ConfigProps) {
|
|||||||
<aside class="config-sidebar">
|
<aside class="config-sidebar">
|
||||||
<div class="config-sidebar__header">
|
<div class="config-sidebar__header">
|
||||||
<div class="config-sidebar__title">Settings</div>
|
<div class="config-sidebar__title">Settings</div>
|
||||||
<span class="pill pill--sm ${validity === "valid" ? "pill--ok" : validity === "invalid" ? "pill--danger" : ""}">${validity}</span>
|
<span
|
||||||
|
class="pill pill--sm ${
|
||||||
|
validity === "valid" ? "pill--ok" : validity === "invalid" ? "pill--danger" : ""
|
||||||
|
}"
|
||||||
|
>${validity}</span
|
||||||
|
>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Search -->
|
<!-- Search -->
|
||||||
<div class="config-search">
|
<div class="config-search">
|
||||||
<svg class="config-search__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
<svg
|
||||||
|
class="config-search__icon"
|
||||||
|
viewBox="0 0 24 24"
|
||||||
|
fill="none"
|
||||||
|
stroke="currentColor"
|
||||||
|
stroke-width="2"
|
||||||
|
>
|
||||||
<circle cx="11" cy="11" r="8"></circle>
|
<circle cx="11" cy="11" r="8"></circle>
|
||||||
<path d="M21 21l-4.35-4.35"></path>
|
<path d="M21 21l-4.35-4.35"></path>
|
||||||
</svg>
|
</svg>
|
||||||
@@ -469,11 +480,13 @@ export function renderConfig(props: ConfigProps) {
|
|||||||
${
|
${
|
||||||
props.searchQuery
|
props.searchQuery
|
||||||
? html`
|
? html`
|
||||||
<button
|
<button
|
||||||
class="config-search__clear"
|
class="config-search__clear"
|
||||||
@click=${() => props.onSearchChange("")}
|
@click=${() => props.onSearchChange("")}
|
||||||
>×</button>
|
>
|
||||||
`
|
×
|
||||||
|
</button>
|
||||||
|
`
|
||||||
: nothing
|
: nothing
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@@ -489,14 +502,16 @@ export function renderConfig(props: ConfigProps) {
|
|||||||
</button>
|
</button>
|
||||||
${allSections.map(
|
${allSections.map(
|
||||||
(section) => html`
|
(section) => html`
|
||||||
<button
|
<button
|
||||||
class="config-nav__item ${props.activeSection === section.key ? "active" : ""}"
|
class="config-nav__item ${props.activeSection === section.key ? "active" : ""}"
|
||||||
@click=${() => props.onSectionChange(section.key)}
|
@click=${() => props.onSectionChange(section.key)}
|
||||||
>
|
>
|
||||||
<span class="config-nav__icon">${getSectionIcon(section.key)}</span>
|
<span class="config-nav__icon"
|
||||||
<span class="config-nav__label">${section.label}</span>
|
>${getSectionIcon(section.key)}</span
|
||||||
</button>
|
>
|
||||||
`,
|
<span class="config-nav__label">${section.label}</span>
|
||||||
|
</button>
|
||||||
|
`,
|
||||||
)}
|
)}
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
@@ -528,15 +543,25 @@ export function renderConfig(props: ConfigProps) {
|
|||||||
${
|
${
|
||||||
hasChanges
|
hasChanges
|
||||||
? html`
|
? html`
|
||||||
<span class="config-changes-badge">${props.formMode === "raw" ? "Unsaved changes" : `${diff.length} unsaved change${diff.length !== 1 ? "s" : ""}`}</span>
|
<span class="config-changes-badge"
|
||||||
`
|
>${
|
||||||
|
props.formMode === "raw"
|
||||||
|
? "Unsaved changes"
|
||||||
|
: `${diff.length} unsaved change${diff.length !== 1 ? "s" : ""}`
|
||||||
|
}</span
|
||||||
|
>
|
||||||
|
`
|
||||||
: html`
|
: html`
|
||||||
<span class="config-status muted">No changes</span>
|
<span class="config-status muted">No changes</span>
|
||||||
`
|
`
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
<div class="config-actions__right">
|
<div class="config-actions__right">
|
||||||
<button class="btn btn--sm" ?disabled=${props.loading} @click=${props.onReload}>
|
<button
|
||||||
|
class="btn btn--sm"
|
||||||
|
?disabled=${props.loading}
|
||||||
|
@click=${props.onReload}
|
||||||
|
>
|
||||||
${props.loading ? "Loading…" : "Reload"}
|
${props.loading ? "Loading…" : "Reload"}
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
@@ -567,42 +592,60 @@ export function renderConfig(props: ConfigProps) {
|
|||||||
${
|
${
|
||||||
hasChanges && props.formMode === "form"
|
hasChanges && props.formMode === "form"
|
||||||
? html`
|
? html`
|
||||||
<details class="config-diff">
|
<details class="config-diff">
|
||||||
<summary class="config-diff__summary">
|
<summary class="config-diff__summary">
|
||||||
<span>View ${diff.length} pending change${diff.length !== 1 ? "s" : ""}</span>
|
<span
|
||||||
<svg class="config-diff__chevron" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
|
>View ${diff.length} pending
|
||||||
<polyline points="6 9 12 15 18 9"></polyline>
|
change${diff.length !== 1 ? "s" : ""}</span
|
||||||
</svg>
|
>
|
||||||
</summary>
|
<svg
|
||||||
<div class="config-diff__content">
|
class="config-diff__chevron"
|
||||||
${diff.map(
|
viewBox="0 0 24 24"
|
||||||
(change) => html`
|
fill="none"
|
||||||
<div class="config-diff__item">
|
stroke="currentColor"
|
||||||
<div class="config-diff__path">${change.path}</div>
|
stroke-width="2"
|
||||||
<div class="config-diff__values">
|
>
|
||||||
<span class="config-diff__from">${truncateValue(change.from)}</span>
|
<polyline points="6 9 12 15 18 9"></polyline>
|
||||||
<span class="config-diff__arrow">→</span>
|
</svg>
|
||||||
<span class="config-diff__to">${truncateValue(change.to)}</span>
|
</summary>
|
||||||
</div>
|
<div class="config-diff__content">
|
||||||
|
${diff.map(
|
||||||
|
(change) => html`
|
||||||
|
<div class="config-diff__item">
|
||||||
|
<div class="config-diff__path">${change.path}</div>
|
||||||
|
<div class="config-diff__values">
|
||||||
|
<span class="config-diff__from"
|
||||||
|
>${truncateValue(change.from)}</span
|
||||||
|
>
|
||||||
|
<span class="config-diff__arrow">→</span>
|
||||||
|
<span class="config-diff__to"
|
||||||
|
>${truncateValue(change.to)}</span
|
||||||
|
>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`,
|
||||||
|
)}
|
||||||
</div>
|
</div>
|
||||||
`,
|
</details>
|
||||||
)}
|
`
|
||||||
</div>
|
|
||||||
</details>
|
|
||||||
`
|
|
||||||
: nothing
|
: nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
${
|
${
|
||||||
activeSectionMeta && props.formMode === "form"
|
activeSectionMeta && props.formMode === "form"
|
||||||
? html`
|
? html`
|
||||||
<div class="config-section-hero">
|
<div class="config-section-hero">
|
||||||
<div class="config-section-hero__icon">${getSectionIcon(props.activeSection ?? "")}</div>
|
<div class="config-section-hero__icon">
|
||||||
|
${getSectionIcon(props.activeSection ?? "")}
|
||||||
|
</div>
|
||||||
<div class="config-section-hero__text">
|
<div class="config-section-hero__text">
|
||||||
<div class="config-section-hero__title">${activeSectionMeta.label}</div>
|
<div class="config-section-hero__title">
|
||||||
|
${activeSectionMeta.label}
|
||||||
|
</div>
|
||||||
${
|
${
|
||||||
activeSectionMeta.description
|
activeSectionMeta.description
|
||||||
? html`<div class="config-section-hero__desc">${activeSectionMeta.description}</div>`
|
? html`<div class="config-section-hero__desc">
|
||||||
|
${activeSectionMeta.description}
|
||||||
|
</div>`
|
||||||
: nothing
|
: nothing
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@@ -610,7 +653,6 @@ export function renderConfig(props: ConfigProps) {
|
|||||||
`
|
`
|
||||||
: nothing
|
: nothing
|
||||||
}
|
}
|
||||||
|
|
||||||
${
|
${
|
||||||
allowSubnav
|
allowSubnav
|
||||||
? html`
|
? html`
|
||||||
@@ -690,7 +732,9 @@ export function renderConfig(props: ConfigProps) {
|
|||||||
${
|
${
|
||||||
props.issues.length > 0
|
props.issues.length > 0
|
||||||
? html`<div class="callout danger" style="margin-top: 12px;">
|
? html`<div class="callout danger" style="margin-top: 12px;">
|
||||||
<pre class="code-block">${JSON.stringify(props.issues, null, 2)}</pre>
|
<pre class="code-block">
|
||||||
|
${JSON.stringify(props.issues, null, 2)}</pre
|
||||||
|
>
|
||||||
</div>`
|
</div>`
|
||||||
: nothing
|
: nothing
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user