Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

F/implement new landing #388

Merged
merged 50 commits into from
May 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
527c8a9
fix(typescript): Fix typescript no strict mode
fnbellomo Dec 18, 2022
efe5656
WIP commit
selankon Feb 10, 2023
54b86b0
chore(rxPage): create landing icons
selankon Feb 17, 2023
5e7e93d
chore(rxPage): create new landing sections
selankon Feb 17, 2023
75d9c83
chore(rxPage): fix section title color
selankon Feb 21, 2023
877e4d2
chore(rxPage): create path component
selankon Feb 21, 2023
08d575a
chore(rxPage): fix paddings and sizes
selankon Feb 21, 2023
aea0523
chore(rxPage): create path svg
selankon Feb 21, 2023
d71cc63
chore(rxPage): implement bad path color
selankon Feb 21, 2023
1f338ff
chore(rxPage): implement button component
selankon Feb 22, 2023
69e3728
chore(rxPage): bulk styling
selankon Feb 22, 2023
e7d61a3
chore(rxPage): fix path size
selankon Feb 22, 2023
8c2e4de
chore(rxPage): implement new internet status
selankon Feb 22, 2023
392744c
chore(rxPage): migrate to TS
selankon Feb 23, 2023
26248f6
chore(rxPage): minor fixes
selankon Feb 23, 2023
ff7605e
chore(rxPage): add loading message
selankon Feb 23, 2023
9e4dd36
chore(rxPage): improve loading and buttons
selankon Feb 27, 2023
f83a2f4
chore(metrics): implement get all loose
selankon Mar 1, 2023
ddb6ee3
chore(metrics): implement single loose query
selankon Mar 2, 2023
a1e3db9
chore(metrics): implement three loading dots
selankon Mar 2, 2023
a7ce737
chore(metrics): implement loading loose path
selankon Mar 2, 2023
7334646
chore(metrics): run loose check when no internet
selankon Mar 2, 2023
8fc48d6
chore(metrics): refactor name
selankon Mar 7, 2023
cd232bf
chore(rxPage): improve components
selankon Mar 9, 2023
d8759ed
chore(rxPage): implement alignment section
selankon Mar 9, 2023
2215292
chore(rxPage): multiple styling
selankon Mar 9, 2023
ad06c65
chore(rxPage): implement ports
selankon Mar 9, 2023
568fd2c
chore(rxPage): add footer
selankon Mar 13, 2023
5e10285
chore(rxPage): add style
selankon Mar 13, 2023
de48c7f
chore(rxPage): implement signal color
selankon Mar 13, 2023
681a911
chore(rxPage): write wired tests
selankon Mar 15, 2023
2468ebc
chore(rxPage): write alignment tests
selankon Mar 15, 2023
e4049fa
chore(rxPage): write internet path tests
selankon Mar 17, 2023
0d147eb
chore(rxPage): disable mocks
selankon Mar 20, 2023
c7193d0
chore(rxPage): fix get_loss
selankon Mar 22, 2023
53f5fca
chore(rxPage): automatize get all loss
selankon Mar 22, 2023
4d22fe5
chore(rxPage): fix bad internet path color
selankon Mar 22, 2023
e38a4db
chore(rxPage): prevent null
selankon Mar 23, 2023
1c469c9
chore(all): fix production build
selankon Apr 12, 2023
509ed38
chore(rxPage): add missing changes
selankon May 3, 2023
9ad7357
chore(rxPage): show last internet path not found
selankon Mar 12, 2024
375dc48
chore(rxPage): fix main layout
selankon Mar 12, 2024
f72c34c
chore(rxPage): add missing icon
selankon Mar 12, 2024
8253e87
chore(rxPage): fix layout
selankon Mar 12, 2024
6c30aa9
chore(rxPage): show no wired connections found error message
selankon Mar 18, 2024
d1d2594
chore(rxPage): fix wired connections layout
selankon Mar 19, 2024
738fcf9
chore(rxPage): fix refetchLosses is not a function
selankon Mar 25, 2024
1884955
chore(rxPage): multiple fix
selankon May 6, 2024
55d3e24
chore(rxPage): multiple fix
selankon May 6, 2024
86e2431
chore(rxPage): fix rebase
selankon May 7, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ storybook-static
build
package-lock.json
i18n
tailwind.config.js
20 changes: 0 additions & 20 deletions .linguirc

This file was deleted.

