Skip to content

Commit

Permalink
Add admin links
Browse files Browse the repository at this point in the history
  • Loading branch information
jakozaur committed May 3, 2024
1 parent 3ce7c1b commit ebfe534
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 6 deletions.
1 change: 0 additions & 1 deletion docker/local-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ services:
- QUESMA_elasticsearch_url=http://elasticsearch:9200
- QUESMA_port=8080
- QUESMA_logging_path=/var/quesma/logs
- QUESMA_clickhouse_url=clickhouse://clickhouse:9000
- QUESMA_mode=dual-write-query-clickhouse
- QUESMA_CONFIG_FILE=/config/local-dev.yaml
depends_on:
Expand Down
1 change: 0 additions & 1 deletion docker/opensearch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ services:
- QUESMA_elasticsearch_url=http://opensearch:9200
- QUESMA_port=8080
- QUESMA_logging_path=/var/quesma/logs
- QUESMA_clickhouse_url=clickhouse://clickhouse:9000
- QUESMA_CONFIG_FILE=/config/local-dev.yaml
depends_on:
clickhouse:
Expand Down
8 changes: 5 additions & 3 deletions docker/quesma/config/local-dev.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@
mode: "dual-write-query-clickhouse"
port: 8080 # public tcp port to listen for incoming traffic
elasticsearch:
url: "http://localhost:9200"
#url: "http://localhost:9200"
call: false
#clickhouse: # this config is going to be removed, but for now let's just comment out
# url: "clickhouse://localhost:9000"
adminUrl: "http://localhost:5601"
clickhouse:
url: "clickhouse://clickhouse:9000"
adminUrl: "http://localhost:8123/play"
ingestStatistics: true
internalTelemetryUrl: "https://api.quesma.com/phone-home"
logging:
Expand Down
2 changes: 2 additions & 0 deletions quesma/quesma/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ type ElasticsearchConfiguration struct {
User string `koanf:"user"`
Password string `koanf:"password"`
Call bool `koanf:"call"`
AdminUrl *Url `koanf:"adminUrl"`
}

type RelationalDbConfiguration struct {
Url *Url `koanf:"url"`
User string `koanf:"user"`
Password string `koanf:"password"`
Database string `koanf:"database"`
AdminUrl *Url `koanf:"adminUrl"`
}

func (c *RelationalDbConfiguration) IsEmpty() bool {
Expand Down
19 changes: 18 additions & 1 deletion quesma/quesma/ui/html_panels.go
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,19 @@ func (qmc *QuesmaManagementConsole) generateDashboardPanel() []byte {
storeName = "<h3>OpenSearch</h3>"
}

clickhouseName := "<h3>ClickHouse</h3>"
if qmc.config.Hydrolix.Url != nil {
clickhouseName = "<h3>Hydrolix</h3>"
}

buffer.Html(`<div id="dashboard-kibana" class="component">`)
if qmc.config.Elasticsearch.AdminUrl != nil {
buffer.Html(fmt.Sprintf(`<a href="%s">`, qmc.config.Elasticsearch.AdminUrl.String()))
}
buffer.Html(dashboardName)
if qmc.config.Elasticsearch.AdminUrl != nil {
buffer.Html(`</a>`)
}
buffer.Html(statusToDiv(qmc.checkKibana()))
buffer.Html(`</div>`)

Expand All @@ -262,7 +273,13 @@ func (qmc *QuesmaManagementConsole) generateDashboardPanel() []byte {
buffer.Html(`</div>`)

buffer.Html(`<div id="dashboard-clickhouse" class="component">`)
buffer.Html(`<h3>ClickHouse</h3>`)
if qmc.config.ClickHouse.AdminUrl != nil {
buffer.Html(fmt.Sprintf(`<a href="%s">`, qmc.config.ClickHouse.AdminUrl.String()))
}
buffer.Html(clickhouseName)
if qmc.config.ClickHouse.AdminUrl != nil {
buffer.Html(`</a>`)
}
buffer.Html(statusToDiv(qmc.checkClickhouseHealth()))
buffer.Html(`</div>`)

Expand Down

0 comments on commit ebfe534

Please sign in to comment.