Favor Next machine types in search
Prefer Spectrum Next and +3 results when no machine filter is selected. Signed-off-by: codex@lucy.xalior.com
This commit is contained in:
@@ -77,6 +77,11 @@ export default function EntriesExplorer({
|
||||
const [sort, setSort] = useState<"title" | "id_desc">(initialUrlState?.sort ?? "id_desc");
|
||||
const [scope, setScope] = useState<SearchScope>(initialUrlState?.scope ?? "title");
|
||||
const [facets, setFacets] = useState<EntryFacets | null>(initialFacets ?? null);
|
||||
const preferredMachineIds = [27, 26, 8, 9];
|
||||
const preferredMachineNames = useMemo(() => {
|
||||
if (!machines.length) return preferredMachineIds.map((id) => `#${id}`);
|
||||
return preferredMachineIds.map((id) => machines.find((m) => m.id === id)?.name ?? `#${id}`);
|
||||
}, [machines]);
|
||||
|
||||
const pageSize = 20;
|
||||
const totalPages = useMemo(() => (data ? Math.max(1, Math.ceil(data.total / data.pageSize)) : 1), [data]);
|
||||
@@ -303,6 +308,9 @@ export default function EntriesExplorer({
|
||||
<option key={m.id} value={m.id}>{m.name}</option>
|
||||
))}
|
||||
</select>
|
||||
{machinetypeId === "" && (
|
||||
<div className="form-text">Preferred: {preferredMachineNames.join(", ")}</div>
|
||||
)}
|
||||
</div>
|
||||
<div>
|
||||
<label className="form-label small text-secondary">Sort</label>
|
||||
|
||||
@@ -77,6 +77,11 @@ export default function ReleasesExplorer({
|
||||
const [sources, setSources] = useState<{ id: string; name: string }[]>(initialLists?.sourcetypes ?? []);
|
||||
const [cases, setCases] = useState<{ id: string; name: string }[]>(initialLists?.casetypes ?? []);
|
||||
const initialLoad = useRef(true);
|
||||
const preferredMachineIds = [27, 26, 8, 9];
|
||||
const preferredMachineNames = useMemo(() => {
|
||||
if (!machines.length) return preferredMachineIds.map((id) => `#${id}`);
|
||||
return preferredMachineIds.map((id) => machines.find((m) => m.id === id)?.name ?? `#${id}`);
|
||||
}, [machines]);
|
||||
|
||||
const pageSize = 20;
|
||||
const totalPages = useMemo(() => (data ? Math.max(1, Math.ceil(data.total / data.pageSize)) : 1), [data]);
|
||||
@@ -292,6 +297,9 @@ export default function ReleasesExplorer({
|
||||
<option key={m.id} value={m.id}>{m.name}</option>
|
||||
))}
|
||||
</select>
|
||||
{dMachinetypeId === "" && (
|
||||
<div className="form-text">Preferred: {preferredMachineNames.join(", ")}</div>
|
||||
)}
|
||||
</div>
|
||||
<div>
|
||||
<label className="form-label small text-secondary">File type</label>
|
||||
|
||||
Reference in New Issue
Block a user