Skip to content

Commit 40c9f43

Browse files
authored
Merge pull request #150 from ISISComputingGroup/make_faster
Make faster
2 parents eae8d3e + 4346116 commit 40c9f43

File tree

15 files changed

+1110
-377
lines changed

15 files changed

+1110
-377
lines changed

.eslintrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "next",
3+
"root": true
4+
}

.eslintrc.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Allows monitoring of instrument PVs via a web page.
1717
To install all dependencies, use:
1818

1919
```bash
20-
npm install
20+
npm ci
2121
```
2222

2323
### Running

app/Footer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from "react";
21
import Link from "next/link";
32

43
export default function Footer() {

app/components/Block.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"use client";
22
import { IfcBlock } from "@/app/types";
3-
import React, { useState } from "react";
3+
import { useState } from "react";
44

55
const grafana_stub =
66
"https://shadow.nd.rl.ac.uk/grafana/d/wMlwwaHMk/block-history?viewPanel=2&orgId=1&var-block=";

app/components/CheckToggle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React, { Dispatch, SetStateAction } from "react";
1+
import { Dispatch, SetStateAction } from "react";
22

33
export default function CheckToggle({
44
checked,

app/components/Group.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from "react";
21
import Block from "./Block";
32
import { checkIfAllBlocksInGroupAreHidden } from "./GroupUtils";
43

app/components/Groups.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import React from "react";
21
import Group from "./Group";
32

43
import { IfcGroup } from "@/app/types";

app/components/InstrumentData.tsx

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,6 @@
11
"use client";
2-
import React, { useEffect, useState } from "react";
3-
import {
4-
IfcPVWSMessage,
5-
IfcPVWSRequest,
6-
instList,
7-
PVWSRequestType,
8-
} from "@/app/types";
2+
import { useEffect, useState } from "react";
3+
import { IfcPVWSMessage, IfcPVWSRequest, PVWSRequestType } from "@/app/types";
94
import {
105
findPVInDashboard,
116
findPVInGroups,
@@ -58,12 +53,11 @@ export function InstrumentData({ instrumentName }: { instrumentName: string }) {
5853

5954
const {
6055
sendJsonMessage,
61-
lastJsonMessage,
6256
}: {
6357
sendJsonMessage: (a: IfcPVWSRequest) => void;
6458
lastJsonMessage: IfcPVWSMessage;
6559
} = useWebSocket(socketURL, {
66-
shouldReconnect: (closeEvent) => true,
60+
shouldReconnect: () => true,
6761
onOpen: () => {
6862
setWebSockErr("");
6963
setLastUpdate(""); // if this is called on a reconnect, we want to clear the last update so we can re-subscribe to everything again
@@ -175,7 +169,7 @@ export function InstrumentData({ instrumentName }: { instrumentName: string }) {
175169
}
176170
}
177171
},
178-
onError: (err) => {
172+
onError: () => {
179173
setWebSockErr(
180174
"Failed to connect to websocket - please check your network connection and contact Experiment Controls if this persists.",
181175
);

app/components/InstrumentsDisplay.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"use client";
2-
import { useEffect, useState } from "react";
2+
import { useState } from "react";
33
import {
44
IfcPVWSMessage,
55
IfcPVWSRequest,
@@ -58,13 +58,12 @@ export default function InstrumentsDisplay({
5858

5959
const {
6060
sendJsonMessage,
61-
lastJsonMessage,
6261
}: {
6362
sendJsonMessage: (a: IfcPVWSRequest) => void;
6463
lastJsonMessage: IfcPVWSMessage;
6564
} = useWebSocket(socketURL, {
66-
shouldReconnect: (closeEvent) => true,
67-
onError(err) {
65+
shouldReconnect: () => true,
66+
onError() {
6867
setWebSockErr(
6968
"Failed to connect to websocket - please check your network connection and contact Experiment Controls if this persists.",
7069
);

0 commit comments

Comments
 (0)