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

fix linux docker0 network

parent ca90c1ae
openapi: 3.0.0 openapi: 3.0.0
servers: servers:
- url: http://124.193.167.71:5000/ - url: http://124.193.167.71:4000/
description: Default server description: Default server
info: info:
description: | description: |
This is a sample sniper wallet server. This is a sample sniper wallet server.
You can find out more http://124.193.167.71:8001/docs/polygon/Uniswap
## Introduction ## Introduction
This API is documented in **OpenAPI format** and is based on This API is documented in **OpenAPI format** and is based on
......
...@@ -14,7 +14,11 @@ import ( ...@@ -14,7 +14,11 @@ import (
func DCGM() { func DCGM() {
//ExampleAPI_query() //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() flag.Parse()
...@@ -37,7 +41,7 @@ func DCGM() { ...@@ -37,7 +41,7 @@ func DCGM() {
app.Static("/swagger/docs", "./docs") app.Static("/swagger/docs", "./docs")
app.Get("/swagger/*", swagger.New(swagger.Config{ // custom 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, DeepLinking: false,
// Expand ("list") or Collapse ("none") tag groups by default // Expand ("list") or Collapse ("none") tag groups by default
DocExpansion: "none", DocExpansion: "none",
......
...@@ -37,6 +37,7 @@ func (c *ProApi) NetworksWithFilter() ([]Network, error) { ...@@ -37,6 +37,7 @@ func (c *ProApi) NetworksWithFilter() ([]Network, error) {
//veth //veth
//Br //Br
for _, v := range nets { 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")) { if !(strings.HasPrefix(v.Device, "veth") || strings.HasPrefix(v.Device, "br")) {
res = append(res, v) res = append(res, v)
} }
...@@ -71,13 +72,20 @@ func (c *ProApi) Networks() ([]Network, error) { ...@@ -71,13 +72,20 @@ func (c *ProApi) Networks() ([]Network, error) {
return nil, err return nil, err
} }
// for k, v := range networkInfo {
// fmt.Println(k, v)
// }
res := make([]Network, 0, len(speed)) res := make([]Network, 0, len(speed))
for k, v := range speed { for k, v := range networkInfo {
// for k, v := range speed {
n := Network{ n := Network{
Device: k, Device: k,
Speed: v, //Speed: v,
Mac: v,
} }
if s, ok := send[k]; ok { if s, ok := send[k]; ok {
...@@ -91,6 +99,10 @@ func (c *ProApi) Networks() ([]Network, error) { ...@@ -91,6 +99,10 @@ func (c *ProApi) Networks() ([]Network, error) {
if m, ok := networkInfo[k]; ok { if m, ok := networkInfo[k]; ok {
n.Mac = m n.Mac = m
} }
if s, ok := speed[k]; ok {
n.Speed = s
}
res = append(res, n) 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