Skip to content

Commit

Permalink
Running prettier to format
Browse files Browse the repository at this point in the history
  • Loading branch information
ch-iara committed Jun 3, 2022
1 parent e10de55 commit 188783c
Show file tree
Hide file tree
Showing 83 changed files with 403 additions and 388 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"settings": {
"react": {
"version": "detect"
}
}
},
"rules": {
"prettier/prettier": "warn"
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ on:
pull_request:
branches: [master]


jobs:
build-althea-dash:
runs-on: ubuntu-latest
Expand All @@ -19,4 +18,4 @@ jobs:
steps:
- uses: actions/checkout@v2
- name: Build
run: yarn && yarn test
run: yarn && yarn test
12 changes: 6 additions & 6 deletions craco.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const fs = require("fs");
const glob = require("glob-all");

const appDirectory = fs.realpathSync(process.cwd());
const resolveApp = relativePath => path.resolve(appDirectory, relativePath);
const resolveApp = (relativePath) => path.resolve(appDirectory, relativePath);

const PurgecssPlugin = require("purgecss-webpack-plugin");

Expand All @@ -13,9 +13,9 @@ module.exports = {
new PurgecssPlugin({
paths: [
resolveApp("public/index.html"),
...glob.sync(`${resolveApp("src")}/**/**/*`, { nodir: true })
]
})
]
}
...glob.sync(`${resolveApp("src")}/**/**/*`, { nodir: true }),
],
}),
],
},
};
90 changes: 48 additions & 42 deletions public/_font.scss
Original file line number Diff line number Diff line change
@@ -1,59 +1,65 @@
@font-face {
font-family: "Akkurat";
src: url("../fonts_subsetted/lineto-akkurat-bold.eot");
src: url("../fonts_subsetted/lineto-akkurat-bold.eot?#iefix") format("embedded-opentype"),
url("../fonts_subsetted/lineto-akkurat-bold.woff2") format("woff2"),
url("../fonts_subsetted/lineto-akkurat-bold.woff") format("woff");
font-weight: bold;
font-style: normal;
font-family: "Akkurat";
src: url("../fonts_subsetted/lineto-akkurat-bold.eot");
src: url("../fonts_subsetted/lineto-akkurat-bold.eot?#iefix")
format("embedded-opentype"),
url("../fonts_subsetted/lineto-akkurat-bold.woff2") format("woff2"),
url("../fonts_subsetted/lineto-akkurat-bold.woff") format("woff");
font-weight: bold;
font-style: normal;
}

@font-face {
font-family: "Akkurat";
src: url("../fonts_subsetted/lineto-akkurat-bolditalic.eot");
src: url("../fonts_subsetted/lineto-akkurat-bolditalic.eot?#iefix") format("embedded-opentype"),
url("../fonts_subsetted/lineto-akkurat-bolditalic.woff2") format("woff2"),
url("../fonts_subsetted/lineto-akkurat-bolditalic.woff") format("woff");
font-weight: bold;
font-style: italic;
font-family: "Akkurat";
src: url("../fonts_subsetted/lineto-akkurat-bolditalic.eot");
src: url("../fonts_subsetted/lineto-akkurat-bolditalic.eot?#iefix")
format("embedded-opentype"),
url("../fonts_subsetted/lineto-akkurat-bolditalic.woff2") format("woff2"),
url("../fonts_subsetted/lineto-akkurat-bolditalic.woff") format("woff");
font-weight: bold;
font-style: italic;
}

@font-face {
font-family: "Akkurat";
src: url("../fonts_subsetted/lineto-akkurat-italic.eot");
src: url("../fonts_subsetted/lineto-akkurat-italic.eot?#iefix") format("embedded-opentype"),
url("../fonts_subsetted/lineto-akkurat-italic.woff2") format("woff2"),
url("../fonts_subsetted/lineto-akkurat-italic.woff") format("woff");
font-weight: normal;
font-style: italic;
font-family: "Akkurat";
src: url("../fonts_subsetted/lineto-akkurat-italic.eot");
src: url("../fonts_subsetted/lineto-akkurat-italic.eot?#iefix")
format("embedded-opentype"),
url("../fonts_subsetted/lineto-akkurat-italic.woff2") format("woff2"),
url("../fonts_subsetted/lineto-akkurat-italic.woff") format("woff");
font-weight: normal;
font-style: italic;
}

