setSearch(e.target.value)}
/>
diff --git a/src/pages/Overview.tsx b/src/pages/Overview.tsx
index fd162b5..cffcb10 100644
--- a/src/pages/Overview.tsx
+++ b/src/pages/Overview.tsx
@@ -18,37 +18,6 @@ import type { Connection } from '~/types'
const CHART_MAX_XAXIS = 10
-const defaultChartOptions: ApexOptions = {
- chart: {
- toolbar: { show: false },
- zoom: { enabled: false },
- animations: { easing: 'linear' },
- },
- noData: { text: 'Loading...' },
- legend: {
- fontSize: '14px',
- labels: { colors: 'gray' },
- itemMargin: { horizontal: 64 },
- },
- dataLabels: { enabled: false },
- grid: { yaxis: { lines: { show: false } } },
- stroke: { curve: 'smooth' },
- tooltip: { enabled: false },
- xaxis: {
- range: CHART_MAX_XAXIS,
- labels: { show: false },
- axisTicks: { show: false },
- },
- yaxis: {
- labels: {
- style: { colors: 'gray' },
- formatter(val) {
- return byteSize(val).toString()
- },
- },
- },
-}
-
const TrafficWidget: ParentComponent<{ label: JSX.Element }> = (props) => (
{props.label}
@@ -60,6 +29,7 @@ const TrafficWidget: ParentComponent<{ label: JSX.Element }> = (props) => (
export default () => {
const [t] = useI18n()
+
const [traffics, setTraffics] = createSignal<{ down: number; up: number }[]>(
[],
)
@@ -99,18 +69,53 @@ export default () => {
}
})
+ const defaultChartOptions: ApexOptions = {
+ chart: {
+ toolbar: { show: false },
+ zoom: { enabled: false },
+ animations: { easing: 'linear' },
+ },
+ noData: { text: 'Loading...' },
+ legend: {
+ fontSize: '14px',
+ labels: { colors: 'gray' },
+ itemMargin: { horizontal: 64 },
+ },
+ dataLabels: { enabled: false },
+ grid: { yaxis: { lines: { show: false } } },
+ stroke: { curve: 'smooth' },
+ tooltip: { enabled: false },
+ xaxis: {
+ range: CHART_MAX_XAXIS,
+ labels: { show: false },
+ axisTicks: { show: false },
+ },
+ yaxis: {
+ labels: {
+ style: { colors: 'gray' },
+ formatter(val) {
+ return byteSize(val).toString()
+ },
+ },
+ },
+ }
+
const trafficChartOptions = createMemo
(() => ({
- title: { text: 'Traffic', align: 'center', style: { color: 'gray' } },
+ title: {
+ text: t('traffic'),
+ align: 'center',
+ style: { color: 'gray' },
+ },
...defaultChartOptions,
}))
const trafficChartSeries = createMemo(() => [
{
- name: 'Down',
+ name: t('down'),
data: traffics().map((t) => t.down),
},
{
- name: 'Up',
+ name: t('up'),
data: traffics().map((t) => t.up),
},
])
@@ -138,16 +143,15 @@ export default () => {
})
const memoryChartOptions = createMemo(() => ({
- title: { text: 'Memory', align: 'center', style: { color: 'gray' } },
+ title: {
+ text: t('memory'),
+ align: 'center',
+ style: { color: 'gray' },
+ },
...defaultChartOptions,
}))
- const memoryChartSeries = createMemo(() => [
- {
- name: 'memory',
- data: memories(),
- },
- ])
+ const memoryChartSeries = createMemo(() => [{ data: memories() }])
const connectionsWS = createReconnectingWS(
`${wsEndpointURL()}/connections?token=${secret()}`,
@@ -172,27 +176,27 @@ export default () => {
return (
-
+
{byteSize(traffic()?.up || 0).toString()}/s
-
+
{byteSize(traffic()?.down || 0).toString()}/s
-
+
{byteSize(connection()?.uploadTotal || 0).toString()}
-
+
{byteSize(connection()?.downloadTotal || 0).toString()}
-
+
{connection()?.connections.length || 0}
-
+
{byteSize(memory() || 0).toString()}
diff --git a/src/pages/Proxies.tsx b/src/pages/Proxies.tsx
index 6d0a73f..7408a85 100644
--- a/src/pages/Proxies.tsx
+++ b/src/pages/Proxies.tsx
@@ -62,9 +62,9 @@ export default () => {
}
return (
-
+
-
{t('proxies.proxies')}
+ {t('proxies')}
{
@@ -119,68 +119,75 @@ export default () => {
0}>
- {t('proxies.proxyProvider')}
+
+
{t('proxyProviders')}
-
{
- const title = (
- <>
-
-
{proxyProvider.name}
-
-
-
+
{
+ const title = (
+ <>
+
+
{proxyProvider.name}
+
+
+
+
-
-
-
- {proxyProvider.vehicleType} :: Updated{' '}
- {formatTimeFromNow(proxyProvider.updatedAt)}
-
-
- i.name) ?? []
- }
+
-
- >
- )
- const content = (
-
i.name)}
- />
- )
+
+ {proxyProvider.vehicleType} :: Updated{' '}
+ {formatTimeFromNow(proxyProvider.updatedAt)}
+
+
+ i.name) ?? []
+ }
+ />
+
+ >
+ )
- return (
-
- setCollapsedMap({
- ...collapsedMap(),
- [`provider-${proxyProvider.name}`]: val,
- })
- }
- />
- )
- })}
- />
+ const content = (
+ i.name)}
+ />
+ )
+
+ return (
+
+ setCollapsedMap({
+ ...collapsedMap(),
+ [`provider-${proxyProvider.name}`]: val,
+ })
+ }
+ />
+ )
+ })}
+ />
+
)
diff --git a/src/pages/Rules.tsx b/src/pages/Rules.tsx
index f0aac85..efcd190 100644
--- a/src/pages/Rules.tsx
+++ b/src/pages/Rules.tsx
@@ -1,9 +1,11 @@
+import { useI18n } from '@solid-primitives/i18n'
import InfiniteScroll from 'solid-infinite-scroll'
import { For, createMemo, createSignal, onMount } from 'solid-js'
import { useRequest } from '~/signals'
import type { Rule, RuleProvider } from '~/types'
export default () => {
+ const [t] = useI18n()
const request = useRequest()
const [maxRuleRender, setMaxRuleRender] = createSignal(100)
const [rules, setRules] = createSignal([])
@@ -27,7 +29,7 @@ export default () => {
return (
-
Rules
+
{t('rules')}
{
-
Rules Providers
+
{t('ruleProviders')}