mirror of https://github.com/1Panel-dev/1Panel
fix: 修改监控相关接口 (#4427)
parent
e69fd3b388
commit
4f2a340212
@ -1,23 +0,0 @@
|
||||
package router
|
||||
|
||||
import (
|
||||
v1 "github.com/1Panel-dev/1Panel/backend/app/api/v1"
|
||||
"github.com/1Panel-dev/1Panel/backend/middleware"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
type MonitorRouter struct{}
|
||||
|
||||
func (s *MonitorRouter) InitRouter(Router *gin.RouterGroup) {
|
||||
monitorRouter := Router.Group("monitors").
|
||||
Use(middleware.JwtAuth()).
|
||||
Use(middleware.SessionAuth()).
|
||||
Use(middleware.PasswordExpired())
|
||||
baseApi := v1.ApiGroupApp.BaseApi
|
||||
{
|
||||
monitorRouter.POST("/search", baseApi.LoadMonitor)
|
||||
monitorRouter.GET("/netoptions", baseApi.GetNetworkOptions)
|
||||
monitorRouter.GET("/iooptions", baseApi.GetIOOptions)
|
||||
}
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
export namespace Monitor {
|
||||
export interface MonitorData {
|
||||
param: string;
|
||||
date: Array<Date>;
|
||||
value: Array<any>;
|
||||
}
|
||||
export interface MonitorSearch {
|
||||
param: string;
|
||||
info: string;
|
||||
startTime: Date;
|
||||
endTime: Date;
|
||||
}
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
import http from '@/api';
|
||||
import { Monitor } from '../interface/monitor';
|
||||
|
||||
export const loadMonitor = (param: Monitor.MonitorSearch) => {
|
||||
return http.post<Array<Monitor.MonitorData>>(`/monitors/search`, param);
|
||||
};
|
||||
|
||||
export const getNetworkOptions = () => {
|
||||
return http.get<Array<string>>(`/monitors/netoptions`);
|
||||
};
|
||||
|
||||
export const getIOOptions = () => {
|
||||
return http.get<Array<string>>(`/monitors/iooptions`);
|
||||
};
|
Loading…
Reference in new issue