23 changes: 23 additions & 0 deletions lingui.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/** @type {import('@lingui/conf').LinguiConfig} */
module.exports = {
locales: ["es", "pt", "en", "it"],
catalogs: [
{
path: "i18n/{locale}/messages",
include: ["src", "plugins"],
},
],
format: "po",
compileNamespace: "cjs",
extractBabelOptions: {
presets: [
"preact",
"@babel/preset-typescript",
"@lingui/babel-preset-react",
],
},
sourceLocale: "en",
fallbackLocales: {
default: "en",
},
};
610 changes: 428 additions & 182 deletions package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@
"devDependencies": {
"@babel/preset-react": "^7.18.6",
"@lingui/babel-preset-react": "^2.9.2",
"@lingui/cli": "^3.14.0",
"@lingui/detect-locale": "^3.14.0",
"@lingui/loader": "^3.14.0",
"@lingui/macro": "^3.14.0",
"@lingui/cli": "^3.17.2",
"@lingui/detect-locale": "^3.17.2",
"@lingui/loader": "^3.17.2",
"@lingui/macro": "^3.17.2",
"@storybook/addon-actions": "^6.5.12",
"@storybook/addon-controls": "^6.5.12",
"@storybook/addon-essentials": "^6.5.12",
Expand Down
8 changes: 6 additions & 2 deletions plugins/lime-plugin-metrics/src/metricsApi.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import api from "utils/uhttpd.service";

export const getMetrics = (ip) => {
console.log("getting metrics for ", ip);
return api.call("lime-metrics", "get_metrics", { target: ip });
};

export const getGateway = () =>
api.call("lime-metrics", "get_gateway", {}).then((res) => res.gateway);

export const getPath = () =>
export const getPath = async () =>
api.call("lime-metrics", "get_path", {}).then((res) => res.path);

export const getLoss = async (ip) =>
api
.call("lime-metrics", "get_loss", { target: ip })
.then((res) => +res.loss);
30 changes: 29 additions & 1 deletion plugins/lime-plugin-metrics/src/metricsQueries.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useQuery } from "@tanstack/react-query";

import queryCache from "utils/queryCache";

import { getGateway, getMetrics, getPath } from "./metricsApi";
import { getGateway, getLoss, getMetrics, getPath } from "./metricsApi";

export function useMetrics(ip, params) {
return useQuery(["lime-metrics", "get_metrics", ip], () => getMetrics(ip), {
Expand Down Expand Up @@ -42,3 +42,31 @@ export function useGateway(params) {
export function usePath(params) {
return useQuery(["lime-metrics", "get_path"], getPath, params);
}

export function useLoss(ip, params) {
return useQuery(["lime-metrics", "get_loss", ip], () => getLoss(ip), {
retry: false,
...params,
});
}

export const getAllLoss = async (nodes) => {
let losses = {};
for (const node of nodes) {
const queryKey = ["lime-metrics", "get_loss", node.ip];
await queryCache.invalidateQueries(queryKey);
losses[node.ip] = await queryCache.fetchQuery(queryKey);
}
return losses;
};

export function usePathLoss(nodes, params) {
return useQuery(
["lime-metrics", "get_loss", nodes],
(query) => getAllLoss(query.queryKey[2]),
{
retry: false,
...params,
}
);
}
30 changes: 30 additions & 0 deletions plugins/lime-plugin-rx/src/components/components.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { ComponentChildren, FunctionalComponent } from "preact";

export const IconsClassName = "h-14 w-14";

interface SectionTitleProps {
children?: ComponentChildren;
icon: ComponentChildren;
}

export const SectionTitle: FunctionalComponent<SectionTitleProps> = ({
children,
icon,
}) => {
return (
<div className="flex items-center gap-x-4 ml-6 mt-6">
<span className={"text-primary-dark fill-current"}>{icon}</span>
<h1 className="text-4xl font-bold text-left">{children}</h1>
</div>
);
};

export const Section = ({ ...props }) => {
return (
<div className={"w-full container "}>
<div className="w-full" {...props}>
{props.children}
</div>
</div>
);
};
52 changes: 52 additions & 0 deletions plugins/lime-plugin-rx/src/components/footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
import { Trans } from "@lingui/macro";

export const Footer = () => {
const imgClass = "h-16";
return (
<div
className={
"z-50 fixed bottom-0 w-full flex justify-around content-center items-center"
}
>
<div>
<img
src={"assets/icons/AlterMundiLogo.svg"}
className={imgClass}
/>
</div>
<div className={"flex flex-col text-center text-xl"}>
<div className={"italic font-normal text-2xl"}>
<Trans>Need support?</Trans>
</div>
<div>
<Trans>
Join{" "}
<a
className={"text-[#0198FE] hover:text-[#F39100]"}
href={"https://foro.librerouter.org"}
>
foro.librerouter.org
</a>
</Trans>
</div>
<div>
<Trans>
Visit{" "}
<a
className={"text-[#F39100] hover:text-[#0198FE]"}
href={"https://docs.altermundi.net"}
>
docs.altermundi.net
</a>
</Trans>
</div>
</div>
<div>
<img
src={"assets/icons/LibreRouterLogo.svg"}
className={imgClass}
/>
</div>
</div>
);
};
Loading
Loading