5 changed files with 113 additions and 2 deletions
@ -0,0 +1,32 @@ |
|||
export class PortNums { |
|||
0: "UNKNOWN_APP"; |
|||
1: "TEXT_MESSAGE_APP"; |
|||
2: "REMOTE_HARDWARE_APP"; |
|||
3: "POSITION_APP"; |
|||
4: "NODEINFO_APP"; |
|||
5: "ROUTING_APP"; |
|||
6: "ADMIN_APP"; |
|||
7: "TEXT_MESSAGE_COMPRESSED_APP"; |
|||
8: "WAYPOINT_APP"; |
|||
9: "AUDIO_APP"; |
|||
10: "DETECTION_SENSOR_APP"; |
|||
11: "ALERT_APP"; |
|||
32: "REPLY_APP"; |
|||
33: "IP_TUNNEL_APP"; |
|||
34: "PAXCOUNTER_APP"; |
|||
64: "SERIAL_APP"; |
|||
65: "STORE_FORWARD_APP"; |
|||
66: "RANGE_TEST_APP"; |
|||
67: "TELEMETRY_APP"; |
|||
68: "ZPS_APP"; |
|||
69: "SIMULATOR_APP"; |
|||
70: "TRACEROUTE_APP"; |
|||
71: "NEIGHBORINFO_APP"; |
|||
72: "ATAK_PLUGIN"; |
|||
73: "MAP_REPORT_APP"; |
|||
74: "POWERSTRESS_APP"; |
|||
76: "RETICULUM_TUNNEL_APP"; |
|||
256: "PRIVATE_APP"; |
|||
257: "ATAK_FORWARDER"; |
|||
511: "MAX"; |
|||
} |
|||
@ -0,0 +1,27 @@ |
|||
from fastapi import FastAPI |
|||
from fastapi.responses import HTMLResponse |
|||
from fastapi.requests import Request |
|||
from fastapi import Query |
|||
|
|||
from pymongo.asynchronous.database import AsyncDatabase |
|||
from extra.MessageDTO import MessageDTO |
|||
from typing import List, Annotated |
|||
from pymongo import DESCENDING |
|||
|
|||
class WebExtension: |
|||
MESSAGE_PORTNUM = 1 |
|||
app: FastAPI |
|||
dbStore: AsyncDatabase |
|||
def __init__(self, core): |
|||
self.core = core |
|||
self.app = core.app |
|||
|
|||
@self.app.get(f"{self.core.context}/packet/stats") |
|||
@self.core.authManager.authRequest() |
|||
async def findPacketsAndGroupCount(request: Request, |
|||
after: float = Query(-1), |
|||
before: float = Query(-1), |
|||
nums: List[int] = Query([]), |
|||
portnums: List[int] = Query([])): |
|||
gl = await self.core.dbService.findPacketsAndGroupCount(after, before, nums, portnums) |
|||
return gl |
|||
Loading…
Reference in new issue