🔧 Beautifying AirDC++ search results

This commit is contained in:
2021-08-22 10:03:32 -07:00
parent 9440cafe86
commit 0a269b33fb
2 changed files with 56 additions and 21 deletions

View File

@@ -30,14 +30,11 @@ export const AcquisitionPanel = (
// file_type: "compressed", // file_type: "compressed",
extensions: ["cbz", "cbr"], extensions: ["cbz", "cbr"],
}, },
hub_urls: [ hub_urls: ["perfection.crabdance.com:777"],
"adcs://novosibirsk.dc-dev.club:7111/?kp=SHA256/4XFHJFFBFEI2RS75FPRPPXPZMMKPXR764ABVVCC2QGJPQ34SDZGA",
"dc.fly-server.ru",
],
priority: 1, priority: 1,
}; };
return ( return (
<> <div className="comic-detail">
<button <button
className="button" className="button"
onClick={() => getDCPPSearchResults(dcppQuery)} onClick={() => getDCPPSearchResults(dcppQuery)}
@@ -46,23 +43,60 @@ export const AcquisitionPanel = (
</button> </button>
{/* results */} {/* results */}
<table className="table is-striped"> {!isNil(airDCPPSearchResults) && (
<table className="table is-striped">
<thead> <thead>
<tr>
<th>Name</th>
<th>Path</th>
</tr>
</thead>
{map(airDCPPSearchResults, ({ name, path }) => {
return (
<tr> <tr>
<td>{name}</td> <th>Name</th>
<td>{path}</td> <th>Type</th>
<th>Slots</th>
</tr> </tr>
); </thead>
})} <tbody>
</table> {map(airDCPPSearchResults, ({ name, type, slots, users }) => {
</> return (
<tr>
<td>
<p className="mb-2">
{type.id === "directory" ? (
<i className="fas fa-folder"></i>
) : null}{" "}
{name}
</p>
<dl>
<dd>
<div className="tags">
<span className="tag is-light is-info">
{users.user.nicks}
</span>
{users.user.flags.map((flag, idx) => (
<span className="tag is-light" key={idx}>
{flag}
</span>
))}
</div>
</dd>
</dl>
</td>
<td>
<span className="tag is-light is-info">
{type.id === "directory" ? "directory" : type.str}
</span>
</td>
<td>
<div className="tags has-addons">
<span className="tag is-success">{slots.free} free</span>
<span className="tag is-light">{slots.total}</span>
</div>
</td>
</tr>
);
})}
</tbody>
</table>
)}
</div>
); );
}; };

View File

@@ -277,6 +277,7 @@ export const ComicDetail = ({}: ComicDetailProps): ReactElement => {
"dropdown " + (isActionDropdownCollapsed ? "is-active" : "") "dropdown " + (isActionDropdownCollapsed ? "is-active" : "")
} }
onBlur={() => toggleActionDropdown()} onBlur={() => toggleActionDropdown()}
onFocus={() => toggleActionDropdown()}
> >
<div className="dropdown-trigger"> <div className="dropdown-trigger">
<button <button
@@ -300,7 +301,7 @@ export const ComicDetail = ({}: ComicDetailProps): ReactElement => {
role="menu" role="menu"
> >
<div className="dropdown-content"> <div className="dropdown-content">
<a <div
className="dropdown-item" className="dropdown-item"
onClick={openDrawerWithCVMatches} onClick={openDrawerWithCVMatches}
> >
@@ -308,7 +309,7 @@ export const ComicDetail = ({}: ComicDetailProps): ReactElement => {
<i className="fas fa-magic"></i> <i className="fas fa-magic"></i>
</span> </span>
<span>Match on ComicVine</span> <span>Match on ComicVine</span>
</a> </div>
<hr className="dropdown-divider" /> <hr className="dropdown-divider" />
<div className="dropdown-item"> <div className="dropdown-item">
<span className="icon"> <span className="icon">