Commit 9b240030 authored by Your Name's avatar Your Name

fix linux docker0 network

parent ca90c1ae
openapi: 3.0.0
servers:
- url: http://124.193.167.71:5000/
- url: http://124.193.167.71:4000/
description: Default server
info:
description: |
This is a sample sniper wallet server.
You can find out more http://124.193.167.71:8001/docs/polygon/Uniswap
## Introduction
This API is documented in **OpenAPI format** and is based on
......
......@@ -14,7 +14,11 @@ import (
func DCGM() {
//ExampleAPI_query()
promethAddr := flag.String("promethaddr", "http://127.0.0.1:9090", "a string parameter")
//promethAddr := flag.String("promethaddr", "http://127.0.0.1:9090", "a string parameter")
//http://47.94.59.74:9000/
promethAddr := flag.String("promethaddr", "http://47.94.59.74:9000", "a string parameter")
flag.Parse()
......@@ -37,7 +41,7 @@ func DCGM() {
app.Static("/swagger/docs", "./docs")
app.Get("/swagger/*", swagger.New(swagger.Config{ // custom
URL: "http://124.193.167.71:5000/swagger/docs/swagger.yaml", //http://124.193.167.71:8000/
URL: "http://124.193.167.71:4000/swagger/docs/swagger.yaml", //http://124.193.167.71:8000/
DeepLinking: false,
// Expand ("list") or Collapse ("none") tag groups by default
DocExpansion: "none",
......
......@@ -37,6 +37,7 @@ func (c *ProApi) NetworksWithFilter() ([]Network, error) {
//veth
//Br
for _, v := range nets {
//fmt.Println(v.Device, !(strings.HasPrefix(v.Device, "veth") || strings.HasPrefix(v.Device, "br")))
if !(strings.HasPrefix(v.Device, "veth") || strings.HasPrefix(v.Device, "br")) {
res = append(res, v)
}
......@@ -71,13 +72,20 @@ func (c *ProApi) Networks() ([]Network, error) {
return nil, err
}
// for k, v := range networkInfo {
// fmt.Println(k, v)
// }
res := make([]Network, 0, len(speed))
for k, v := range speed {
for k, v := range networkInfo {
// for k, v := range speed {
n := Network{
Device: k,
Speed: v,
//Speed: v,
Mac: v,
}
if s, ok := send[k]; ok {
......@@ -91,6 +99,10 @@ func (c *ProApi) Networks() ([]Network, error) {
if m, ok := networkInfo[k]; ok {
n.Mac = m
}
if s, ok := speed[k]; ok {
n.Speed = s
}
res = append(res, n)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment