Adds APP_URL as base tag href to enable loading via ui via ingress routes (#2195)

This commit is contained in:
Simon Morris 2023-02-15 06:49:23 -08:00 committed by GitHub
parent 42e005f041
commit 8356ebf097
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 2 deletions

View File

@ -46,7 +46,7 @@ spec:
{{- toYaml .Values.resources | nindent 12 }}
env:
- name: "APP_URL"
value: "http://localhost:8081"
value: {{ .Values.envs.appUrl }}
- name: "OPERATOR_API_URL"
value: {{ .Values.envs.operatorApiUrl | quote }}
- name: "OPERATOR_CLUSTER_NAME_LABEL"

View File

@ -41,6 +41,7 @@ resources:
envs:
# IMPORTANT: While operator chart and UI chart are independent, this is the interface between
# UI and operator API. Insert the service name of the operator API here!
appUrl: "http://localhost:8081"
operatorApiUrl: "http://postgres-operator:8080"
operatorClusterNameLabel: "cluster-name"
resourcesVisible: "False"

View File

@ -311,7 +311,7 @@ def send_js(path):
@app.route('/')
@authorize
def index():
return render_template('index.html', google_analytics=GOOGLE_ANALYTICS)
return render_template('index.html', google_analytics=GOOGLE_ANALYTICS, app_url=APP_URL)
DEFAULT_UI_CONFIG = {

View File

@ -2,6 +2,7 @@
<html lang="en">
<head>
<meta charset="utf-8">
<base href="{{app_url}}">
<title>PostgreSQL Operator UI</title>