@@ -10,22 +10,27 @@ import (
1010 "github.com/easysoft/qcadmin/cmd/app"
1111 "github.com/easysoft/qcadmin/cmd/manage"
1212 "github.com/easysoft/qcadmin/cmd/quickon"
13+ "github.com/easysoft/qcadmin/internal/app/config"
1314 "github.com/easysoft/qcadmin/internal/pkg/util/factory"
15+ "github.com/easysoft/qcadmin/internal/pkg/util/kutil"
1416 "github.com/spf13/cobra"
1517)
1618
1719func newCmdApp (f factory.Factory ) * cobra.Command {
1820 appCmd := & cobra.Command {
1921 Use : "app" ,
20- Short : "Manage Quickon applications" ,
21- Version : "20230330" ,
22+ Short : "Manage applications" ,
23+ Version : "20230906" ,
24+ }
25+ cfg , _ := config .LoadConfig ()
26+ if cfg == nil || ! cfg .Quickon .DevOps {
27+ appCmd .AddCommand (app .NewCmdAppExec (f ))
28+ appCmd .AddCommand (app .NewCmdAppGet (f ))
29+ appCmd .AddCommand (app .NewCmdAppLogs (f ))
30+ appCmd .AddCommand (app .NewCmdAppInstall (f ))
31+ appCmd .AddCommand (app .NewCmdAppMarket (f ))
2232 }
23- appCmd .AddCommand (app .NewCmdAppExec (f ))
24- appCmd .AddCommand (app .NewCmdAppGet (f ))
25- appCmd .AddCommand (app .NewCmdAppLogs (f ))
2633 appCmd .AddCommand (app .NewCmdAppList (f ))
27- appCmd .AddCommand (app .NewCmdAppInstall (f ))
28- appCmd .AddCommand (app .NewCmdAppMarket (f ))
2934 return appCmd
3035}
3136
@@ -41,13 +46,18 @@ func newCmdPlatform(f factory.Factory) *cobra.Command {
4146 platformCmd .AddCommand (quickon .InitCommand (f ))
4247 platformCmd .AddCommand (quickon .UninstallCommand (f ))
4348 platformCmd .AddCommand (manage .NewCmdPlugin (f ))
44- platformCmd .AddCommand (manage .NewResetPassword (f ))
45- platformCmd .AddCommand (manage .NewRenewTLS (f ))
4649 gdbCmd := & cobra.Command {
4750 Use : "gdb" ,
4851 Short : "Manage Global Database" ,
4952 }
5053 gdbCmd .AddCommand (manage .NewCmdGdbList (f ))
5154 platformCmd .AddCommand (gdbCmd )
55+ cfg , _ := config .LoadConfig ()
56+ if cfg == nil || ! cfg .Quickon .DevOps {
57+ platformCmd .AddCommand (manage .NewResetPassword (f ))
58+ }
59+ if cfg == nil || kutil .IsLegalDomain (cfg .Domain ) {
60+ platformCmd .AddCommand (manage .NewRenewTLS (f ))
61+ }
5262 return platformCmd
5363}
0 commit comments