Compare commits
4 Commits
dark-mode-
...
dcpp-socke
| Author | SHA1 | Date | |
|---|---|---|---|
| bbe6207a25 | |||
| a47b67c6c9 | |||
| c09ec6bcfe | |||
| df1fbc7dd3 |
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 15 KiB |
@@ -1,15 +1,17 @@
|
|||||||
import React from "react";
|
import React, { useContext } from "react";
|
||||||
import { SearchBar } from "./GlobalSearchBar/SearchBar";
|
import { SearchBar } from "./GlobalSearchBar/SearchBar";
|
||||||
import { DownloadProgressTick } from "./ComicDetail/DownloadProgressTick";
|
import { DownloadProgressTick } from "./ComicDetail/DownloadProgressTick";
|
||||||
import { Link } from "react-router-dom";
|
import { Link } from "react-router-dom";
|
||||||
import { useSelector } from "react-redux";
|
import { useSelector } from "react-redux";
|
||||||
import { isUndefined } from "lodash";
|
import { isUndefined, isEmpty } from "lodash";
|
||||||
|
import { AirDCPPSocketContext } from "../context/AirDCPPSocket";
|
||||||
|
|
||||||
const Navbar: React.FunctionComponent = (props) => {
|
const Navbar: React.FunctionComponent = (props) => {
|
||||||
const downloadProgressTick = useSelector(
|
const downloadProgressTick = useSelector(
|
||||||
(state: RootState) => state.airdcpp.downloadProgressData,
|
(state: RootState) => state.airdcpp.downloadProgressData,
|
||||||
);
|
);
|
||||||
|
const airDCPPConfiguration = useContext(AirDCPPSocketContext);
|
||||||
|
console.log(airDCPPConfiguration)
|
||||||
return (
|
return (
|
||||||
<nav className="navbar is-fixed-top">
|
<nav className="navbar is-fixed-top">
|
||||||
<div className="navbar-brand">
|
<div className="navbar-brand">
|
||||||
@@ -80,15 +82,20 @@ const Navbar: React.FunctionComponent = (props) => {
|
|||||||
<div className="navbar-dropdown download-progress-meter">
|
<div className="navbar-dropdown download-progress-meter">
|
||||||
<a className="navbar-item">
|
<a className="navbar-item">
|
||||||
<DownloadProgressTick data={downloadProgressTick} />
|
<DownloadProgressTick data={downloadProgressTick} />
|
||||||
</a>
|
</a> </div>
|
||||||
</div>
|
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
{/* AirDC++ socket connection status */}
|
{/* AirDC++ socket connection status */}
|
||||||
<div className="navbar-item has-dropdown is-hoverable">
|
<div className="navbar-item has-dropdown is-hoverable">
|
||||||
<a className="navbar-link is-arrowless">
|
<a className="navbar-link is-arrowless has-text-success">
|
||||||
<i className="fa-solid fa-bolt"></i>
|
{!isEmpty(airDCPPConfiguration.airDCPPState.socketConnectionInformation) ? (
|
||||||
</a>
|
<i className="fa-solid fa-bolt"></i>) : null}
|
||||||
|
</a>
|
||||||
|
<div className="navbar-dropdown download-progress-meter">
|
||||||
|
<a className="navbar-item">
|
||||||
|
<pre>{JSON.stringify(airDCPPConfiguration.airDCPPState.socketConnectionInformation, null, 2)}</pre>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -55,11 +55,13 @@ const AirDCPPSocketContextProvider = ({ children }) => {
|
|||||||
protocol: `${host.protocol}`,
|
protocol: `${host.protocol}`,
|
||||||
hostname: `${host.hostname}:${host.port}`,
|
hostname: `${host.hostname}:${host.port}`,
|
||||||
});
|
});
|
||||||
const socketConnectionInformation = await initializedAirDCPPSocket.connect(
|
|
||||||
|
let socketConnectionInformation = await initializedAirDCPPSocket.connect(
|
||||||
`${host.username}`,
|
`${host.username}`,
|
||||||
`${host.password}`,
|
`${host.password}`,
|
||||||
true,
|
true,
|
||||||
);
|
);
|
||||||
|
|
||||||
persistSettings({
|
persistSettings({
|
||||||
...airDCPPState,
|
...airDCPPState,
|
||||||
airDCPPState: {
|
airDCPPState: {
|
||||||
|
|||||||
Reference in New Issue
Block a user