mirror of
https://github.com/openclaw/openclaw.git
synced 2026-03-12 07:20:45 +00:00
fix(ui): replace Manual RPC text input with sorted method dropdown (#14967)
Merged via squash.
Prepared head SHA: 1bb49b2e64
Co-authored-by: rixau <112558420+rixau@users.noreply.github.com>
Co-authored-by: BunsDev <68980965+BunsDev@users.noreply.github.com>
Reviewed-by: @BunsDev
This commit is contained in:
@@ -1081,6 +1081,7 @@ export function renderApp(state: AppViewState) {
|
||||
models: state.debugModels,
|
||||
heartbeat: state.debugHeartbeat,
|
||||
eventLog: state.eventLog,
|
||||
methods: (state.hello?.features?.methods ?? []).toSorted(),
|
||||
callMethod: state.debugCallMethod,
|
||||
callParams: state.debugCallParams,
|
||||
callResult: state.debugCallResult,
|
||||
|
||||
@@ -9,6 +9,7 @@ export type DebugProps = {
|
||||
models: unknown[];
|
||||
heartbeat: unknown;
|
||||
eventLog: EventLogEntry[];
|
||||
methods: string[];
|
||||
callMethod: string;
|
||||
callParams: string;
|
||||
callResult: string | null;
|
||||
@@ -71,14 +72,22 @@ export function renderDebug(props: DebugProps) {
|
||||
<div class="card">
|
||||
<div class="card-title">Manual RPC</div>
|
||||
<div class="card-sub">Send a raw gateway method with JSON params.</div>
|
||||
<div class="form-grid" style="margin-top: 16px;">
|
||||
<div class="stack" style="margin-top: 16px;">
|
||||
<label class="field">
|
||||
<span>Method</span>
|
||||
<input
|
||||
<select
|
||||
.value=${props.callMethod}
|
||||
@input=${(e: Event) => props.onCallMethodChange((e.target as HTMLInputElement).value)}
|
||||
placeholder="system-presence"
|
||||
/>
|
||||
@change=${(e: Event) => props.onCallMethodChange((e.target as HTMLSelectElement).value)}
|
||||
>
|
||||
${
|
||||
!props.callMethod
|
||||
? html`
|
||||
<option value="" disabled>Select a method…</option>
|
||||
`
|
||||
: nothing
|
||||
}
|
||||
${props.methods.map((m) => html`<option value=${m}>${m}</option>`)}
|
||||
</select>
|
||||
</label>
|
||||
<label class="field">
|
||||
<span>Params (JSON)</span>
|
||||
|
||||
Reference in New Issue
Block a user