@font-face {
font-family: "Akkurat";
src: url("../fonts_subsetted/lineto-akkurat-light.eot");
src: url("../fonts_subsetted/lineto-akkurat-light.eot?#iefix") format("embedded-opentype"),
url("../fonts_subsetted/lineto-akkurat-light.woff2") format("woff2"),
url("../fonts_subsetted/lineto-akkurat-light.woff") format("woff");
font-weight: 200;
font-style: normal;
font-family: "Akkurat";
src: url("../fonts_subsetted/lineto-akkurat-light.eot");
src: url("../fonts_subsetted/lineto-akkurat-light.eot?#iefix")
format("embedded-opentype"),
url("../fonts_subsetted/lineto-akkurat-light.woff2") format("woff2"),
url("../fonts_subsetted/lineto-akkurat-light.woff") format("woff");
font-weight: 200;
font-style: normal;
}

@font-face {
font-family: "Akkurat";
src: url("../fonts_subsetted/lineto-akkurat-lightitalic.eot");
src: url("../fonts_subsetted/lineto-akkurat-lightitalic.eot?#iefix") format("embedded-opentype"),
url("../fonts_subsetted/lineto-akkurat-lightitalic.woff2") format("woff2"),
url("../fonts_subsetted/lineto-akkurat-lightitalic.woff") format("woff");
font-weight: lighter;
font-style: italic;
font-family: "Akkurat";
src: url("../fonts_subsetted/lineto-akkurat-lightitalic.eot");
src: url("../fonts_subsetted/lineto-akkurat-lightitalic.eot?#iefix")
format("embedded-opentype"),
url("../fonts_subsetted/lineto-akkurat-lightitalic.woff2") format("woff2"),
url("../fonts_subsetted/lineto-akkurat-lightitalic.woff") format("woff");
font-weight: lighter;
font-style: italic;
}

