|
@@ -1,18 +1,30 @@
|
|
-import { useState } from "react";
|
|
|
|
|
|
+import { useState, useEffect } from "react";
|
|
import { Badge } from "react-bootstrap";
|
|
import { Badge } from "react-bootstrap";
|
|
import Metadata from "./Metadata";
|
|
import Metadata from "./Metadata";
|
|
import Bags from "./Bags";
|
|
import Bags from "./Bags";
|
|
import StatusBadge from "./StatusBadge";
|
|
import StatusBadge from "./StatusBadge";
|
|
|
|
+import { testQN } from "./util";
|
|
import { Operator, Bucket } from "./types";
|
|
import { Operator, Bucket } from "./types";
|
|
|
|
|
|
const BucketRow = (props: { isDP: boolean; bucket: Bucket }) => {
|
|
const BucketRow = (props: { isDP: boolean; bucket: Bucket }) => {
|
|
const [show, setShow] = useState(false);
|
|
const [show, setShow] = useState(false);
|
|
|
|
+ const [hasQN, setQN] = useState(false);
|
|
|
|
+ const [qnTitle, setTitle] = useState(``);
|
|
const { isDP, bucket } = props;
|
|
const { isDP, bucket } = props;
|
|
const { id, distributing, acceptingNewBags, bags, operatorMetadata } = bucket;
|
|
const { id, distributing, acceptingNewBags, bags, operatorMetadata } = bucket;
|
|
const operator = isDP ? bucket.operators[0] : { metadata: operatorMetadata };
|
|
const operator = isDP ? bucket.operators[0] : { metadata: operatorMetadata };
|
|
|
|
+
|
|
|
|
+ useEffect(() => testQN(operator, setQN, setTitle));
|
|
|
|
+
|
|
return (
|
|
return (
|
|
<>
|
|
<>
|
|
<div key={id} className="d-flex flex-row" onClick={() => setShow(!show)}>
|
|
<div key={id} className="d-flex flex-row" onClick={() => setShow(!show)}>
|
|
|
|
+ <StatusBadge
|
|
|
|
+ status={hasQN}
|
|
|
|
+ label={"Q"}
|
|
|
|
+ title={(hasQN ? "" : "no ") + "functional query node: " + qnTitle}
|
|
|
|
+ />
|
|
|
|
+
|
|
<div className="col-1 text-right d-flex justify-content-between">
|
|
<div className="col-1 text-right d-flex justify-content-between">
|
|
<h3>{id}</h3>
|
|
<h3>{id}</h3>
|
|
{isDP && (
|
|
{isDP && (
|