-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove tview usage, move to simple table (#112)
``` ┌──────┬────────────────────────────┬────────┬───────┬──────────┬─────┬─────┬────────────────┬───────────────┬─────────────┬─────────────┐ │ SITE │ HOST │ STATUS │ CALLS │ FAILURES │ Rx │ Tx │ TOTAL DOWNTIME │ LAST DOWNTIME │ MIN LATENCY │ MAX LATENCY │ │ 1st │ https://play.min.io │ DOWN │ 2 │ 2 │ 0 B │ 0 B │ 0s │ 0s │ 20.022ms │ 170.241ms │ │ 1st │ https://play.min.io:9000 │ DOWN │ 2 │ 2 │ 0 B │ 0 B │ 0s │ 0s │ 18.26ms │ 164.849ms │ │ 1st │ https://play.minio.io │ DOWN │ 2 │ 2 │ 0 B │ 0 B │ 0s │ 0s │ 26.907ms │ 511.224ms │ │ 1st │ https://play.minio.io:9000 │ DOWN │ 2 │ 2 │ 0 B │ 0 B │ 0s │ 0s │ 19.102ms │ 515.213ms │ │ 2nd │ https://play.min.io │ DOWN │ 2 │ 2 │ 0 B │ 0 B │ 0s │ 0s │ 20.162ms │ 169.74ms │ │ 2nd │ https://play.min.io:9000 │ DOWN │ 2 │ 2 │ 0 B │ 0 B │ 0s │ 0s │ 17.96ms │ 164.112ms │ │ 2nd │ https://play.minio.io │ DOWN │ 2 │ 2 │ 0 B │ 0 B │ 0s │ 0s │ 23.556ms │ 510.524ms │ │ 2nd │ https://play.minio.io:9000 │ DOWN │ 2 │ 2 │ 0 B │ 0 B │ 0s │ 0s │ 28.173ms │ 486.845ms │ └──────┴────────────────────────────┴────────┴───────┴──────────┴─────┴─────┴────────────────┴───────────────┴─────────────┴─────────────┘ ```
- Loading branch information
1 parent
7a292f1
commit 55054df
Showing
6 changed files
with
564 additions
and
1,611 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
// Copyright (c) 2021-2024 MinIO, Inc. | ||
// | ||
// This program is free software: you can redistribute it and/or modify | ||
// it under the terms of the GNU Affero General Public License as published by | ||
// the Free Software Foundation, either version 3 of the License, or | ||
// (at your option) any later version. | ||
// | ||
// This program is distributed in the hope that it will be useful, | ||
// but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
// GNU Affero General Public License for more details. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
package main | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/fatih/color" | ||
) | ||
|
||
// An alias of string to represent the health color code of an object | ||
type col string | ||
|
||
const ( | ||
colGrey col = "Grey" | ||
colRed col = "Red" | ||
colYellow col = "Yellow" | ||
colGreen col = "Green" | ||
) | ||
|
||
func clearScreen() { | ||
fmt.Print("\033[H\033[2J") | ||
} | ||
|
||
// getPrintCol - map color code to color for printing | ||
func getPrintCol(c col) *color.Color { | ||
switch c { | ||
case colGrey: | ||
return color.New(color.FgWhite, color.Bold) | ||
case colRed: | ||
return color.New(color.FgRed, color.Bold) | ||
case colYellow: | ||
return color.New(color.FgYellow, color.Bold) | ||
case colGreen: | ||
return color.New(color.FgGreen, color.Bold) | ||
} | ||
return nil | ||
} |
Oops, something went wrong.