New supervision

- using fastAPI
- offline/online working
- warning if ZABBIX API is too long
- showing settings
- showing last ack message
- showing procedure
- menu split by SU team
This commit is contained in:
sylvain.chateau
2024-02-05 15:44:27 +01:00
parent f493406b5b
commit f2235d4b45
60 changed files with 10017 additions and 221 deletions

29
routes/notes.py Normal file
View File

@@ -0,0 +1,29 @@
from typing import Optional
from fastapi import Form
from fastapi.responses import RedirectResponse
from schemas.notes import Note, NoteManager
from super_server import app
@app.post("/post")
async def post_note(
name: str = Form(...),
msg: str = Form(...),
url: Optional[str] = Form(None),
lvl: str = Form(...),
team: str = Form(...),
save: Optional[str] = Form(None),
):
note = Note(name=name, msg=msg, url=url, lvl=lvl, team=team, save=save)
await NoteManager().add_note(note)
return RedirectResponse(url="/", status_code=303)
@app.post("/del")
async def del_note(
note_id: Optional[str] = Form(None), url: Optional[str] = Form(None)
):
await NoteManager().delete_note(note_id)
return RedirectResponse(url="/", status_code=303)