AirDC++ Connection Status (#53)
* 🔧 Fixed empty library state with explanation * ⚡️ Added a status indicator for the AirDC++ socket connection
This commit was merged in pull request #53.
This commit is contained in:
@@ -51,7 +51,6 @@ export const RecentlyImported = ({
|
|||||||
},
|
},
|
||||||
idx,
|
idx,
|
||||||
) => {
|
) => {
|
||||||
console.log(comicvine);
|
|
||||||
const { issueName, url } = determineCoverFile({
|
const { issueName, url } = determineCoverFile({
|
||||||
rawFileDetails,
|
rawFileDetails,
|
||||||
comicvine,
|
comicvine,
|
||||||
@@ -63,7 +62,6 @@ export const RecentlyImported = ({
|
|||||||
comicInfo,
|
comicInfo,
|
||||||
locg,
|
locg,
|
||||||
});
|
});
|
||||||
console.log(name);
|
|
||||||
const isComicBookMetadataAvailable =
|
const isComicBookMetadataAvailable =
|
||||||
!isUndefined(comicvine) &&
|
!isUndefined(comicvine) &&
|
||||||
!isUndefined(comicvine.volumeInformation);
|
!isUndefined(comicvine.volumeInformation);
|
||||||
|
|||||||
@@ -208,14 +208,13 @@ export const Library = (): ReactElement => {
|
|||||||
// ImportStatus.propTypes = {
|
// ImportStatus.propTypes = {
|
||||||
// value: PropTypes.bool.isRequired,
|
// value: PropTypes.bool.isRequired,
|
||||||
// };
|
// };
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<section className="container">
|
<section className="container">
|
||||||
<div className="section">
|
<div className="section">
|
||||||
<div className="header-area">
|
<div className="header-area">
|
||||||
<h1 className="title">Library</h1>
|
<h1 className="title">Library</h1>
|
||||||
</div>
|
</div>
|
||||||
{!isUndefined(searchResults.hits) && (
|
{!isEmpty(searchResults) ? (
|
||||||
<div>
|
<div>
|
||||||
<div className="library">
|
<div className="library">
|
||||||
<T2Table
|
<T2Table
|
||||||
@@ -230,7 +229,25 @@ export const Library = (): ReactElement => {
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)}
|
): <div className="columns">
|
||||||
|
<div className="column is-two-thirds">
|
||||||
|
<article className="message is-link">
|
||||||
|
<div className="message-body">
|
||||||
|
No comics were found in the library, Elasticsearch reports no
|
||||||
|
indices. Try importing a few comics into the library and come
|
||||||
|
back.
|
||||||
|
</div>
|
||||||
|
</article>
|
||||||
|
<pre>
|
||||||
|
{!isUndefined(searchError.data) &&
|
||||||
|
JSON.stringify(
|
||||||
|
searchError.data.meta.body.error.root_cause,
|
||||||
|
null,
|
||||||
|
4,
|
||||||
|
)}
|
||||||
|
</pre>
|
||||||
|
</div>
|
||||||
|
</div> }
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -84,6 +84,14 @@ const Navbar: React.FunctionComponent = (props) => {
|
|||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
{/* AirDC++ socket connection status */}
|
||||||
|
<div className="navbar-item has-dropdown is-hoverable">
|
||||||
|
<a className="navbar-link is-arrowless">
|
||||||
|
<i className="fa-solid fa-bolt"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div className="navbar-item has-dropdown is-hoverable is-mega">
|
<div className="navbar-item has-dropdown is-hoverable is-mega">
|
||||||
<div className="navbar-link flex">Blog</div>
|
<div className="navbar-link flex">Blog</div>
|
||||||
<div id="blogDropdown" className="navbar-dropdown">
|
<div id="blogDropdown" className="navbar-dropdown">
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ const AirDCPPSocketContextProvider = ({ children }) => {
|
|||||||
airDCPPState: {
|
airDCPPState: {
|
||||||
settings: settingsObject,
|
settings: settingsObject,
|
||||||
socket: {},
|
socket: {},
|
||||||
socketConnectionInformation: {},
|
socketConectionInformation: {},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
@@ -55,7 +55,6 @@ const AirDCPPSocketContextProvider = ({ children }) => {
|
|||||||
protocol: `${host.protocol}`,
|
protocol: `${host.protocol}`,
|
||||||
hostname: `${host.hostname}:${host.port}`,
|
hostname: `${host.hostname}:${host.port}`,
|
||||||
});
|
});
|
||||||
|
|
||||||
const socketConnectionInformation = await initializedAirDCPPSocket.connect(
|
const socketConnectionInformation = await initializedAirDCPPSocket.connect(
|
||||||
`${host.username}`,
|
`${host.username}`,
|
||||||
`${host.password}`,
|
`${host.password}`,
|
||||||
@@ -80,7 +79,7 @@ const AirDCPPSocketContextProvider = ({ children }) => {
|
|||||||
};
|
};
|
||||||
const AirDCPPSocketContext = createContext({
|
const AirDCPPSocketContext = createContext({
|
||||||
airDCPPState: {},
|
airDCPPState: {},
|
||||||
saveSettings: () => {},
|
saveSettings: () => { },
|
||||||
});
|
});
|
||||||
|
|
||||||
export { AirDCPPSocketContext, AirDCPPSocketContextProvider };
|
export { AirDCPPSocketContext, AirDCPPSocketContextProvider };
|
||||||
|
|||||||
Reference in New Issue
Block a user