Fix General Info Model

This commit is contained in:
DomySh
2022-06-12 19:03:56 +02:00
parent d08a82e311
commit a568fbe5eb
3 changed files with 4 additions and 5 deletions

View File

@@ -500,7 +500,7 @@ def post_services_add():
db.query(''' db.query('''
INSERT INTO services (service_id, internal_port, public_port, status) VALUES (?, ?, ?, ?) INSERT INTO services (service_id, internal_port, public_port, status) VALUES (?, ?, ?, ?)
''', (req['name'], req['port'], random.randint(30000, 45000), 'stopped')) ''', (req['name'], req['port'], random.randint(30000, 45000), 'stop'))
res = { res = {
'status': 'ok' 'status': 'ok'

View File

@@ -12,7 +12,7 @@ import AddNewService from '../AddNewService';
function Header() { function Header() {
const [generalStats, setGeneralStats] = useState<GeneralStats>({closed:0, regex:0, services:0}); const [generalStats, setGeneralStats] = useState<GeneralStats>({closed:0, regexes:0, services:0});
const location = useLocation() const location = useLocation()
const navigator = useNavigate() const navigator = useNavigate()
@@ -41,7 +41,7 @@ function Header() {
<div className="flex-spacer" /> <div className="flex-spacer" />
<Badge color="green" size="lg" variant="filled">Services: {generalStats.services}</Badge> <Badge color="green" size="lg" variant="filled">Services: {generalStats.services}</Badge>
<Badge style={{marginLeft:"10px"}} size="lg" color="yellow" variant="filled">Filtered Connections: {generalStats.closed}</Badge> <Badge style={{marginLeft:"10px"}} size="lg" color="yellow" variant="filled">Filtered Connections: {generalStats.closed}</Badge>
<Badge style={{marginLeft:"10px"}} size="lg" color="violet" variant="filled">Regexes: {generalStats.regex}</Badge> <Badge style={{marginLeft:"10px"}} size="lg" color="violet" variant="filled">Regexes: {generalStats.regexes}</Badge>
<div style={{marginLeft:"20px"}}></div> <div style={{marginLeft:"20px"}}></div>
{ location.pathname !== "/"? { location.pathname !== "/"?
<ActionIcon color="teal" style={{marginRight:"10px"}} <ActionIcon color="teal" style={{marginRight:"10px"}}

View File

@@ -6,7 +6,7 @@ export const notification_time = 2000;
export type GeneralStats = { export type GeneralStats = {
services:number, services:number,
closed:number, closed:number,
regex:number regexes:number
} }
export type Service = { export type Service = {
@@ -24,7 +24,6 @@ export type ServiceAddForm = {
port:number port:number
} }
export type ServerResponse = { export type ServerResponse = {
status:string status:string
} }