Remove API key From Console
parent
ff5954498c
commit
6203846cf7
2
main.py
2
main.py
|
|
@ -141,7 +141,7 @@ async def sethost(get: CL.CL_SET_HOST,api_key: APIKey = Depends(auth.get_api_key
|
||||||
|
|
||||||
@app.post("/host/update")
|
@app.post("/host/update")
|
||||||
async def updatehost(get: CL.CL_UPDATE_HOST,api_key: APIKey = Depends(auth.get_api_key)):
|
async def updatehost(get: CL.CL_UPDATE_HOST,api_key: APIKey = Depends(auth.get_api_key)):
|
||||||
database(f"UPDATE `{get.dbname}`.Clients SET Username = '{get.user}',`IP-Adresse` = '{get.ipadresse}',`Windows-Version` = '{get.winver}',`CPU-Name` = '{get.cpuname}',`Prozessor-Anzahl` = {get.cores},RAM = {get.ram},Speichergesamt = '{get.hddtotal}',Speicherfrei = '{get.hddfree}',Speicherbelegt = '{get.hddused}', LastChange = '{datetime.now()}' WHERE hostname = '{get.hostname}'","","")
|
database(f"UPDATE `{get.dbname}`.Clients SET Username = '{get.user}',`IP-Adresse` = '{get.ipadresse}',`Windows-Version` = '{get.winver}',`CPU-Name` = '{get.cpuname}',`Prozessor-Anzahl` = {get.cores},RAM = {get.ram},Speichergesamt = '{get.hddtotal}',Speicherfrei = '{get.hddfree}',Speicherbelegt = '{get.hddused}', LastChange = '{datetime.now()}' WHERE `Host-Name` = '{get.hostname}'","","")
|
||||||
result = database(f"SELECT id FROM `{get.dbname}`.Clients WHERE `Host-Name` = '{get.hostname}'","", "")
|
result = database(f"SELECT id FROM `{get.dbname}`.Clients WHERE `Host-Name` = '{get.hostname}'","", "")
|
||||||
if not result:
|
if not result:
|
||||||
return False
|
return False
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue