From 04427c5078c07a438080ad3e413d7733604c56b9 Mon Sep 17 00:00:00 2001 From: Age Manning Date: Tue, 14 Feb 2023 16:35:54 +1100 Subject: [PATCH 1/5] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++ 2 files changed, 58 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 00000000..dd84ea78 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 00000000..bbcbbe7d --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From 84322b15bd4e553973413103b87d90fa03cc67c9 Mon Sep 17 00:00:00 2001 From: Age Manning Date: Tue, 14 Feb 2023 16:38:49 +1100 Subject: [PATCH 2/5] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 4 ++-- .github/ISSUE_TEMPLATE/feature_request.md | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index dd84ea78..dcb15153 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,8 +2,8 @@ name: Bug report about: Create a report to help us improve title: '' -labels: '' -assignees: '' +labels: bug +assignees: rickimoore --- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7d..a097ed20 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,8 +2,8 @@ name: Feature request about: Suggest an idea for this project title: '' -labels: '' -assignees: '' +labels: enhancement +assignees: rickimoore --- From 7be84260c7d1c8b4b5a40e28fe9b5b5d3c19c98f Mon Sep 17 00:00:00 2001 From: Ricki Moore Date: Tue, 14 Feb 2023 13:05:14 +0000 Subject: [PATCH 3/5] Fix/device health overview (#110) --- src/components/DiagnosticTable/HardwareInfo.tsx | 4 ++-- src/components/HealthCheck/DeviceHealth.tsx | 4 ++-- src/components/HealthCheck/HealthOverview.tsx | 16 ++++++++++++---- src/locales/translations/en-US.json | 4 +++- src/utilities/addSuffixString.ts | 2 +- 5 files changed, 20 insertions(+), 10 deletions(-) diff --git a/src/components/DiagnosticTable/HardwareInfo.tsx b/src/components/DiagnosticTable/HardwareInfo.tsx index a0feb462..ec6838dd 100644 --- a/src/components/DiagnosticTable/HardwareInfo.tsx +++ b/src/components/DiagnosticTable/HardwareInfo.tsx @@ -53,7 +53,7 @@ const HardwareInfo = () => { maxHeight='flex-1' size={size} border='border-t-0 border-style500' - metric={addSuffixString(totalDiskSpace.toFixed(1), 'GB')} + metric={addSuffixString(Math.round(totalDiskSpace), 'GB')} subTitle={t('utilization', { percent: diskUtilization })} status={diskStatus} /> @@ -71,7 +71,7 @@ const HardwareInfo = () => { maxHeight='flex-1' size={size} border='border-t-0 border-style500' - metric={addSuffixString(totalMemory.toFixed(1), 'GB')} + metric={addSuffixString(Math.round(totalMemory), 'GB')} subTitle={t('utilization', { percent: memoryUtilization })} status={ramStatus} /> diff --git a/src/components/HealthCheck/DeviceHealth.tsx b/src/components/HealthCheck/DeviceHealth.tsx index 8d404b8c..10e39ff1 100644 --- a/src/components/HealthCheck/DeviceHealth.tsx +++ b/src/components/HealthCheck/DeviceHealth.tsx @@ -25,7 +25,7 @@ const DeviceHealth = () => { @@ -39,7 +39,7 @@ const DeviceHealth = () => { diff --git a/src/components/HealthCheck/HealthOverview.tsx b/src/components/HealthCheck/HealthOverview.tsx index ebd6ebb3..c301d33d 100644 --- a/src/components/HealthCheck/HealthOverview.tsx +++ b/src/components/HealthCheck/HealthOverview.tsx @@ -8,9 +8,12 @@ import { Trans, useTranslation } from 'react-i18next' const HealthOverview = () => { const { t } = useTranslation() - const { totalDiskFree, uptime, healthCondition, overallHealthStatus } = useDeviceDiagnostics() + const { totalDiskFree, uptime, healthCondition, overallHealthStatus, ramStatus, cpuStatus } = + useDeviceDiagnostics() const isSufficientSpace = totalDiskFree > 240 + const isSufficientRam = ramStatus === 'bg-success' + const isSufficientCpu = cpuStatus === 'bg-success' return (
@@ -27,10 +30,15 @@ const HealthOverview = () => { text={t(`vcHealthCheck.${isSufficientSpace ? 'hasDiskSpace' : 'noDiskSpace'}`)} /> + -
diff --git a/src/locales/translations/en-US.json b/src/locales/translations/en-US.json index 0f46df9a..154bc18f 100644 --- a/src/locales/translations/en-US.json +++ b/src/locales/translations/en-US.json @@ -144,8 +144,10 @@ "hasDiskSpace": "Disk has the required 240GB for the full sync.", "noDiskSpace": "Disk does not have the required 240GB for the full sync.", "cpuRecommendation": "2.4GHZ is recommended for CPU.", + "hasCpuReq": "CPU has recommended frequency.", "healthCondition": "HEALTH CHECK — in {{status}} Condition.", - "checkLowRam": "Please ensure your RAM is sufficient prior to starting validating." + "checkLowRam": "Please ensure your RAM is sufficient prior to start validating.", + "hasRam": "Node has sufficient memory." }, "appDescription": { "developedBy": "Developed & Secured By:", diff --git a/src/utilities/addSuffixString.ts b/src/utilities/addSuffixString.ts index bad3f129..112c5858 100644 --- a/src/utilities/addSuffixString.ts +++ b/src/utilities/addSuffixString.ts @@ -1,3 +1,3 @@ -const addSuffixString = (text: string, suffix: string) => `${text} ${suffix}` +const addSuffixString = (text: string | number, suffix: string) => `${text} ${suffix}` export default addSuffixString From d7203144fc5ca7fb8390a31f4fd8c8780f8a63c3 Mon Sep 17 00:00:00 2001 From: antondlr Date: Wed, 15 Feb 2023 05:49:38 +0100 Subject: [PATCH 4/5] Add dockerfiles, add prod deps (#69) --- Dockerfile | 21 +++++++++++++++++++++ Dockerfile.dev | 12 ++++++++++++ README.md | 14 +++++++++++++- 3 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 Dockerfile create mode 100644 Dockerfile.dev diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..0388f33a --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +ARG node_version=16.16 +ARG node_image=node:${node_version} + +# STAGE 1: builder +FROM $node_image AS builder + +COPY . /app/ +WORKDIR /app + +ENV NODE_ENV=development +# install (dev) deps +RUN yarn + +ENV NODE_ENV=production +# build (prod) app +RUN yarn build + +# STAGE 2 +FROM nginx:alpine AS production + +COPY --from=builder /app/build/ /usr/share/nginx/html/ diff --git a/Dockerfile.dev b/Dockerfile.dev new file mode 100644 index 00000000..ab3dedec --- /dev/null +++ b/Dockerfile.dev @@ -0,0 +1,12 @@ +ARG node_version=16.16 +ARG node_image=node:${node_version} +FROM $node_image + +ENV NODE_ENV=development + +EXPOSE 5000/tcp +COPY . /app/ +WORKDIR /app + +RUN yarn install +CMD ["yarn", "run", "dev"] diff --git a/README.md b/README.md index 1440e936..aa3e7aea 100644 --- a/README.md +++ b/README.md @@ -77,4 +77,16 @@ yarn Then run local server and electron by running: ```bash yarn dev -``` \ No newline at end of file +``` + +## Run webapp in docker + +build image: +`docker build -t lighthouse-ui -f Dockerfile .` + +run it: +`docker run --rm -ti -name lh-ui -p 80:80 lighthouse-ui` + +If you're diskspace-constrained, make sure to clear your builder cache (when using buildx) or prune images (regular build) since the intermediate image is quite large (3.5 - 4.5GB to be reclaimed). + +a Dockerfile for a dev environment is also provided: `Dockerfile.dev` \ No newline at end of file From 3173fe2a54f94664d67f3401a6e691a630c148d2 Mon Sep 17 00:00:00 2001 From: Age Manning Date: Wed, 15 Feb 2023 16:06:28 +1100 Subject: [PATCH 5/5] Target branch CI check (#112) --- .github/workflows/ui-tests.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/ui-tests.yml b/.github/workflows/ui-tests.yml index 6594700c..c94ba70d 100644 --- a/.github/workflows/ui-tests.yml +++ b/.github/workflows/ui-tests.yml @@ -3,6 +3,13 @@ name: 'UI Tests' on: push jobs: + target-branch-check: + name: target-branch-check + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + steps: + - name: Check that the pull request is not targeting the stable branch + run: test ${{ github.base_ref }} != "stable" # Run interaction and accessibility tests build-storybook: runs-on: ubuntu-latest