🏗 Fixed the archive ops panel
This commit is contained in:
@@ -8,7 +8,7 @@ import { difference } from "../../shared/utils/object.utils";
|
|||||||
import { isEmpty, isNil, map } from "lodash";
|
import { isEmpty, isNil, map } from "lodash";
|
||||||
import { useStore } from "../../store";
|
import { useStore } from "../../store";
|
||||||
import { useShallow } from "zustand/react/shallow";
|
import { useShallow } from "zustand/react/shallow";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery, useQueryClient } from "@tanstack/react-query";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
|
|
||||||
interface IAcquisitionPanelProps {
|
interface IAcquisitionPanelProps {
|
||||||
@@ -57,6 +57,7 @@ export const AcquisitionPanel = (
|
|||||||
const [airDCPPSearchStatus, setAirDCPPSearchStatus] = useState(false);
|
const [airDCPPSearchStatus, setAirDCPPSearchStatus] = useState(false);
|
||||||
const [airDCPPSearchInstance, setAirDCPPSearchInstance] = useState({});
|
const [airDCPPSearchInstance, setAirDCPPSearchInstance] = useState({});
|
||||||
const [airDCPPSearchInfo, setAirDCPPSearchInfo] = useState({});
|
const [airDCPPSearchInfo, setAirDCPPSearchInfo] = useState({});
|
||||||
|
const queryClient = useQueryClient();
|
||||||
|
|
||||||
// Construct a AirDC++ query based on metadata inferred, upon component mount
|
// Construct a AirDC++ query based on metadata inferred, upon component mount
|
||||||
// Pre-populate the search input with the search string, so that
|
// Pre-populate the search input with the search string, so that
|
||||||
@@ -199,6 +200,8 @@ export const AcquisitionPanel = (
|
|||||||
},
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
|
queryClient.invalidateQueries({ queryKey: ["comicBookMetadata"] });
|
||||||
|
|
||||||
// dispatch({
|
// dispatch({
|
||||||
// type: AIRDCPP_RESULT_DOWNLOAD_INITIATED,
|
// type: AIRDCPP_RESULT_DOWNLOAD_INITIATED,
|
||||||
// downloadResult,
|
// downloadResult,
|
||||||
|
|||||||
@@ -230,17 +230,6 @@ export const ComicDetail = (data: ComicDetailProps): ReactElement => {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: 6,
|
id: 6,
|
||||||
icon: (
|
|
||||||
<span className="inline-flex flex-row">
|
|
||||||
{/* download count */}
|
|
||||||
<span className="inline-flex items-center bg-slate-50 text-slate-800 text-xs font-medium px-2 rounded-md dark:text-slate-900 dark:bg-slate-400">
|
|
||||||
<span className="text-md text-slate-500 dark:text-slate-900">
|
|
||||||
34
|
|
||||||
</span>
|
|
||||||
</span>
|
|
||||||
<i className="h-5 w-5 icon-[solar--download-bold-duotone] text-slate-500 dark:text-slate-300" />
|
|
||||||
</span>
|
|
||||||
),
|
|
||||||
name: "Downloads",
|
name: "Downloads",
|
||||||
content:
|
content:
|
||||||
!isNil(data.data) && !isEmpty(data.data) ? (
|
!isNil(data.data) && !isEmpty(data.data) ? (
|
||||||
|
|||||||
@@ -24,7 +24,6 @@ export const ComicDetailContainer = (): ReactElement | null => {
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
console.log(comicBookDetailData);
|
|
||||||
|
|
||||||
{
|
{
|
||||||
isError && <>Error</>;
|
isError && <>Error</>;
|
||||||
|
|||||||
@@ -85,7 +85,9 @@ export const DownloadsPanel = (
|
|||||||
<tr key={bundle.id} className="text-sm">
|
<tr key={bundle.id} className="text-sm">
|
||||||
<td className="whitespace-nowrap px-2 py-2 text-gray-700 dark:text-slate-300">
|
<td className="whitespace-nowrap px-2 py-2 text-gray-700 dark:text-slate-300">
|
||||||
<h5>{ellipsize(bundle.name, 58)}</h5>
|
<h5>{ellipsize(bundle.name, 58)}</h5>
|
||||||
<span className="is-size-7">{bundle.target}</span>
|
<span className="is-size-7">
|
||||||
|
{ellipsize(bundle.target, 68)}
|
||||||
|
</span>
|
||||||
</td>
|
</td>
|
||||||
<td className="whitespace-nowrap px-2 py-2 text-gray-700 dark:text-slate-300">
|
<td className="whitespace-nowrap px-2 py-2 text-gray-700 dark:text-slate-300">
|
||||||
{prettyBytes(bundle.size)}
|
{prettyBytes(bundle.size)}
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import { analyzeImage } from "../../../actions/fileops.actions";
|
|||||||
import { Canvas } from "../../shared/Canvas";
|
import { Canvas } from "../../shared/Canvas";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { LIBRARY_SERVICE_BASE_URI } from "../../../constants/endpoints";
|
import { LIBRARY_SERVICE_HOST } from "../../../constants/endpoints";
|
||||||
|
|
||||||
export const ArchiveOperations = (props): ReactElement => {
|
export const ArchiveOperations = (props): ReactElement => {
|
||||||
const { data } = props;
|
const { data } = props;
|
||||||
@@ -28,6 +28,10 @@ export const ArchiveOperations = (props): ReactElement => {
|
|||||||
// current image
|
// current image
|
||||||
const [currentImage, setCurrentImage] = useState([]);
|
const [currentImage, setCurrentImage] = useState([]);
|
||||||
|
|
||||||
|
const constructImagePaths = (data): Array<string> => {
|
||||||
|
return data?.data.map((path: string) => `${LIBRARY_SERVICE_HOST}/${path}`);
|
||||||
|
};
|
||||||
|
|
||||||
const {
|
const {
|
||||||
data: uncompressedArchive,
|
data: uncompressedArchive,
|
||||||
refetch,
|
refetch,
|
||||||
@@ -36,7 +40,7 @@ export const ArchiveOperations = (props): ReactElement => {
|
|||||||
queryFn: async () =>
|
queryFn: async () =>
|
||||||
await axios({
|
await axios({
|
||||||
method: "POST",
|
method: "POST",
|
||||||
url: `${LIBRARY_SERVICE_BASE_URI}/uncompressFullArchive`,
|
url: `http://localhost:3000/api/jobqueue/uncompressFullArchive`,
|
||||||
headers: {
|
headers: {
|
||||||
"Content-Type": "application/json; charset=utf-8",
|
"Content-Type": "application/json; charset=utf-8",
|
||||||
},
|
},
|
||||||
@@ -52,9 +56,9 @@ export const ArchiveOperations = (props): ReactElement => {
|
|||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
queryKey: [""],
|
queryKey: [""],
|
||||||
|
select: constructImagePaths,
|
||||||
enabled: false,
|
enabled: false,
|
||||||
});
|
});
|
||||||
console.log(uncompressedArchive);
|
|
||||||
// sliding panel init
|
// sliding panel init
|
||||||
const contentForSlidingPanel = {
|
const contentForSlidingPanel = {
|
||||||
// imageAnalysis: {
|
// imageAnalysis: {
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ export const hostURIBuilder = (options: Record<string, string>): string => {
|
|||||||
options.apiPath
|
options.apiPath
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
console.log(import.meta);
|
|
||||||
|
|
||||||
export const CORS_PROXY_SERVER_URI = hostURIBuilder({
|
export const CORS_PROXY_SERVER_URI = hostURIBuilder({
|
||||||
protocol: "http",
|
protocol: "http",
|
||||||
|
|||||||
@@ -254,5 +254,3 @@ if (!isNil(directConnectConfiguration)) {
|
|||||||
} else {
|
} else {
|
||||||
console.log("problem");
|
console.log("problem");
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("connected?", getState());
|
|
||||||
|
|||||||
Reference in New Issue
Block a user