🏗️ Cleanup of the search results pane

This commit is contained in:
2023-11-28 22:52:28 -05:00
parent 063bee98cf
commit 5ff53f1e21
2 changed files with 29 additions and 15 deletions

View File

@@ -235,11 +235,7 @@ export const AcquisitionPanel = (
className="input main-search-bar is-medium" className="input main-search-bar is-medium"
placeholder="Type an issue/volume name" placeholder="Type an issue/volume name"
/> />
<span className="help is-clearfix is-light is-info"> <span className="help is-clearfix is-light is-info"></span>
This is the auto-detected title; you may need to
change it to get better matches if the
auto-detected one doesn't work.
</span>
</div> </div>
); );
}} }}
@@ -303,7 +299,7 @@ export const AcquisitionPanel = (
<p className="mb-2"> <p className="mb-2">
{result.type.id === "directory" ? ( {result.type.id === "directory" ? (
<i className="fas fa-folder"></i> <i className="fas fa-folder"></i>
) : null}{" "} ) : null}
{ellipsize(result.name, 70)} {ellipsize(result.name, 70)}
</p> </p>
@@ -343,7 +339,8 @@ export const AcquisitionPanel = (
</div> </div>
</td> </td>
<td> <td>
<a <button
className="button is-small is-light is-success"
onClick={() => onClick={() =>
downloadDCPPResult( downloadDCPPResult(
searchInstance.id, searchInstance.id,
@@ -354,8 +351,11 @@ export const AcquisitionPanel = (
) )
} }
> >
<i className="fas fa-file-download"></i> <span className="icon">
</a> <i className="fas fa-file-download"></i>
</span>
<span>Download </span>
</button>
</td> </td>
</tr> </tr>
); );
@@ -367,10 +367,22 @@ export const AcquisitionPanel = (
<div className="column is-three-fifths"> <div className="column is-three-fifths">
<article className="message is-info"> <article className="message is-info">
<div className="message-body is-size-6 is-family-secondary"> <div className="message-body is-size-6 is-family-secondary">
Searching via <strong>AirDC++</strong> is still in{" "} <p>
<strong>alpha</strong>. Some searches may take arbitrarily long, The default search term is an auto-detected title; you may
or may not work at all. Searches from <code>ADCS</code> hubs are need to change it to get better matches if the auto-detected
more reliable than <code>NMDCS</code> ones. one doesn't work.
</p>
</div>
</article>
<article className="message is-warning">
<div className="message-body is-size-6 is-family-secondary">
<p className="content">
Searching via <strong>AirDC++</strong> is still in
<strong>alpha</strong>. Some searches may take arbitrarily
long, or may not work at all. Searches from <code>ADCS</code>
hubs are more reliable than <code>NMDCS</code> ones.
</p>
</div> </div>
</article> </article>
</div> </div>

View File

@@ -37,9 +37,11 @@ export const AirDCPPHubsForm = (): ReactElement => {
const { data: hubs } = useQuery({ const { data: hubs } = useQuery({
queryKey: [], queryKey: [],
queryFn: async () => await airDCPPSocketInstance.get(`hubs`), queryFn: async () => await airDCPPSocketInstance.get(`hubs`),
enabled: !!settings,
}); });
let hubList = {}; let hubList = {};
if (!isNil(hubs)) { if (!isEmpty(hubs)) {
console.log("hs", hubs);
hubList = hubs.map(({ hub_url, identity }) => ({ hubList = hubs.map(({ hub_url, identity }) => ({
value: hub_url, value: hub_url,
label: identity.name, label: identity.name,
@@ -69,7 +71,7 @@ export const AirDCPPHubsForm = (): ReactElement => {
return ( return (
<> <>
{!isEmpty(hubList) ? ( {!isEmpty(hubList) && !isUndefined(hubs) ? (
<Form <Form
onSubmit={mutate} onSubmit={mutate}
validate={validate} validate={validate}