personal license added
This commit is contained in:
parent
bc51750141
commit
60b325eabf
|
@ -26,8 +26,10 @@ func NewStatusLine(configFileName string, palette console.Palette, license *meta
|
||||||
block.Border = false
|
block.Border = false
|
||||||
text := fmt.Sprintf(" %s %s | ", console.AppTitle, console.AppVersion)
|
text := fmt.Sprintf(" %s %s | ", console.AppTitle, console.AppVersion)
|
||||||
|
|
||||||
if license == nil || !license.Valid {
|
if license == nil || !license.Valid || license.Type == nil {
|
||||||
text += console.AppLicenseWarning
|
text += console.AppLicenseWarning
|
||||||
|
} else if *license.Type == metadata.TypePersonal {
|
||||||
|
text += fmt.Sprintf("%s | personal license: %s", configFileName, *license.Username)
|
||||||
} else if license.Username != nil {
|
} else if license.Username != nil {
|
||||||
text += fmt.Sprintf("%s | licensed to %s", configFileName, *license.Username)
|
text += fmt.Sprintf("%s | licensed to %s", configFileName, *license.Username)
|
||||||
if license.Company != nil {
|
if license.Company != nil {
|
||||||
|
|
|
@ -9,9 +9,17 @@ type License struct {
|
||||||
Key *string `yaml:"k"`
|
Key *string `yaml:"k"`
|
||||||
Username *string `yaml:"u"`
|
Username *string `yaml:"u"`
|
||||||
Company *string `yaml:"c"`
|
Company *string `yaml:"c"`
|
||||||
|
Type *LicenseType `yaml:"t"`
|
||||||
Valid bool `yaml:"v"`
|
Valid bool `yaml:"v"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type LicenseType rune
|
||||||
|
|
||||||
|
const (
|
||||||
|
TypePersonal LicenseType = 0
|
||||||
|
TypeCommercial LicenseType = 1
|
||||||
|
)
|
||||||
|
|
||||||
const licenseFileName = "license.yml"
|
const licenseFileName = "license.yml"
|
||||||
|
|
||||||
func GetLicense() *License {
|
func GetLicense() *License {
|
||||||
|
|
Loading…
Reference in New Issue