Skip to content

Commit

Permalink
[js] clean up linting errors in Grid UI
Browse files Browse the repository at this point in the history
  • Loading branch information
AutomatedTester committed Sep 25, 2020
1 parent 524503e commit eb9477a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 1 addition & 2 deletions javascript/grid-ui/src/screens/Console/Console.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,7 @@ export default function Console(props: {
if (capStr === "") return { ...node, capabilities: [] };
let json: { [key: string]: number } = JSON.parse(capStr);
let capabilities = Object.keys(json).map((key) => {
let data = key
.split("{")
key.split("{")
.slice(1)
.join("")
.replace(/}/g, "")
Expand Down
9 changes: 4 additions & 5 deletions javascript/grid-ui/src/screens/Hub/Hub.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ function ringReducer(state: RingDetails, action: { type: string; args?: any }) {
}

export default function Hubpage() {
let [currentIndex] = useState(0);
let [slots, setSlots] = useState({ usedSlots: 0, totalSlots: 0 });
let [_renderedLoad, _setRenderedLoad] = useState(false);
let [dataAvailable, setDataAvailable] = useState<NodeType[]>([]);
Expand All @@ -69,9 +68,9 @@ export default function Hubpage() {
const sum = Object.values(countHash).reduce((a, b) => a + b, 0);
// Initialize the 4 rings
LABELS.forEach((l, i) => {
const percent = Math.round((countHash[l] / sum) * 100);
addRing(percent, i);
});
const percent = Math.round((countHash[l] / sum) * 100);
addRing(percent, i);
});

setDataAvailable(gridInfo.grid.nodes);
setSlots({
Expand Down Expand Up @@ -134,7 +133,7 @@ export default function Hubpage() {
bar.text.style.fontSize = "2rem";

// usedSlots/TotalSlots
// need to fix thjis animation
// need to fix this animation
//bar.animate(slots.usedSlots / slots.totalSlots); // Number from 0.0 to 1.0
_setRenderedLoad(true);
}, [dataAvailable, slots, _renderedLoad]);
Expand Down

0 comments on commit eb9477a

Please sign in to comment.