feat: 完成前端端口规则设置功能

This commit is contained in:
ssongliu
2023-04-06 09:01:57 +08:00
committed by ssongliu
parent a2fcdabb7b
commit d5f446d7cf
20 changed files with 847 additions and 132 deletions
+25
View File
@@ -52,4 +52,29 @@ export namespace Host {
groupID: number;
info?: string;
}
export interface RuleSearch extends ReqPage {
info: string;
type: string;
}
export interface RuleInfo extends ReqPage {
family: string;
address: string;
port: string;
protocol: string;
strategy: string;
}
export interface RulePort {
operation: string;
address: string;
port: string;
source: string;
protocol: string;
strategy: string;
}
export interface RuleIP {
operation: string;
address: string;
strategy: string;
}
}
+11
View File
@@ -70,3 +70,14 @@ export const editCommand = (params: Command.CommandOperate) => {
export const deleteCommand = (params: { ids: number[] }) => {
return http.post(`/hosts/command/del`, params);
};
// firewall
export const searchFireRule = (params: Host.RuleSearch) => {
return http.post<ResPage<Host.RuleInfo>>(`/hosts/firewall/search`, params);
};
export const operatePortRule = (params: Host.RulePort) => {
return http.post<Host.RulePort>(`/hosts/firewall/port`, params);
};
export const operateIPRule = (params: Host.RuleIP) => {
return http.post<Host.RuleIP>(`/hosts/firewall/ip`, params);
};