mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
- 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.
29 lines
394 B
Go
29 lines
394 B
Go
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"
|
|
}
|
|
}
|