mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-07-13 05:12:11 +08:00
Sigh question marks...
This commit is contained in:
@@ -337,9 +337,8 @@ export function RouteRecordings() {
|
||||
<button
|
||||
class="show-preserved-button"
|
||||
@click="${() => (state.showPreservedOnly = !state.showPreservedOnly)}"
|
||||
?disabled="${state.loading && state.routes.length === 0}"
|
||||
>
|
||||
${() => (state.showPreservedOnly ? "Show All" : "Show Only Preserved Routes")}
|
||||
disabled="${() => (state.loading && state.routes.length === 0) || false}"
|
||||
> ${() => (state.showPreservedOnly ? "Show All" : "Show Only Preserved Routes")}
|
||||
</button>
|
||||
|
||||
${() => {
|
||||
@@ -398,9 +397,8 @@ export function RouteRecordings() {
|
||||
<button
|
||||
class="delete-all-button"
|
||||
@click="${() => (state.showDeleteAllModal = true)}"
|
||||
?disabled="${state.isDeletingAll}"
|
||||
>
|
||||
${() => (state.isDeletingAll ? "Deleting..." : "Delete All Routes")}
|
||||
disabled="${() => state.isDeletingAll || false}"
|
||||
> ${() => (state.isDeletingAll ? "Deleting..." : "Delete All Routes")}
|
||||
</button>
|
||||
`;
|
||||
}
|
||||
|
||||
@@ -579,21 +579,20 @@ function renderSettingRow(p) {
|
||||
<div class="ds-stepper">
|
||||
<button
|
||||
class="ds-stepper-btn"
|
||||
?disabled="${!canDecrease}"
|
||||
disabled="${() => !canDecrease || false}"
|
||||
@click="${() => stepNumericParam(p, -1)}">-</button>
|
||||
<div class="ds-stepper-meta">
|
||||
<span>${formatSliderValue(bounds.min, String(bounds.step), p.precision, p.key)} to ${formatSliderValue(bounds.max, String(bounds.step), p.precision, p.key)}</span>
|
||||
<span class="ds-default-value">Default: ${defaultLabel}</span>
|
||||
<button
|
||||
class="ds-reset-btn"
|
||||
?disabled="${!canReset}"
|
||||
disabled="${() => !canReset || false}"
|
||||
@click="${() => resetNumericParam(p)}">Reset to Default</button>
|
||||
</div>
|
||||
<button
|
||||
class="ds-stepper-btn"
|
||||
?disabled="${!canIncrease}"
|
||||
@click="${() => stepNumericParam(p, 1)}">+</button>
|
||||
</div>
|
||||
disabled="${() => !canIncrease || false}"
|
||||
@click="${() => stepNumericParam(p, 1)}">+</button> </div>
|
||||
`
|
||||
})()}
|
||||
</div>
|
||||
|
||||
@@ -124,15 +124,14 @@ export function LongitudinalManeuvers() {
|
||||
<div class="longManeuverActions">
|
||||
<button
|
||||
class="longManeuverButton"
|
||||
?disabled="${state.busy}"
|
||||
disabled="${() => state.busy || false}"
|
||||
@click="${() => runAction("start")}">
|
||||
Start / Arm
|
||||
</button>
|
||||
<button
|
||||
class="longManeuverButton danger"
|
||||
?disabled="${state.busy}"
|
||||
@click="${() => runAction("stop")}">
|
||||
Stop
|
||||
disabled="${() => state.busy || false}"
|
||||
@click="${() => runAction("stop")}"> Stop
|
||||
</button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -538,27 +538,26 @@ export function ModelManager() {
|
||||
|
||||
return orderedInstalled.length > 0
|
||||
? orderedInstalled.map(model => html`
|
||||
<option value="${safeText(model.value)}" ${safeText(model.value) === state.currentModel ? "selected" : ""}>
|
||||
<option value="${safeText(model.value)}" selected="${() => safeText(model.value) === state.currentModel || false}">
|
||||
${safeText(model.label, model.value)}
|
||||
</option>
|
||||
`)
|
||||
</option> `)
|
||||
: html`<option value="">No installed models</option>`;
|
||||
})()}
|
||||
</select>
|
||||
|
||||
<label class="mm-filter-label" for="mm-sort-mode-select">Sort</label>
|
||||
<select class="mm-select" id="mm-sort-mode-select">
|
||||
<option value="alphabetical" ${state.sortMode === "alphabetical" ? "selected" : ""}>Alphabetical</option>
|
||||
<option value="release_date" ${state.sortMode === "release_date" ? "selected" : ""}>Release Date</option>
|
||||
<option value="alphabetical" selected="${() => state.sortMode === "alphabetical" || false}">Alphabetical</option>
|
||||
<option value="release_date" selected="${() => state.sortMode === "release_date" || false}">Release Date</option>
|
||||
</select>
|
||||
|
||||
<div class="mm-filter-break"></div>
|
||||
|
||||
<label class="mm-filter-label" for="mm-community-filter-select">Community Favorite</label>
|
||||
<select class="mm-select" id="mm-community-filter-select">
|
||||
<option value="all" ${state.communityFavoriteFilter === "all" ? "selected" : ""}>All</option>
|
||||
<option value="yes" ${state.communityFavoriteFilter === "yes" ? "selected" : ""}>Yes</option>
|
||||
<option value="no" ${state.communityFavoriteFilter === "no" ? "selected" : ""}>No</option>
|
||||
<option value="all" selected="${() => state.communityFavoriteFilter === "all" || false}">All</option>
|
||||
<option value="yes" selected="${() => state.communityFavoriteFilter === "yes" || false}">Yes</option>
|
||||
<option value="no" selected="${() => state.communityFavoriteFilter === "no"}">No</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -242,12 +242,12 @@ export function TestingGround() {
|
||||
<div class="testingGroundSelectionRow">
|
||||
<select
|
||||
class="testingGroundSelect"
|
||||
?disabled="${state.busy || getSelectableSlots().length === 0}"
|
||||
disabled="${() => state.busy || getSelectableSlots().length === 0 || false}"
|
||||
@change="${(event) => {
|
||||
selectSlot(String(event.target.value || ""))
|
||||
}}">
|
||||
${() => getSelectableSlots().length
|
||||
? getSelectableSlots().map((slot) => html`<option value="${slotId(slot)}" ${slotId(slot) === state.selectedSlot ? "selected" : ""}>${slot.id}. ${slot.name}</option>`)
|
||||
? getSelectableSlots().map((slot) => html`<option value="${slotId(slot)}" selected="${() => slotId(slot) === state.selectedSlot || false}">${slot.id}. ${slot.name}</option>`)
|
||||
: html`<option value="">No active test slots</option>`
|
||||
}
|
||||
</select>
|
||||
@@ -265,7 +265,7 @@ export function TestingGround() {
|
||||
${() => getVariantModes(getSelectedSlot()).map((mode) => html`
|
||||
<button
|
||||
class="${modeButtonClass(mode)}"
|
||||
?disabled="${state.busy}"
|
||||
disabled="${() => state.busy || false}"
|
||||
@click="${() => selectMode(mode)}">
|
||||
<span class="testingGroundModeLetter">${mode}</span>
|
||||
<span class="testingGroundModeLabel">${toModeLabel(getSelectedSlot(), mode)}</span>
|
||||
|
||||
@@ -156,8 +156,7 @@ export function Troubleshoot() {
|
||||
Quick diagnostics snapshot for weird behavior reports and copy-ready debug logs.
|
||||
</p>
|
||||
<div class="troubleshootActionRow">
|
||||
<button class="troubleshootButton" ?disabled="${state.refreshing}" @click="${() => fetchTroubleshoot(true)}">
|
||||
${state.refreshing ? "Refreshing..." : "Refresh"}
|
||||
<button class="troubleshootButton" disabled="${() => state.refreshing || false}" @click="${() => fetchTroubleshoot(true)}"> ${state.refreshing ? "Refreshing..." : "Refresh"}
|
||||
</button>
|
||||
<button class="troubleshootButton" @click="${copyToClipboard}">
|
||||
Copy to Clipboard
|
||||
@@ -188,9 +187,8 @@ export function Troubleshoot() {
|
||||
${section.resettable ? html`
|
||||
<button
|
||||
class="troubleshootButton troubleshootDanger"
|
||||
?disabled="${state.busySection === section.id}"
|
||||
@click="${() => resetSection(section)}">
|
||||
${state.busySection === section.id ? "Resetting..." : "Reset to Default"}
|
||||
disabled="${() => state.busySection === section.id || false}"
|
||||
@click="${() => resetSection(section)}"> ${state.busySection === section.id ? "Resetting..." : "Reset to Default"}
|
||||
</button>
|
||||
` : ""}
|
||||
</div>
|
||||
|
||||
@@ -524,8 +524,8 @@ export function UpdateManager() {
|
||||
<input
|
||||
type="checkbox"
|
||||
class="ds-toggle"
|
||||
?checked="${!!state.status?.automaticUpdates}"
|
||||
?disabled="${!!state.status?.isOnroad || state.toggleBusy || !!state.status?.running}"
|
||||
checked="${() => !!state.status?.automaticUpdates || false}"
|
||||
disabled="${() => !!state.status?.isOnroad || state.toggleBusy || !!state.status?.running || false}"
|
||||
@change="${(event) => setAutomaticUpdates(!!event.target.checked)}"
|
||||
/>
|
||||
</label>
|
||||
@@ -535,7 +535,7 @@ export function UpdateManager() {
|
||||
<input
|
||||
type="checkbox"
|
||||
class="ds-toggle"
|
||||
?checked="${() => state.showAdvancedOptions}"
|
||||
checked="${() => state.showAdvancedOptions || false}"
|
||||
@change="${(event) => setAdvancedOptions(!!event.target.checked)}"
|
||||
/>
|
||||
</label>
|
||||
@@ -552,19 +552,19 @@ export function UpdateManager() {
|
||||
<div class="updateBranchRow">
|
||||
<select
|
||||
class="updateSelect"
|
||||
?disabled="${!!state.status?.isOnroad || !!state.status?.running || state.switchBusy || state.branchesBusy || state.branches.length === 0}"
|
||||
disabled="${() => !!state.status?.isOnroad || !!state.status?.running || state.switchBusy || state.branchesBusy || state.branches.length === 0 || false}"
|
||||
@change="${(event) => {
|
||||
state.selectedBranch = String(event.target.value || "")
|
||||
state.hasManualBranchSelection = true
|
||||
}}">
|
||||
${() => state.branches.length
|
||||
? state.branches.map((branch) => html`<option value="${branch}" ${branch === state.selectedBranch ? "selected" : ""}>${branch}${branch === state.status?.branch ? " (current)" : ""}</option>`)
|
||||
? state.branches.map((branch) => html`<option value="${branch}" selected="${() => branch === state.selectedBranch || false}">${branch}${branch === state.status?.branch ? " (current)" : ""}</option>`)
|
||||
: html`<option value="">No branches found</option>`
|
||||
}
|
||||
</select>
|
||||
<button
|
||||
class="updateButton"
|
||||
?disabled="${state.branchesBusy || !!state.status?.running}"
|
||||
disabled="${() => state.branchesBusy || !!state.status?.running || false}"
|
||||
@click="${() => fetchBranches(true)}">
|
||||
${state.branchesBusy ? "Refreshing..." : "Refresh Branches"}
|
||||
</button>
|
||||
@@ -587,7 +587,7 @@ export function UpdateManager() {
|
||||
${() => shouldShowPrimaryUpdateAction() ? html`
|
||||
<button
|
||||
class="updateButton danger"
|
||||
?disabled="${!!state.status?.isOnroad || !!state.status?.running || (isSelectedBranchDifferent() ? state.switchBusy : state.updateBusy)}"
|
||||
disabled="${() => !!state.status?.isOnroad || !!state.status?.running || (isSelectedBranchDifferent() ? state.switchBusy : state.updateBusy) || false}"
|
||||
@click="${() => isSelectedBranchDifferent() ? runBranchSwitch() : runFastUpdate()}">
|
||||
${state.status?.running
|
||||
? "Update Running..."
|
||||
|
||||
Reference in New Issue
Block a user