mirror of
https://github.com/minio/minio.git
synced 2025-04-22 11:26:36 -04:00
Use normal color instead of forced white for users who have bright terminal background (#2200)
This commit is contained in:
parent
cdf1373f8e
commit
3f27734c22
@ -58,4 +58,5 @@ var (
|
|||||||
colorWhite = color.New(color.FgWhite).SprintfFunc()
|
colorWhite = color.New(color.FgWhite).SprintfFunc()
|
||||||
colorWhiteBold = color.New(color.FgWhite, color.Bold).SprintfFunc()
|
colorWhiteBold = color.New(color.FgWhite, color.Bold).SprintfFunc()
|
||||||
colorBlue = color.New(color.FgBlue).SprintfFunc()
|
colorBlue = color.New(color.FgBlue).SprintfFunc()
|
||||||
|
colorBold = color.New(color.Bold).SprintFunc()
|
||||||
)
|
)
|
||||||
|
@ -56,13 +56,13 @@ func printServerCommonMsg(endPoints []string) {
|
|||||||
|
|
||||||
endPointStr := strings.Join(endPoints, " ")
|
endPointStr := strings.Join(endPoints, " ")
|
||||||
// Colorize the message and print.
|
// Colorize the message and print.
|
||||||
console.Println(colorBlue("\nEndpoint: ") + colorWhiteBold(fmt.Sprintf(getFormatStr(len(endPointStr), 1), endPointStr)))
|
console.Println(colorBlue("\nEndpoint: ") + colorBold(fmt.Sprintf(getFormatStr(len(endPointStr), 1), endPointStr)))
|
||||||
console.Println(colorBlue("AccessKey: ") + colorWhiteBold(fmt.Sprintf("%s ", cred.AccessKeyID)))
|
console.Println(colorBlue("AccessKey: ") + colorBold(fmt.Sprintf("%s ", cred.AccessKeyID)))
|
||||||
console.Println(colorBlue("SecretKey: ") + colorWhiteBold(fmt.Sprintf("%s ", cred.SecretAccessKey)))
|
console.Println(colorBlue("SecretKey: ") + colorBold(fmt.Sprintf("%s ", cred.SecretAccessKey)))
|
||||||
console.Println(colorBlue("Region: ") + colorWhiteBold(fmt.Sprintf(getFormatStr(len(region), 3), region)))
|
console.Println(colorBlue("Region: ") + colorBold(fmt.Sprintf(getFormatStr(len(region), 3), region)))
|
||||||
|
|
||||||
console.Println(colorBlue("\nBrowser Access:"))
|
console.Println(colorBlue("\nBrowser Access:"))
|
||||||
console.Println(colorWhite(fmt.Sprintf(getFormatStr(len(endPointStr), 3), endPointStr)))
|
console.Println(fmt.Sprintf(getFormatStr(len(endPointStr), 3), endPointStr))
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prints startup message for command line access. Prints link to our documentation
|
// Prints startup message for command line access. Prints link to our documentation
|
||||||
@ -72,21 +72,21 @@ func printCLIAccessMsg(endPoint string) {
|
|||||||
cred := serverConfig.GetCredential()
|
cred := serverConfig.GetCredential()
|
||||||
|
|
||||||
// Configure 'mc', following block prints platform specific information for minio client.
|
// Configure 'mc', following block prints platform specific information for minio client.
|
||||||
console.Println(colorBlue("\nCommand-line Access: ") + colorWhite(mcQuickStartGuide))
|
console.Println(colorBlue("\nCommand-line Access: ") + mcQuickStartGuide)
|
||||||
if runtime.GOOS == "windows" {
|
if runtime.GOOS == "windows" {
|
||||||
mcMessage := fmt.Sprintf("$ mc.exe config host add myminio %s %s %s", endPoint, cred.AccessKeyID, cred.SecretAccessKey)
|
mcMessage := fmt.Sprintf("$ mc.exe config host add myminio %s %s %s", endPoint, cred.AccessKeyID, cred.SecretAccessKey)
|
||||||
console.Println(colorWhite(fmt.Sprintf(getFormatStr(len(mcMessage), 3), mcMessage)))
|
console.Println(fmt.Sprintf(getFormatStr(len(mcMessage), 3), mcMessage))
|
||||||
} else {
|
} else {
|
||||||
mcMessage := fmt.Sprintf("$ mc config host add myminio %s %s %s", endPoint, cred.AccessKeyID, cred.SecretAccessKey)
|
mcMessage := fmt.Sprintf("$ mc config host add myminio %s %s %s", endPoint, cred.AccessKeyID, cred.SecretAccessKey)
|
||||||
console.Println(colorWhite(fmt.Sprintf(getFormatStr(len(mcMessage), 3), mcMessage)))
|
console.Println(fmt.Sprintf(getFormatStr(len(mcMessage), 3), mcMessage))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prints startup message for Object API acces, prints link to our SDK documentation.
|
// Prints startup message for Object API acces, prints link to our SDK documentation.
|
||||||
func printObjectAPIMsg() {
|
func printObjectAPIMsg() {
|
||||||
console.Println(colorBlue("\nObject API (Amazon S3 compatible):"))
|
console.Println(colorBlue("\nObject API (Amazon S3 compatible):"))
|
||||||
console.Println(colorBlue(" Go: ") + colorWhite(fmt.Sprintf(getFormatStr(len(goQuickStartGuide), 8), goQuickStartGuide)))
|
console.Println(colorBlue(" Go: ") + fmt.Sprintf(getFormatStr(len(goQuickStartGuide), 8), goQuickStartGuide))
|
||||||
console.Println(colorBlue(" Java: ") + colorWhite(fmt.Sprintf(getFormatStr(len(javaQuickStartGuide), 6), javaQuickStartGuide)))
|
console.Println(colorBlue(" Java: ") + fmt.Sprintf(getFormatStr(len(javaQuickStartGuide), 6), javaQuickStartGuide))
|
||||||
console.Println(colorBlue(" Python: ") + colorWhite(fmt.Sprintf(getFormatStr(len(pyQuickStartGuide), 4), pyQuickStartGuide)))
|
console.Println(colorBlue(" Python: ") + fmt.Sprintf(getFormatStr(len(pyQuickStartGuide), 4), pyQuickStartGuide))
|
||||||
console.Println(colorBlue(" JavaScript: ") + colorWhite(jsQuickStartGuide))
|
console.Println(colorBlue(" JavaScript: ") + jsQuickStartGuide)
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user