Skip to content
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

feat(ui): Inject Custom CSS #6282

Closed
wants to merge 8 commits into from
Closed
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
8 changes: 8 additions & 0 deletions api/jsonschema/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3661,6 +3661,14 @@
],
"type": "object"
},
"io.argoproj.workflow.v1alpha1.GetSettingsResponse": {
"properties": {
"uiCssURL": {
"type": "string"
}
},
"type": "object"
},
"io.argoproj.workflow.v1alpha1.GetUserInfoResponse": {
"properties": {
"email": {
Expand Down
30 changes: 30 additions & 0 deletions api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1471,6 +1471,28 @@
}
}
},
"/api/v1/settings": {
"get": {
"tags": [
"InfoService"
],
"operationId": "InfoService_GetSettings",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/io.argoproj.workflow.v1alpha1.GetSettingsResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/grpc.gateway.runtime.Error"
}
}
}
}
},
"/api/v1/stream/event-sources/{namespace}": {
"get": {
"tags": [
Expand Down Expand Up @@ -7090,6 +7112,14 @@
}
}
},
"io.argoproj.workflow.v1alpha1.GetSettingsResponse": {
"type": "object",
"properties": {
"uiCssURL": {
"type": "string"
}
}
},
"io.argoproj.workflow.v1alpha1.GetUserInfoResponse": {
"type": "object",
"properties": {
Expand Down
4 changes: 4 additions & 0 deletions cmd/argo/commands/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func NewServerCommand() *cobra.Command {
configMap string
port int
baseHRef string
extraFilesDir string
secure bool
htst bool
namespaced bool // --namespaced
Expand Down Expand Up @@ -92,6 +93,7 @@ See %s`, help.ArgoSever),
"namespace": namespace,
"managedNamespace": managedNamespace,
"baseHRef": baseHRef,
"extraFilesDir": extraFilesDir,
"secure": secure,
}).Info()

Expand Down Expand Up @@ -127,6 +129,7 @@ See %s`, help.ArgoSever),

opts := apiserver.ArgoServerOpts{
BaseHRef: baseHRef,
ExtraFilesDir: extraFilesDir,
TLSConfig: tlsConfig,
HSTS: htst,
Namespace: namespace,
Expand Down Expand Up @@ -179,6 +182,7 @@ See %s`, help.ArgoSever),
defaultBaseHRef = "/"
}
command.Flags().StringVar(&baseHRef, "basehref", defaultBaseHRef, "Value for base href in index.html. Used if the server is running behind reverse proxy under subpath different from /. Defaults to the environment variable BASE_HREF.")
command.Flags().StringVar(&extraFilesDir, "extra-files-dir", "", "Value to serve files from a specified directory. Defaults no serve.")
// "-e" for encrypt, like zip
// We default to secure mode if we find certs available, otherwise we default to insecure mode.
_, err := os.Stat("argo-server.crt")
Expand Down
3 changes: 3 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ type Config struct {
// The command/args for each image, needed when the command is not specified and the emissary executor is used.
// https://argoproj.github.io/argo-workflows/workflow-executors/#emissary-emissary
Images map[string]Image `json:"images,omitempty"`

// UiCssURL local or remote path to user-defined CSS to customize the UI.
UiCssURL string `json:"ui.cssurl,omitempty"`
}

func (c Config) GetContainerRuntimeExecutor(labels labels.Labels) (string, error) {
Expand Down
1 change: 1 addition & 0 deletions docs/cli/argo_server.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ See https://argoproj.github.io/argo-workflows/argo-server.md
--configmap string Name of K8s configmap to retrieve workflow controller configuration (default "workflow-controller-configmap")
--event-operation-queue-size int how many events operations that can be queued at once (default 16)
--event-worker-count int how many event workers to run (default 4)
--extra-files-dir string Value to serve files from a specified directory. Defaults no serve.
-h, --help help for server
--hsts Whether or not we should add a HTTP Secure Transport Security header. This only has effect if secure is enabled. (default true)
--log-format string The formatter to use for logs. One of: text|json (default "text")
Expand Down
5 changes: 5 additions & 0 deletions pkg/apiclient/http1/info-service-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,8 @@ func (h InfoServiceClient) GetUserInfo(_ context.Context, in *infopkg.GetUserInf
out := &infopkg.GetUserInfoResponse{}
return out, h.Get(in, out, "/api/v1/userinfo")
}

func (h InfoServiceClient) GetSettings(_ context.Context, in *infopkg.GetSettingsRequest, _ ...grpc.CallOption) (*infopkg.GetSettingsResponse, error) {
out := &infopkg.GetSettingsResponse{}
return out, h.Get(in, out, "/api/v1/settings")
}
Loading