@font-face {
font-family: "Akkurat";
src: url("../fonts_subsetted/lineto-akkurat-regular.eot");
src: url("../fonts_subsetted/lineto-akkurat-regular.eot?#iefix") format("embedded-opentype"),
url("../fonts_subsetted/lineto-akkurat-regular.woff2") format("woff2"),
url("../fonts_subsetted/lineto-akkurat-regular.woff") format("woff");
font-weight: normal;
font-style: normal;
font-family: "Akkurat";
src: url("../fonts_subsetted/lineto-akkurat-regular.eot");
src: url("../fonts_subsetted/lineto-akkurat-regular.eot?#iefix")
format("embedded-opentype"),
url("../fonts_subsetted/lineto-akkurat-regular.woff2") format("woff2"),
url("../fonts_subsetted/lineto-akkurat-regular.woff") format("woff");
font-weight: normal;
font-style: normal;
}
41 changes: 28 additions & 13 deletions public/index.html
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="apple-touch-icon" sizes="180x180" href="%PUBLIC_URL%/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="%PUBLIC_URL%/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="%PUBLIC_URL%/favicon-16x16.png">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#002b36">
<meta name="msapplication-TileColor" content="#00aba9">
<meta name="theme-color" content="#ffffff">
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="theme-color" content="#000000" />
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link
rel="apple-touch-icon"
sizes="180x180"
href="%PUBLIC_URL%/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="%PUBLIC_URL%/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="%PUBLIC_URL%/favicon-16x16.png"
/>
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#002b36" />
<meta name="msapplication-TileColor" content="#00aba9" />
<meta name="theme-color" content="#ffffff" />
<title>Althea Router Dashboard</title>
</head>
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<noscript> You need to enable JavaScript to run this app. </noscript>
<div id="root"></div>
</body>
</html>
34 changes: 17 additions & 17 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"name": "Althea Dashboard",
"short_name": "Althea Dashboard",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-256x256.png",
"sizes": "256x256",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
"name": "Althea Dashboard",
"short_name": "Althea Dashboard",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-256x256.png",
"sizes": "256x256",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
14 changes: 7 additions & 7 deletions src/AdvancedSettings/AdvancedDebugging.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const AdvancedDebugging = () => {
const [{ isGateway, neighbors, selectedExit }, dispatch] = useStore();

const getNeighbors = useCallback(
async signal => {
async (signal) => {
try {
let neighbors = await get("/neighbors", true, 10000, signal);
if (neighbors instanceof Error) return;
Expand All @@ -38,25 +38,25 @@ const AdvancedDebugging = () => {
}

let hasNeighborRoute =
neighbors.filter(n => n.routeMetric < 65000).length > 0;
neighbors.filter((n) => n.routeMetric < 65000).length > 0;

let hasExitRoute =
neighbors.filter(n => n.routeMetricToExit < 65000).length > 0;
neighbors.filter((n) => n.routeMetricToExit < 65000).length > 0;

let indicators = {
haveRoute,
isReachable,
isTunnelWorking
isTunnelWorking,
};

if (!isGateway)
indicators = {
hasNeighborRoute,
hasExitRoute,
...indicators
...indicators,
};

const haveProblem = Object.values(indicators).findIndex(v => !v) >= 0;
const haveProblem = Object.values(indicators).findIndex((v) => !v) >= 0;

useInterval(getNeighbors, 10000);

Expand All @@ -66,7 +66,7 @@ const AdvancedDebugging = () => {
<h4>{t("advancedDebugging")}</h4>
</div>
<div>
{Object.keys(indicators).map(indicator => (
{Object.keys(indicators).map((indicator) => (
<div className="mb-2" key={indicator}>
<Indicator condition={indicators[indicator]} />
{t(indicator)}
Expand Down
8 changes: 4 additions & 4 deletions src/AdvancedSettings/BandwidthLimit.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import {
InputGroupAddon,
InputGroupText,
Label,
Progress
Progress,
} from "reactstrap";
import { get, post } from "store";
import { Card } from "ui";
Expand Down Expand Up @@ -57,7 +57,7 @@ const BandwidthLimit = () => {
}
}

const submit = async e => {
const submit = async (e) => {
e.preventDefault();
setLoading(true);

Expand Down Expand Up @@ -95,7 +95,7 @@ const BandwidthLimit = () => {
name="bandwidth"
id="selfLimitSpeed"
placeholder={t("enterSpeed")}
onChange={e => {
onChange={(e) => {
setLimit(e.target.value);
setUnsavedChanges(true);
}}
Expand All @@ -108,7 +108,7 @@ const BandwidthLimit = () => {
style={{
background: "#F8F9FA",
fontSize: 14,
color: "#888"
color: "#888",
}}
>
Mbps
Expand Down
4 changes: 2 additions & 2 deletions src/AdvancedSettings/BandwidthSelling.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const BandwidthSelling = () => {
const [t] = useTranslation();
const [{ sellingBandwidth }, dispatch] = useStore();

const check = e => {
const check = (e) => {
dispatch({ type: "sellingBandwidth", sellingBandwidth: !sellingBandwidth });
};

Expand All @@ -28,7 +28,7 @@ const BandwidthSelling = () => {
</Form>
<p
dangerouslySetInnerHTML={{
__html: t("learnMoreAboutTheEquipment")
__html: t("learnMoreAboutTheEquipment"),
}}
/>
</CardBody>
Expand Down
6 changes: 3 additions & 3 deletions src/AdvancedSettings/Blockchain.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
CardBody,
Form,
FormGroup,
Input
Input,
} from "reactstrap";
import { get, post, useStore } from "store";

Expand Down Expand Up @@ -35,7 +35,7 @@ const Blockchain = () => {

if (!blockchain || !newBlockchain) return null;

let submit = async e => {
let submit = async (e) => {
e.preventDefault();
try {
await post(`/blockchain/set/${newBlockchain}`);
Expand Down Expand Up @@ -64,7 +64,7 @@ const Blockchain = () => {
label={t("blockchain")}
name="blockchain"
placeholder={t("enterBlockchain")}
onChange={e => setBlockchain(e.target.value)}
onChange={(e) => setBlockchain(e.target.value)}
value={newBlockchain}
type="select"
className="mr-2 mb-2"
Expand Down
Loading

0 comments on commit 188783c

Please sign in to comment.