Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/get/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ func NewConfigCmd() *cobra.Command {
`),
Example: heredoc.Doc(`
$ lr get config
APP Name: <Your App Name>
API Key: <Your API Key>
API Secret: <Your API secret >

Expand Down
6 changes: 5 additions & 1 deletion cmd/get/schema/schema.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ func get() error {
if v.Enabled {
enabled = "true"
}
data = append(data, []string{k, v.Display, v.Type, enabled})
Type := v.Type
if Type == "multi" {
Type = "checkbox"
}
data = append(data, []string{k, v.Display, Type, enabled})
}
sort.SliceStable(data, func(i, j int) bool {
return data[i][3] == "true"
Expand Down
18 changes: 11 additions & 7 deletions cmd/get/site/site.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ func NewSiteCmd() *cobra.Command {
Example: heredoc.Doc(`
$ lr get site --all
All sites:
+--------+-----------------+-------------------------+-----------+
| ID | NAME | DOMAIN | PLAN |
+--------+-----------------+-------------------------+-----------+
| 111111 | new-test1 | https://mail7.io | free |
| 122222 | my-app-final | loginradius.com | business |
| 142670 | trail-pro | https://loginradius.com | business |
+--------+-----------------+-------------------------+----------------+
| ID | NAME | DOMAIN | PLAN |
+--------+-----------------+-------------------------+----------------+
| 111111 | new-test1 | https://mail7.io | free |
| 122222 | my-app-final | loginradius.com | developer pro |
| 142670 | trail-pro | https://loginradius.com | developer pro |

$ lr get site --active
Current site:
Expand Down Expand Up @@ -70,7 +70,11 @@ func getSite() error {
var data [][]string
fmt.Println("All sites: ")
for _, site := range AppInfo {
data = append(data, []string{strconv.FormatInt(site.Appid, 10), site.Appname, site.Domain, site.Productplan.Name})
ProductPlan := site.Productplan.Name
if ProductPlan == "business" {
ProductPlan = "developer pro"
}
data = append(data, []string{strconv.FormatInt(site.Appid, 10), site.Appname, site.Domain, ProductPlan})
}
table := tablewriter.NewWriter(os.Stdout)
table.SetHeader([]string{"ID", "Name", "Domain", "Plan"})
Expand Down