JSON WORKS HERE TAG
All checks were successful
Build and Deploy MITM Webserver / build (push) Successful in 9s

This commit is contained in:
2026-02-28 17:55:03 +01:00
parent eb1eef23c4
commit 64d3a973bc
5 changed files with 498 additions and 779 deletions

View File

@@ -1,6 +1,6 @@
// src/apiClient.ts
import axios from 'axios';
import { CreateRuleRequest, ExecResult, MoveRequest, MoveResult, RulesetModel } from '../types/firewall';
import { CreateRuleRequest, ExecResult, RulesetModel } from '../types/firewall';
import {
BridgeCreateRequest,
BridgeInfo,
@@ -125,8 +125,8 @@ export const fetchPackets = async (limit = 100): Promise<any> => {
* Returns: { ruleset: RulesetModel | string | null }
* - If the server returns a raw textual fallback (string), the caller should handle it.
*/
export const fetchRuleset = async (): Promise<{ ruleset: RulesetModel | string | null }> => {
const res = await api.get<{ ruleset: RulesetModel | string | null }>('/firewall/rules');
export const fetchRuleset = async (): Promise<{ ruleset: RulesetModel }> => {
const res = await api.get<{ ruleset: RulesetModel }>('/firewall/rules');
return res.data;
};
@@ -142,11 +142,6 @@ export const deleteRule = async (handle: number, family: string, table: string,
return res.data;
};
export const moveRule = async (req: MoveRequest): Promise<MoveResult> => {
const res = await api.post<MoveResult>(`/firewall/rules/${encodeURIComponent(String(req.before_handle))}/move`, req);
return res.data;
};
/**
* createRuleJson - POST /firewall/rules
* Body: CreateRuleRequest (must include expr)