mantine update + passed to vite
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -16,6 +16,8 @@
|
||||
/backend/db/**
|
||||
/frontend/build/
|
||||
/frontend/build/**
|
||||
/frontend/dist/
|
||||
/frontend/dist/**
|
||||
/backend/modules/cppqueue
|
||||
/backend/modules/proxy
|
||||
docker-compose.yml
|
||||
|
||||
@@ -33,7 +33,7 @@ RUN g++ binsrc/nfqueue.cpp -o modules/cppqueue -O3 -lnetfilter_queue -pthread -l
|
||||
RUN g++ binsrc/proxy.cpp -o modules/proxy -O3 -pthread -lboost_system -lboost_thread -lpcre2-8
|
||||
|
||||
COPY ./backend/ /execute/
|
||||
COPY --from=frontend /app/build/ ./frontend/
|
||||
COPY --from=frontend /app/dist/ ./frontend/
|
||||
|
||||
CMD ["/bin/sh", "/execute/docker-entrypoint.sh"]
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
# 2.2.0 VERSION NEW TO IMPLEMENT
|
||||
- TODO: Need to fix mantine form validation
|
||||
- TODO: Merge edits in the main branch to this branch
|
||||
1. PCRE2 ---> HyperScan Streams (VectorScan for arm64 compatibility using debian Bookworm)
|
||||
2. nfregex from c++ to rust
|
||||
- https://crates.io/crates/hyperscan
|
||||
|
||||
5
frontend/globals.d.ts
vendored
5
frontend/globals.d.ts
vendored
@@ -1,5 +0,0 @@
|
||||
// declaration.d.ts
|
||||
declare module '*.scss' {
|
||||
const content: Record<string, string>;
|
||||
export default content;
|
||||
}
|
||||
@@ -18,5 +18,6 @@
|
||||
<body>
|
||||
<noscript>You need to enable JavaScript to run this app.</noscript>
|
||||
<div id="root"></div>
|
||||
<script type="module" src="/src/index.tsx"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -3,18 +3,20 @@
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"@mantine/core": "^4.2.8",
|
||||
"@mantine/form": "^4.2.8",
|
||||
"@mantine/hooks": "^4.2.8",
|
||||
"@mantine/modals": "^4.2.8",
|
||||
"@mantine/notifications": "^4.2.8",
|
||||
"@mantine/prism": "^4.2.8",
|
||||
"@mantine/spotlight": "^4.2.8",
|
||||
"@emotion/react": "^11.11.0",
|
||||
"@mantine/core": "^6.0.13",
|
||||
"@mantine/form": "^6.0.13",
|
||||
"@mantine/hooks": "^6.0.13",
|
||||
"@mantine/modals": "^6.0.13",
|
||||
"@mantine/notifications": "^6.0.13",
|
||||
"@mantine/prism": "^6.0.13",
|
||||
"@mantine/spotlight": "^6.0.13",
|
||||
"@testing-library/dom": "^9.3.0",
|
||||
"@testing-library/jest-dom": "^5.16.4",
|
||||
"@testing-library/react": "^13.3.0",
|
||||
"@testing-library/user-event": "^13.5.0",
|
||||
"@types/jest": "^27.5.2",
|
||||
"@types/node": "^16.11.39",
|
||||
"@types/node": "^20.2.5",
|
||||
"@types/react": "^18.0.12",
|
||||
"@types/react-dom": "^18.0.5",
|
||||
"buffer": "^6.0.3",
|
||||
@@ -22,17 +24,15 @@
|
||||
"react-dom": "^18.1.0",
|
||||
"react-icons": "^4.4.0",
|
||||
"react-router-dom": "^6.3.0",
|
||||
"react-scripts": "5.0.1",
|
||||
"sass": "^1.52.3",
|
||||
"sass": "^1.62.1",
|
||||
"socket.io-client": "^4.5.1",
|
||||
"typescript": "^4.7.3",
|
||||
"web-vitals": "^2.1.4"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "BROWSER=none react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"eject": "react-scripts eject"
|
||||
"start": "vite",
|
||||
"build": "tsc && vite build",
|
||||
"serve": "vite preview"
|
||||
},
|
||||
"eslintConfig": {
|
||||
"extends": [
|
||||
@@ -51,5 +51,11 @@
|
||||
"last 1 firefox version",
|
||||
"last 1 safari version"
|
||||
]
|
||||
},
|
||||
"devDependencies": {
|
||||
"@vitejs/plugin-react": "^4.0.0",
|
||||
"vite": "^4.3.9",
|
||||
"vite-plugin-svgr": "^3.2.0",
|
||||
"vite-tsconfig-paths": "^4.2.0"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Button, Group, Loader, LoadingOverlay, Notification, Space, PasswordInput, Title } from '@mantine/core';
|
||||
import { useForm } from '@mantine/hooks';
|
||||
import { useForm } from '@mantine/form';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { ImCross } from 'react-icons/im';
|
||||
import { Outlet, Route, Routes } from 'react-router-dom';
|
||||
@@ -59,7 +59,7 @@ function App() {
|
||||
initialValues: {
|
||||
password:"",
|
||||
},
|
||||
validationRules:{
|
||||
validate:{
|
||||
password: (value) => value !== ""
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Button, Group, Space, TextInput, Notification, Switch, NativeSelect, Modal } from '@mantine/core';
|
||||
import { useForm } from '@mantine/hooks';
|
||||
import { useForm } from '@mantine/form';
|
||||
import React, { useState } from 'react';
|
||||
import { RegexAddForm } from '../js/models';
|
||||
import { b64decode, b64encode, getapiobject, okNotify } from '../js/utils';
|
||||
@@ -24,7 +24,7 @@ function AddNewRegex({ opened, onClose, service }:{ opened:boolean, onClose:()=>
|
||||
is_case_insensitive:false,
|
||||
deactive:false
|
||||
},
|
||||
validationRules:{
|
||||
validate:{
|
||||
regex: (value) => value !== "",
|
||||
type: (value) => ["blacklist","whitelist"].includes(value),
|
||||
mode: (value) => ['C -> S', 'S -> C', 'C <-> S'].includes(value)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Button, Group, Modal, Notification, Space, Switch, Text } from "@mantine/core";
|
||||
import { useForm } from "@mantine/hooks";
|
||||
import { useForm } from "@mantine/form";
|
||||
import React, { useState } from "react"
|
||||
import { ImCross } from "react-icons/im";
|
||||
import { okNotify, resetfiregex } from "../../js/utils";
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Button, Group, Modal, Notification, PasswordInput, Space, Switch } from "@mantine/core";
|
||||
import { useForm } from "@mantine/hooks";
|
||||
import { useForm } from "@mantine/form";
|
||||
import React, { useState } from "react"
|
||||
import { ImCross } from "react-icons/im";
|
||||
import { ChangePassword } from "../../js/models";
|
||||
@@ -11,7 +11,7 @@ function ResetPasswordModal({ opened, onClose }:{ opened: boolean, onClose: () =
|
||||
password:"",
|
||||
expire:true
|
||||
},
|
||||
validationRules:{
|
||||
validate:{
|
||||
password: (value) => value !== ""
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import React, { useState } from 'react';
|
||||
import { ActionIcon, Divider, Image, Menu, Tooltip, FloatingTooltip, MediaQuery, Burger, Space, Header } from '@mantine/core';
|
||||
import { ActionIcon, Divider, Image, Menu, Tooltip, MediaQuery, Burger, Space, Header } from '@mantine/core';
|
||||
import style from "./index.module.scss";
|
||||
import { errorNotify, getmainpath, logout } from '../../js/utils';
|
||||
import { AiFillHome } from "react-icons/ai"
|
||||
@@ -44,9 +44,9 @@ function HeaderPage({navOpen, setNav, ...other}: { navOpen: boolean, setNav:Reac
|
||||
/>
|
||||
</div></MediaQuery>
|
||||
<div className={style.divlogo}>
|
||||
<FloatingTooltip zIndex={0} label="Home" transition="pop" transitionDuration={200} openDelay={1000} transitionTimingFunction="ease" color="dark" position="right" >
|
||||
<Tooltip zIndex={0} label="Home" openDelay={1000}color="dark" position="right" >
|
||||
<Image src="/header-logo.png" alt="Firegex logo" onClick={()=>navigator("/")}/>
|
||||
</FloatingTooltip>
|
||||
</Tooltip>
|
||||
</div>
|
||||
|
||||
<div className="flex-spacer" />
|
||||
@@ -61,7 +61,7 @@ function HeaderPage({navOpen, setNav, ...other}: { navOpen: boolean, setNav:Reac
|
||||
|
||||
</Menu>
|
||||
<Space w="md" />
|
||||
<Tooltip label="Home" position='bottom' transition="pop" transitionDuration={200} transitionTimingFunction="ease" color="teal" opened={tooltipHomeOpened} tooltipId="tooltip-home-id">
|
||||
<Tooltip label="Home" position='bottom' color="teal" opened={tooltipHomeOpened}>
|
||||
<ActionIcon color="teal" style={{marginRight:"10px"}}
|
||||
size="xl" radius="md" variant="filled"
|
||||
onClick={go_to_home}
|
||||
@@ -70,7 +70,7 @@ function HeaderPage({navOpen, setNav, ...other}: { navOpen: boolean, setNav:Reac
|
||||
<AiFillHome size="25px" />
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
<Tooltip label="Logout" position='bottom' transition="pop" transitionDuration={200} transitionTimingFunction="ease" color="blue" opened={tooltipLogoutOpened} tooltipId="tooltip-add-id">
|
||||
<Tooltip label="Logout" position='bottom' color="blue" opened={tooltipLogoutOpened}>
|
||||
<ActionIcon color="blue" onClick={logout_action} size="xl" radius="md" variant="filled"
|
||||
onFocus={() => setTooltipLogoutOpened(false)} onBlur={() => setTooltipLogoutOpened(false)}
|
||||
onMouseEnter={() => setTooltipLogoutOpened(true)} onMouseLeave={() => setTooltipLogoutOpened(false)}><ImExit size={23} style={{marginTop:"3px", marginLeft:"2px"}}/></ActionIcon>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Button, Group, Space, TextInput, Notification, Modal, Switch, SegmentedControl } from '@mantine/core';
|
||||
import { useForm } from '@mantine/hooks';
|
||||
import { useForm } from '@mantine/form';
|
||||
import React, { useState } from 'react';
|
||||
import { okNotify, regex_ipv4, regex_ipv6 } from '../../js/utils';
|
||||
import { ImCross } from "react-icons/im"
|
||||
@@ -24,7 +24,7 @@ function AddNewService({ opened, onClose }:{ opened:boolean, onClose:()=>void })
|
||||
proto:"tcp",
|
||||
autostart: true
|
||||
},
|
||||
validationRules:{
|
||||
validate:{
|
||||
name: (value) => value !== ""?true:false,
|
||||
port: (value) => value>0 && value<65536,
|
||||
proto: (value) => ["tcp","udp"].includes(value),
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Button, Group, Space, TextInput, Notification, Modal } from '@mantine/core';
|
||||
import { useForm } from '@mantine/hooks';
|
||||
import { useForm } from '@mantine/form';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { okNotify } from '../../../js/utils';
|
||||
import { ImCross } from "react-icons/im"
|
||||
@@ -9,7 +9,7 @@ function RenameForm({ opened, onClose, service }:{ opened:boolean, onClose:()=>v
|
||||
|
||||
const form = useForm({
|
||||
initialValues: { name:service.name },
|
||||
validationRules:{ name: (value) => value !== "" }
|
||||
validate:{ name: (value) => value !== "" }
|
||||
})
|
||||
|
||||
const close = () =>{
|
||||
|
||||
@@ -116,7 +116,7 @@ function ServiceRow({ service, onClick }:{ service:Service, onClick?:()=>void })
|
||||
<Menu.Item color="red" icon={<BsTrashFill size={18} />} onClick={()=>setDeleteModal(true)}>Delete Service</Menu.Item>
|
||||
</Menu>
|
||||
<Space w="md"/>
|
||||
<Tooltip label="Stop service" zIndex={0} transition="pop" transitionDuration={200} transitionTimingFunction="ease" color="red" opened={tooltipStopOpened} tooltipId="tooltip-stop-id">
|
||||
<Tooltip label="Stop service" zIndex={0} color="red" opened={tooltipStopOpened}>
|
||||
<ActionIcon color="red" loading={buttonLoading}
|
||||
onClick={stopService} size="xl" radius="md" variant="filled"
|
||||
disabled={service.status === "stop"}
|
||||
@@ -127,7 +127,7 @@ function ServiceRow({ service, onClick }:{ service:Service, onClick?:()=>void })
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
<Space w="md"/>
|
||||
<Tooltip label="Start service" transition="pop" zIndex={0} transitionDuration={200} transitionTimingFunction="ease" color="teal">
|
||||
<Tooltip label="Start service" zIndex={0} color="teal">
|
||||
<ActionIcon color="teal" size="xl" radius="md" onClick={startService} loading={buttonLoading}
|
||||
variant="filled" disabled={!["stop","pause"].includes(service.status)?true:false}>
|
||||
<FaPlay size="20px" />
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
import { Autocomplete, AutocompleteItem, Space, Title } from "@mantine/core"
|
||||
import { UseForm } from "@mantine/hooks/lib/use-form/use-form";
|
||||
import React, { useEffect, useState } from "react"
|
||||
import { getipinterfaces } from "../js/utils";
|
||||
import PortInput from "./PortInput";
|
||||
|
||||
import { UseFormReturnType } from "@mantine/form/lib/types";
|
||||
|
||||
interface ItemProps extends AutocompleteItem {
|
||||
label: string;
|
||||
@@ -16,7 +15,7 @@ const AutoCompleteItem = React.forwardRef<HTMLDivElement, ItemProps>(
|
||||
);
|
||||
|
||||
|
||||
export default function PortAndInterface({ form, int_name, port_name, label }:{ form:UseForm<any>, int_name:string, port_name:string, label?:string }) {
|
||||
export default function PortAndInterface({ form, int_name, port_name, label }:{ form:UseFormReturnType<any>, int_name:string, port_name:string, label?:string }) {
|
||||
|
||||
const [ipInterfaces, setIpInterfaces] = useState<AutocompleteItem[]>([]);
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Button, Group, Space, TextInput, Notification, Modal, Switch, SegmentedControl } from '@mantine/core';
|
||||
import { useForm } from '@mantine/hooks';
|
||||
import { useForm } from '@mantine/form';
|
||||
import React, { useState } from 'react';
|
||||
import { okNotify, regex_ipv6_no_cidr, regex_ipv4_no_cidr } from '../../js/utils';
|
||||
import { ImCross } from "react-icons/im"
|
||||
@@ -28,7 +28,7 @@ function AddNewService({ opened, onClose }:{ opened:boolean, onClose:()=>void })
|
||||
ip_dst:"127.0.0.1",
|
||||
autostart: false,
|
||||
},
|
||||
validationRules:{
|
||||
validate:{
|
||||
name: (value) => value !== ""?true:false,
|
||||
public_port: (value) => value>0 && value<65536,
|
||||
proxy_port: (value) => value>0 && value<65536,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Button, Group, Space, Notification, Modal } from '@mantine/core';
|
||||
import { useForm } from '@mantine/hooks';
|
||||
import { useForm } from '@mantine/form';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { okNotify, regex_ipv4_no_cidr, regex_ipv6_no_cidr } from '../../../js/utils';
|
||||
import { ImCross } from "react-icons/im"
|
||||
@@ -13,7 +13,7 @@ function ChangeDestination({ opened, onClose, service }:{ opened:boolean, onClos
|
||||
ip_dst:service.ip_dst,
|
||||
proxy_port:service.proxy_port
|
||||
},
|
||||
validationRules:{
|
||||
validate:{
|
||||
proxy_port: (value) => value>0 && value<65536,
|
||||
ip_dst: (value) => value.match(regex_ipv6_no_cidr)?true:false || value.match(regex_ipv4_no_cidr)?true:false
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Button, Group, Space, TextInput, Notification, Modal } from '@mantine/core';
|
||||
import { useForm } from '@mantine/hooks';
|
||||
import { useForm } from '@mantine/form';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { okNotify } from '../../../js/utils';
|
||||
import { ImCross } from "react-icons/im"
|
||||
@@ -9,7 +9,7 @@ function RenameForm({ opened, onClose, service }:{ opened:boolean, onClose:()=>v
|
||||
|
||||
const form = useForm({
|
||||
initialValues: { name:service.name },
|
||||
validationRules:{ name: (value) => value !== "" }
|
||||
validate:{ name: (value) => value !== "" }
|
||||
})
|
||||
|
||||
const close = () =>{
|
||||
|
||||
@@ -10,7 +10,7 @@ import { BiRename } from 'react-icons/bi'
|
||||
import RenameForm from './RenameForm';
|
||||
import ChangeDestination from './ChangeDestination';
|
||||
import PortInput from '../../PortInput';
|
||||
import { useForm } from '@mantine/hooks';
|
||||
import { useForm } from '@mantine/form';
|
||||
|
||||
function ServiceRow({ service }:{ service:Service }) {
|
||||
|
||||
@@ -25,7 +25,7 @@ function ServiceRow({ service }:{ service:Service }) {
|
||||
|
||||
const form = useForm({
|
||||
initialValues: { proxy_port:service.proxy_port },
|
||||
validationRules:{ proxy_port: (value) => value > 0 && value < 65536 }
|
||||
validate:{ proxy_port: (value) => value > 0 && value < 65536 }
|
||||
})
|
||||
|
||||
const onChangeProxyPort = ({proxy_port}:{proxy_port:number}) => {
|
||||
@@ -142,7 +142,7 @@ function ServiceRow({ service }:{ service:Service }) {
|
||||
<Menu.Item color="red" icon={<BsTrashFill size={18} />} onClick={()=>setDeleteModal(true)}>Delete Service</Menu.Item>
|
||||
</Menu>
|
||||
<Space w="md"/>
|
||||
<Tooltip label="Stop service" zIndex={0} transition="pop" transitionDuration={200} transitionTimingFunction="ease" color="red" opened={tooltipStopOpened} tooltipId="tooltip-stop-id">
|
||||
<Tooltip label="Stop service" zIndex={0} color="red" opened={tooltipStopOpened}>
|
||||
<ActionIcon color="red" loading={buttonLoading}
|
||||
onClick={stopService} size="xl" radius="md" variant="filled"
|
||||
disabled={!service.active}
|
||||
@@ -153,7 +153,7 @@ function ServiceRow({ service }:{ service:Service }) {
|
||||
</ActionIcon>
|
||||
</Tooltip>
|
||||
<Space w="md"/>
|
||||
<Tooltip label="Start service" transition="pop" zIndex={0} transitionDuration={200} transitionTimingFunction="ease" color="teal">
|
||||
<Tooltip label="Start service" zIndex={0} color="teal">
|
||||
<ActionIcon color="teal" size="xl" radius="md" onClick={startService} loading={buttonLoading}
|
||||
variant="filled" disabled={service.active}>
|
||||
<FaPlay size="20px" />
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Button, Group, Space, TextInput, Notification, Modal, Switch } from '@mantine/core';
|
||||
import { useForm } from '@mantine/hooks';
|
||||
import { useForm } from '@mantine/form';
|
||||
import React, { useState } from 'react';
|
||||
import { okNotify } from '../../js/utils';
|
||||
import { ImCross } from "react-icons/im"
|
||||
@@ -24,7 +24,7 @@ function AddNewService({ opened, onClose }:{ opened:boolean, onClose:()=>void })
|
||||
chosenInternalPort:false,
|
||||
autostart: true
|
||||
},
|
||||
validationRules:{
|
||||
validate:{
|
||||
name: (value) => value !== ""?true:false,
|
||||
port: (value) => value>0 && value<65536,
|
||||
internalPort: (value) => value>0 && value<65536,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Button, Group, Space, Notification, Modal, Center, Title } from '@mantine/core';
|
||||
import { useForm } from '@mantine/hooks';
|
||||
import { useForm } from '@mantine/form';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { ImCross } from "react-icons/im"
|
||||
import { FaLongArrowAltDown } from 'react-icons/fa';
|
||||
@@ -19,7 +19,7 @@ function ChangePortModal({ service, opened, onClose }:{ service:Service, opened:
|
||||
internalPort: service.internal_port,
|
||||
port: service.public_port
|
||||
},
|
||||
validationRules:{
|
||||
validate:{
|
||||
internalPort: (value) => value>0 && value<65536,
|
||||
port: (value) => value>0 && value<65536
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Button, Group, Space, TextInput, Notification, Modal } from '@mantine/core';
|
||||
import { useForm } from '@mantine/hooks';
|
||||
import { useForm } from '@mantine/form';
|
||||
import React, { useEffect, useState } from 'react';
|
||||
import { okNotify } from '../../../js/utils';
|
||||
import { ImCross } from "react-icons/im"
|
||||
@@ -9,7 +9,7 @@ function RenameForm({ opened, onClose, service }:{ opened:boolean, onClose:()=>v
|
||||
|
||||
const form = useForm({
|
||||
initialValues: { name:service.name },
|
||||
validationRules:{ name: (value) => value !== "" }
|
||||
validate:{ name: (value) => value !== "" }
|
||||
})
|
||||
|
||||
const close = () =>{
|
||||
|
||||
@@ -153,7 +153,7 @@ function ServiceRow({ service, onClick }:{ service:Service, onClick?:()=>void })
|
||||
<Space w="md"/>
|
||||
{["pause","wait"].includes(service.status)?
|
||||
|
||||
<Tooltip label="Stop service" zIndex={0} transition="pop" transitionDuration={200} /*openDelay={500}*/ transitionTimingFunction="ease" color="orange" opened={tooltipStopOpened} tooltipId="tooltip-stop-id">
|
||||
<Tooltip label="Stop service" zIndex={0} color="orange" opened={tooltipStopOpened}>
|
||||
<ActionIcon color="yellow" loading={buttonLoading}
|
||||
onClick={()=>setStopModal(true)} size="xl" radius="md" variant="filled"
|
||||
disabled={service.status === "stop"}
|
||||
@@ -163,7 +163,7 @@ function ServiceRow({ service, onClick }:{ service:Service, onClick?:()=>void })
|
||||
<FaStop size="20px" />
|
||||
</ActionIcon>
|
||||
</Tooltip>:
|
||||
<Tooltip label={service.status === "stop"?"Start in pause mode":"Pause service"} zIndex={0} transition="pop" transitionDuration={200} /*openDelay={500}*/ transitionTimingFunction="ease" color={service.status === "stop"?"cyan":"red"}>
|
||||
<Tooltip label={service.status === "stop"?"Start in pause mode":"Pause service"} zIndex={0} color={service.status === "stop"?"cyan":"red"}>
|
||||
<ActionIcon color={service.status === "stop"?"cyan":"red"} loading={buttonLoading}
|
||||
onClick={pauseService} size="xl" radius="md" variant="filled">
|
||||
<FaPause size="20px" />
|
||||
@@ -172,7 +172,7 @@ function ServiceRow({ service, onClick }:{ service:Service, onClick?:()=>void })
|
||||
}
|
||||
|
||||
<Space w="md"/>
|
||||
<Tooltip label="Start service" transition="pop" zIndex={0} transitionDuration={200} /*openDelay={500}*/ transitionTimingFunction="ease" color="teal">
|
||||
<Tooltip label="Start service" zIndex={0} color="teal">
|
||||
<ActionIcon color="teal" size="xl" radius="md" onClick={startService} loading={buttonLoading}
|
||||
variant="filled" disabled={!["stop","pause"].includes(service.status)?true:false}>
|
||||
<FaPlay size="20px" />
|
||||
|
||||
@@ -51,14 +51,14 @@ function RegexView({ regexInfo }:{ regexInfo:RegexFilter }) {
|
||||
</Grid.Col>
|
||||
<Grid.Col span={2} className='center-flex'>
|
||||
<Space w="xs" />
|
||||
<Tooltip label={regexInfo.active?"Deactivate":"Activate"} zIndex={0} transition="pop" transitionDuration={200} /*openDelay={500}*/ transitionTimingFunction="ease" color={regexInfo.active?"orange":"teal"} opened={statusTooltipOpened}>
|
||||
<Tooltip label={regexInfo.active?"Deactivate":"Activate"} zIndex={0} color={regexInfo.active?"orange":"teal"} opened={statusTooltipOpened}>
|
||||
<ActionIcon color={regexInfo.active?"orange":"teal"} onClick={changeRegexStatus} size="xl" radius="md" variant="filled"
|
||||
onFocus={() => setStatusTooltipOpened(false)} onBlur={() => setStatusTooltipOpened(false)}
|
||||
onMouseEnter={() => setStatusTooltipOpened(true)} onMouseLeave={() => setStatusTooltipOpened(false)}
|
||||
>{regexInfo.active?<FaPause size="20px" />:<FaPlay size="20px" />}</ActionIcon>
|
||||
</Tooltip>
|
||||
<Space w="xs" />
|
||||
<Tooltip label="Delete regex" zIndex={0} transition="pop" transitionDuration={200} /*openDelay={500}*/ transitionTimingFunction="ease" color="red" opened={deleteTooltipOpened} >
|
||||
<Tooltip label="Delete regex" zIndex={0} color="red" opened={deleteTooltipOpened} >
|
||||
<ActionIcon color="red" onClick={()=>setDeleteModal(true)} size="xl" radius="md" variant="filled"
|
||||
onFocus={() => setDeleteTooltipOpened(false)} onBlur={() => setDeleteTooltipOpened(false)}
|
||||
onMouseEnter={() => setDeleteTooltipOpened(true)} onMouseLeave={() => setDeleteTooltipOpened(false)}
|
||||
|
||||
@@ -4,17 +4,16 @@ import { BrowserRouter } from "react-router-dom"
|
||||
import './index.scss';
|
||||
import App from './App';
|
||||
import { MantineProvider } from '@mantine/core';
|
||||
import { NotificationsProvider } from '@mantine/notifications';
|
||||
import { Notifications } from '@mantine/notifications';
|
||||
|
||||
const root = ReactDOM.createRoot(
|
||||
document.getElementById('root') as HTMLElement
|
||||
);
|
||||
root.render(
|
||||
<MantineProvider theme={{ colorScheme: 'dark' }} withGlobalStyles withNormalizeCSS>
|
||||
<NotificationsProvider>
|
||||
<Notifications />
|
||||
<BrowserRouter>
|
||||
<App />
|
||||
</BrowserRouter>
|
||||
</NotificationsProvider>
|
||||
</MantineProvider>
|
||||
);
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Navigate } from "react-router-dom";
|
||||
import { nfregex } from "../components/NFRegex/utils";
|
||||
import { regexproxy } from "../components/RegexProxy/utils";
|
||||
import { ChangePassword, IpInterface, LoginResponse, PasswordSend, ServerResponse, ServerResponseToken, ServerStatusResponse } from "./models";
|
||||
var Buffer = require('buffer').Buffer
|
||||
import { Buffer } from "buffer"
|
||||
|
||||
|
||||
export const eventUpdateName = "update-info"
|
||||
|
||||
@@ -64,7 +64,7 @@ function ServiceDetailsNFRegex() {
|
||||
<Title className='center-flex' align='center' order={3}>No regex found for this service! Add one by clicking the "+" buttons</Title>
|
||||
<Space h="xl" /> <Space h="xl" /> <Space h="xl" /> <Space h="xl" />
|
||||
<div className='center-flex'>
|
||||
<Tooltip label="Add a new regex" zIndex={0} transition="pop" transitionDuration={200} /*openDelay={500}*/ transitionTimingFunction="ease" color="blue" opened={tooltipAddRegexOpened} tooltipId="tooltip-AddRegex-id">
|
||||
<Tooltip label="Add a new regex" zIndex={0} color="blue" opened={tooltipAddRegexOpened}>
|
||||
<ActionIcon color="blue" onClick={()=>setOpen(true)} size="xl" radius="md" variant="filled"
|
||||
aria-describedby="tooltip-AddRegex-id"
|
||||
onFocus={() => setTooltipAddRegexOpened(false)} onBlur={() => setTooltipAddRegexOpened(false)}
|
||||
|
||||
@@ -55,12 +55,12 @@ function NFRegex({ children }: { children: any }) {
|
||||
<Badge size="sm" color="violet" variant="filled">Regexes: {generalStats.regexes}</Badge>
|
||||
<Space w="xs" />
|
||||
{ srv?
|
||||
<Tooltip label="Add a new regex" position='bottom' transition="pop" transitionDuration={200} transitionTimingFunction="ease" color="blue" opened={tooltipAddOpened}>
|
||||
<Tooltip label="Add a new regex" position='bottom' color="blue" opened={tooltipAddOpened}>
|
||||
<ActionIcon color="blue" onClick={()=>setOpen(true)} size="lg" radius="md" variant="filled"
|
||||
onFocus={() => setTooltipAddOpened(false)} onBlur={() => setTooltipAddOpened(false)}
|
||||
onMouseEnter={() => setTooltipAddOpened(true)} onMouseLeave={() => setTooltipAddOpened(false)}><BsPlusLg size={18} /></ActionIcon>
|
||||
</Tooltip>
|
||||
: <Tooltip label="Add a new service" position='bottom' transition="pop" transitionDuration={200} transitionTimingFunction="ease" color="blue" opened={tooltipAddOpened}>
|
||||
: <Tooltip label="Add a new service" position='bottom' color="blue" opened={tooltipAddOpened}>
|
||||
<ActionIcon color="blue" onClick={()=>setOpen(true)} size="lg" radius="md" variant="filled"
|
||||
onFocus={() => setTooltipAddOpened(false)} onBlur={() => setTooltipAddOpened(false)}
|
||||
onMouseEnter={() => setTooltipAddOpened(true)} onMouseLeave={() => setTooltipAddOpened(false)}><BsPlusLg size={18} /></ActionIcon>
|
||||
@@ -75,7 +75,7 @@ function NFRegex({ children }: { children: any }) {
|
||||
}} />):<><Space h="xl"/> <Title className='center-flex' align='center' order={3}>No services found! Add one clicking the "+" buttons</Title>
|
||||
<Space h="xl" /> <Space h="xl" /> <Space h="xl" /> <Space h="xl" />
|
||||
<div className='center-flex'>
|
||||
<Tooltip label="Add a new service" transition="pop" transitionDuration={200} transitionTimingFunction="ease" color="blue" opened={tooltipAddServOpened}>
|
||||
<Tooltip label="Add a new service" color="blue" opened={tooltipAddServOpened}>
|
||||
<ActionIcon color="blue" onClick={()=>setOpen(true)} size="xl" radius="md" variant="filled"
|
||||
onFocus={() => setTooltipAddServOpened(false)} onBlur={() => setTooltipAddServOpened(false)}
|
||||
onMouseEnter={() => setTooltipAddServOpened(true)} onMouseLeave={() => setTooltipAddServOpened(false)}><BsPlusLg size="20px" /></ActionIcon>
|
||||
|
||||
@@ -46,7 +46,7 @@ function PortHijack() {
|
||||
<div className='flex-spacer' />
|
||||
<Badge size="sm" color="yellow" variant="filled">Services: {generalStats.services}</Badge>
|
||||
<Space w="xs" />
|
||||
<Tooltip label="Add a new service" position='bottom' transition="pop" transitionDuration={200} transitionTimingFunction="ease" color="blue" opened={tooltipAddOpened}>
|
||||
<Tooltip label="Add a new service" position='bottom' color="blue" opened={tooltipAddOpened}>
|
||||
<ActionIcon color="blue" onClick={()=>setOpen(true)} size="lg" radius="md" variant="filled"
|
||||
onFocus={() => setTooltipAddOpened(false)} onBlur={() => setTooltipAddOpened(false)}
|
||||
onMouseEnter={() => setTooltipAddOpened(true)} onMouseLeave={() => setTooltipAddOpened(false)}><BsPlusLg size={18} /></ActionIcon>
|
||||
@@ -57,7 +57,7 @@ function PortHijack() {
|
||||
{services.length > 0?services.map( srv => <ServiceRow service={srv} key={srv.service_id} />):<><Space h="xl"/> <Title className='center-flex' align='center' order={3}>No services found! Add one clicking the "+" buttons</Title>
|
||||
<Space h="xl" /> <Space h="xl" /> <Space h="xl" /> <Space h="xl" />
|
||||
<div className='center-flex'>
|
||||
<Tooltip label="Add a new service" transition="pop" transitionDuration={200} transitionTimingFunction="ease" color="blue" opened={tooltipAddServOpened}>
|
||||
<Tooltip label="Add a new service" color="blue" opened={tooltipAddServOpened}>
|
||||
<ActionIcon color="blue" onClick={()=>setOpen(true)} size="xl" radius="md" variant="filled"
|
||||
onFocus={() => setTooltipAddServOpened(false)} onBlur={() => setTooltipAddServOpened(false)}
|
||||
onMouseEnter={() => setTooltipAddServOpened(true)} onMouseLeave={() => setTooltipAddServOpened(false)}><BsPlusLg size="20px" /></ActionIcon>
|
||||
|
||||
@@ -63,7 +63,7 @@ function ServiceDetailsProxyRegex() {
|
||||
<Title className='center-flex' align='center' order={3}>No regex found for this service! Add one by clicking the "+" buttons</Title>
|
||||
<Space h="xl" /> <Space h="xl" /> <Space h="xl" /> <Space h="xl" />
|
||||
<div className='center-flex'>
|
||||
<Tooltip label="Add a new regex" zIndex={0} transition="pop" transitionDuration={200} /*openDelay={500}*/ transitionTimingFunction="ease" color="blue" opened={tooltipAddRegexOpened} tooltipId="tooltip-AddRegex-id">
|
||||
<Tooltip label="Add a new regex" zIndex={0} color="blue" opened={tooltipAddRegexOpened}>
|
||||
<ActionIcon color="blue" onClick={()=>setOpen(true)} size="xl" radius="md" variant="filled"
|
||||
aria-describedby="tooltip-AddRegex-id"
|
||||
onFocus={() => setTooltipAddRegexOpened(false)} onBlur={() => setTooltipAddRegexOpened(false)}
|
||||
|
||||
@@ -56,12 +56,12 @@ function RegexProxy({ children }: { children: any }) {
|
||||
<Badge size="sm" color="violet" variant="filled">Regexes: {generalStats.regexes}</Badge>
|
||||
<Space w="xs" />
|
||||
{ srv?
|
||||
<Tooltip label="Add a new regex" position='bottom' transition="pop" transitionDuration={200} transitionTimingFunction="ease" color="blue" opened={tooltipAddOpened}>
|
||||
<Tooltip label="Add a new regex" position='bottom' color="blue" opened={tooltipAddOpened}>
|
||||
<ActionIcon color="blue" onClick={()=>setOpen(true)} size="lg" radius="md" variant="filled"
|
||||
onFocus={() => setTooltipAddOpened(false)} onBlur={() => setTooltipAddOpened(false)}
|
||||
onMouseEnter={() => setTooltipAddOpened(true)} onMouseLeave={() => setTooltipAddOpened(false)}><BsPlusLg size={18} /></ActionIcon>
|
||||
</Tooltip>
|
||||
: <Tooltip label="Add a new service" position='bottom' transition="pop" transitionDuration={200} transitionTimingFunction="ease" color="blue" opened={tooltipAddOpened}>
|
||||
: <Tooltip label="Add a new service" position='bottom' color="blue" opened={tooltipAddOpened}>
|
||||
<ActionIcon color="blue" onClick={()=>setOpen(true)} size="lg" radius="md" variant="filled"
|
||||
onFocus={() => setTooltipAddOpened(false)} onBlur={() => setTooltipAddOpened(false)}
|
||||
onMouseEnter={() => setTooltipAddOpened(true)} onMouseLeave={() => setTooltipAddOpened(false)}><BsPlusLg size={18} /></ActionIcon>
|
||||
@@ -76,7 +76,7 @@ function RegexProxy({ children }: { children: any }) {
|
||||
}} />):<><Space h="xl"/> <Title className='center-flex' align='center' order={3}>No services found! Add one clicking the "+" buttons</Title>
|
||||
<Space h="xl" /> <Space h="xl" /> <Space h="xl" /> <Space h="xl" />
|
||||
<div className='center-flex'>
|
||||
<Tooltip label="Add a new service" transition="pop" transitionDuration={200} transitionTimingFunction="ease" color="blue" opened={tooltipAddServOpened}>
|
||||
<Tooltip label="Add a new service" color="blue" opened={tooltipAddServOpened}>
|
||||
<ActionIcon color="blue" onClick={()=>setOpen(true)} size="xl" radius="md" variant="filled"
|
||||
onFocus={() => setTooltipAddServOpened(false)} onBlur={() => setTooltipAddServOpened(false)}
|
||||
onMouseEnter={() => setTooltipAddServOpened(true)} onMouseLeave={() => setTooltipAddServOpened(false)}><BsPlusLg size="20px" /></ActionIcon>
|
||||
|
||||
1
frontend/src/react-app-env.d.ts
vendored
1
frontend/src/react-app-env.d.ts
vendored
@@ -1 +0,0 @@
|
||||
/// <reference types="react-scripts" />
|
||||
2
frontend/src/vite-env.d.ts
vendored
Normal file
2
frontend/src/vite-env.d.ts
vendored
Normal file
@@ -0,0 +1,2 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
@@ -1,27 +1,22 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"target": "es5",
|
||||
"lib": [
|
||||
"dom",
|
||||
"dom.iterable",
|
||||
"esnext"
|
||||
],
|
||||
"allowJs": true,
|
||||
"skipLibCheck": true,
|
||||
"esModuleInterop": true,
|
||||
"target": "ESNext",
|
||||
"lib": ["dom", "dom.iterable", "esnext"],
|
||||
"types": ["vite/client", "vite-plugin-svgr/client", "node"],
|
||||
"allowJs": false,
|
||||
"skipLibCheck": false,
|
||||
"esModuleInterop": false,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"strict": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"noFallthroughCasesInSwitch": true,
|
||||
"module": "esnext",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"noEmit": true,
|
||||
"jsx": "react-jsx"
|
||||
},
|
||||
"include": [
|
||||
"src",
|
||||
"globals.d.ts" //configured .d.ts file
|
||||
]
|
||||
"include": ["src"]
|
||||
}
|
||||
|
||||
|
||||
10
frontend/vite.config.ts
Normal file
10
frontend/vite.config.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import { defineConfig } from 'vite';
|
||||
import react from '@vitejs/plugin-react';
|
||||
import viteTsconfigPaths from 'vite-tsconfig-paths';
|
||||
import svgrPlugin from 'vite-plugin-svgr';
|
||||
|
||||
// https://vitejs.dev/config/
|
||||
export default defineConfig({
|
||||
plugins: [react(), viteTsconfigPaths(), svgrPlugin()],
|
||||
});
|
||||
|
||||
8766
frontend/yarn.lock
8766
frontend/yarn.lock
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user