👀 Auto-adder WIP

This commit is contained in:
2021-10-11 14:53:49 -07:00
parent 53b7e94135
commit 9ff79320da
5 changed files with 20 additions and 6 deletions

View File

@@ -50,7 +50,6 @@ $size-8: 0.9rem;
}
}
.volumes-container {
margin-top: 3rem;
.stack {
max-width: 200px;

View File

@@ -21,7 +21,9 @@ export const VolumeGroups = (): ReactElement => {
);
return (
<section className="volumes-container">
<h2 className="subtitle">Volumes</h2>
<div className="content">
<div className="subtitle">Volumes</div>
</div>
<Masonry
breakpointCols={breakpointColumnsObj}
className="volumes-grid"

View File

@@ -3,6 +3,7 @@ import io, { Socket } from "socket.io-client";
import { SOCKET_BASE_URI } from "../../constants/endpoints";
import { useDispatch } from "react-redux";
import { RMQ_SOCKET_CONNECTED } from "../../constants/action-types";
import { success } from "react-notification-system-redux";
const WebSocketContext = createContext(null);
export const WebSocketProvider = ({ children }): ReactElement => {
@@ -16,6 +17,20 @@ export const WebSocketProvider = ({ children }): ReactElement => {
socketId: socket.id,
});
});
// on cover extraction
socket.on("coverExtracted", (data) => {
console.log("shaket", data);
dispatch(
success({
// uid: 'once-please', // you can specify your own uid if required
title: "Cover Extracted",
message: `<span class="icon-text has-text-success"><i class="fas fa-plug"></i></span> Socket <span class="has-text-info">${socket.id}</span> connected. <strong>${data}</strong>`,
dismissible: "click",
position: "tr",
autoDismiss: 0,
}),
);
})
socket.on("disconnect", () => {
console.log(`disconnect`);
});

View File

@@ -163,9 +163,7 @@ export const extractNumerals = (inputString: string): MatchArray[string] => {
};
export const refineQuery = (inputString: string) => {
const queryObj = tokenize(inputString);
console.log(queryObj)
const removedYears = xor(
queryObj.sentence_tokens.normalized,
queryObj.years.yearMatches,

View File

@@ -56,8 +56,8 @@ amqp.connect("amqp://localhost", (error0, connection) => {
durable: false,
});
console.log(`Connected to ${queue} queue.`);
console.log(`Waiting for comic book cover data in ${queue}`);
console.log(`RabbitMQ: Connected to ${queue} queue.`);
console.log(`RabbitMQ: Waiting for comic book cover data in ${queue}`);
channel.consume(
queue,