Files
crawlab/core/utils/system.go
Marvin Zhang 54800974eb 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.
2024-12-29 19:01:23 +08:00

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"
}
}