wip website
This commit is contained in:
parent
7f5a13694b
commit
49892589f6
Binary file not shown.
Binary file not shown.
20
app.py
20
app.py
@ -25,28 +25,28 @@ async def receive_info(request: Request):
|
||||
hw = data["HARDWARE"]
|
||||
sw = data["SOFTWARE"]
|
||||
|
||||
ordi1.host = hw["hostname"]
|
||||
ordi1.cpu = hw["cpu_model"]
|
||||
ordi1.motherboard = hw["motherboard"]
|
||||
ordi1.cpu_model = hw["cpu_model"]
|
||||
ordi1.cpu_id = hw["cpu_id"]
|
||||
ordi1.cpu_cores_number = hw["cpu_cores"]
|
||||
ordi1.cpu_threads_number = hw["cpu_threads"]
|
||||
ordi1.cpu_cores = hw["cpu_cores"]
|
||||
ordi1.cpu_threads = hw["cpu_threads"]
|
||||
ordi1.cpu_frequency_min = hw["cpu_frequency_min"]
|
||||
ordi1.cpu_frequency_cur = hw["cpu_frequency_cur"]
|
||||
ordi1.cpu_frequency_max = hw["cpu_frequency_max"]
|
||||
|
||||
|
||||
ordi1.hostname = sw["hostname"]
|
||||
ordi1.os = sw["os"]
|
||||
ordi1.arch = sw["arch"]
|
||||
ordi1.desktop = sw["desktop_env"]
|
||||
ordi1.wm = sw["window_manager"]
|
||||
ordi1.desktop_env = sw["desktop_env"]
|
||||
ordi1.window_manager = sw["window_manager"]
|
||||
ordi1.kernel = sw["kernel"]
|
||||
|
||||
print(f"Hostname is {ordi1.host}")
|
||||
print(f"Motherboard serial is {ordi1.mb_serial}")
|
||||
print(f"Hostname is {ordi1.hostname}")
|
||||
print(f"Motherboard serial is {ordi1.motherboard}")
|
||||
|
||||
return {"status": "ok"}
|
||||
|
||||
|
||||
@app.get("/ordi1") #page affichant les infos de l'ordi
|
||||
@app.get("/ordi1")
|
||||
async def show_info(request: Request):
|
||||
return templates.TemplateResponse("item.html", {"request": request, "ordi": ordi1})
|
||||
@ -3,7 +3,7 @@ import configparser
|
||||
import requests
|
||||
|
||||
class Grabber():
|
||||
mb_serial = " "
|
||||
motherboard = " "
|
||||
cpu_model = " "
|
||||
cpu_id = " "
|
||||
cpu_cores = " "
|
||||
@ -15,6 +15,7 @@ class Grabber():
|
||||
ram_slots = " "
|
||||
ram_number = " "
|
||||
|
||||
hostname = " "
|
||||
os = " "
|
||||
arch = " "
|
||||
desktop_env = " "
|
||||
|
||||
@ -345,7 +345,6 @@ json_file() {
|
||||
}
|
||||
}'
|
||||
)
|
||||
echo $json_data
|
||||
#SIMPLE LOCAL
|
||||
curl -X POST http://localhost:8000/endpoint \
|
||||
-H "Content-Type: application/json" \
|
||||
|
||||
@ -37,6 +37,7 @@
|
||||
<h2>[SOFTWARE]</h2>
|
||||
<table>
|
||||
<tr><th>Propriété</th><th>Valeur</th></tr>
|
||||
<tr><td>Hostname</td><td>{{ ordi.hostname }}</td></tr>
|
||||
<tr><td>OS</td><td>{{ ordi.os }}</td></tr>
|
||||
<tr><td>Architecture</td><td>{{ ordi.arch }}</td></tr>
|
||||
<tr><td>Desktop</td><td>{{ ordi.desktop_env }}</td></tr>
|
||||
|
||||
Reference in New Issue
Block a user