-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: refactor system info retrieval and enhance logo output
- Replaced viper calls with utility functions in GetSystemInfo to improve code clarity and maintainability. - Added a new system.go file with utility functions for retrieving system version and edition information. - Enhanced PrintLogoWithWelcomeInfo to include detailed system information, improving user experience during server startup. - Updated output formatting for better readability and consistency in welcome messages.
- Loading branch information
Showing
4 changed files
with
46 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package utils | ||
|
||
import "github.com/spf13/viper" | ||
|
||
func GetVersion() string { | ||
return viper.GetString("version") | ||
|
||
} | ||
|
||
func GetEdition() string { | ||
return viper.GetString("edition") | ||
} | ||
|
||
func GetEditionLabel() string { | ||
if IsPro() { | ||
return "Crawlab Pro" | ||
} else { | ||
return "Crawlab Community" | ||
} | ||
} | ||
|
||
func GetNodeTypeLabel() string { | ||
if IsMaster() { | ||
return "Master" | ||
} else { | ||
return "Worker" | ||
} | ||
} |
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