add(todo): additional setting to implement

This commit is contained in:
Domingo Dirutigliano
2023-09-26 01:17:09 +02:00
parent a9446d6dc6
commit 0c972baa9c
13 changed files with 164 additions and 21 deletions

View File

@@ -7,7 +7,7 @@ from pydantic import BaseModel
from modules.nfregex.nftables import FiregexTables
from modules.nfregex.firewall import STATUS, FirewallManager
from utils.sqlite import SQLite
from utils import ip_parse, refactor_name, refresh_frontend, PortType
from utils import ip_parse, refactor_name, socketio_emit, PortType
from utils.models import ResetRequest, StatusMessageModel
class ServiceModel(BaseModel):
@@ -79,6 +79,9 @@ db = SQLite('db/nft-regex.db', {
]
})
async def refresh_frontend(additional:list[str]=[]):
await socketio_emit(["nfregex"]+additional)
async def reset(params: ResetRequest):
if not params.delete:
db.backup()