@Summary get Net info @Produce application/json @Accept application/json @Tags sys @Security ApiKeyAuth @Success 200 {string} string "ok" @Router /sys/net [get]
(ctx echo.Context)
| 294 | // @Success 200 {string} string "ok" |
| 295 | // @Router /sys/net [get] |
| 296 | func GetSystemNetInfo(ctx echo.Context) error { |
| 297 | netList := service.MyService.System().GetNetInfo() |
| 298 | newNet := []model.IOCountersStat{} |
| 299 | for _, n := range netList { |
| 300 | for _, netCardName := range service.MyService.System().GetNet(true) { |
| 301 | if n.Name == netCardName { |
| 302 | item := *(*model.IOCountersStat)(unsafe.Pointer(&n)) |
| 303 | item.State = strings.TrimSpace(service.MyService.System().GetNetState(n.Name)) |
| 304 | item.Time = time.Now().Unix() |
| 305 | newNet = append(newNet, item) |
| 306 | break |
| 307 | } |
| 308 | } |
| 309 | } |
| 310 | |
| 311 | return ctx.JSON(http.StatusOK, model.Result{Success: common_err.SUCCESS, Message: common_err.GetMsg(common_err.SUCCESS), Data: newNet}) |
| 312 | } |
| 313 | |
| 314 | func GetSystemProxy(ctx echo.Context) error { |
| 315 | url := ctx.QueryParam("url") |
nothing calls this directly
no test coverage detected