8000 feat(admin-ui): add create and edit organization screen by rsbh · Pull Request #978 · raystack/frontier · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(admin-ui): add create and edit organization screen #978

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
May 2, 2025
Merged
11 changes: 6 additions & 5 deletions pkg/server/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,12 @@ type GRPCConfig struct {
func (cfg Config) grpcAddr() string { return fmt.Sprintf("%s:%d", cfg.Host, cfg.GRPC.Port) }

type UIConfig struct {
Port int `yaml:"port" mapstructure:"port"`
Title string `yaml:"title" mapstructure:"title"`
Logo string `yaml:"logo" mapstructure:"logo"`
AppURL string `yaml:"app_url" mapstructure:"app_url"`
TokenProductId string `yaml:"token_product_id" mapstructure:"token_product_id"`
Port int `yaml:"port" mapstructure:"port"`
Title string `yaml:"title" mapstructure:"title"`
Logo string `yaml:"logo" mapstructure:"logo"`
AppURL string `yaml:"app_url" mapstructure:"app_url"`
TokenProductId string `yaml:"token_product_id" mapstructure:"token_product_id"`
OrganizationTypes []string `yaml:"organization_types" mapstructure:"organization_types"`
}

type Config struct {
Expand Down
16 changes: 10 additions & 6 deletions pkg/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,11 @@ const (
)

type UIConfigApiResponse struct {
Title string `json:"title"`
Logo string `json:"logo"`
AppUrl string `json:"app_url"`
Title string `json:"title"`
Logo string `json:"logo"`
AppUrl string `json:"app_url"`
TokenProductId string `json:"token_product_id"`
OrganizationTypes []string `json:"organization_types"`
}

func ServeUI(ctx context.Context, logger log.Logger, uiConfig UIConfig, apiServerConfig Config) {
Expand Down Expand Up @@ -94,9 +96,11 @@ func ServeUI(ctx context.Context, logger log.Logger, uiConfig UIConfig, apiServe
http.HandleFunc("/configs", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
confResp := UIConfigApiResponse{
Title: uiConfig.Title,
Logo: uiConfig.Logo,
AppUrl: uiConfig.AppURL,
Title: uiConfig.Title,
Logo: uiConfig.Logo,
AppUrl: uiConfig.AppURL,
TokenProductId: uiConfig.TokenProductId,
OrganizationTypes: uiConfig.OrganizationTypes,
}
json.NewEncoder(w).Encode(confResp)
})
Expand Down
Loading
Loading
0