gemmellr commented on code in PR #21:
URL:
https://github.com/apache/activemq-artemis-console/pull/21#discussion_r1713599637
##########
artemis-console-extension/artemis-extension/public/artemisconfig.json:
##########
@@ -0,0 +1,5 @@
+{
Review Comment:
This one probably fails the RAT check too.
##########
artemis-console-extension/artemis-extension/src/artemis-extension/artemis/config-manager.ts:
##########
@@ -0,0 +1,63 @@
+import { log } from "./globals"
Review Comment:
Missing licence header failed the build on the RAT check. Related, the RAT
check step only uploaded one result file, but they are generated per-module so
the failure isnt actually in the uploaded file.
##########
artemis-console-extension/artemis-extension/src/artemis-extension/artemis/config-manager.ts:
##########
@@ -0,0 +1,63 @@
+import { log } from "./globals"
+
+export type Artemisconfig = {
+ /**
+ * Configuration for branding & styles.
+ */
+ jmx: JMXConfig
+
+}
+
+/**
+ * JMX configuration type.
+ */
+export type JMXConfig = {
+ domain: string
+}
+
+export const ARTEMISCONFIG_JSON = 'artemisconfig.json'
+
+class ConfigManager {
+ private config?: Promise<Artemisconfig>
+
+ getArtemisconfig(): Promise<Artemisconfig> {
+ if (this.config) {
+ return this.config
+ }
+
+ this.config = this.loadConfig()
+ return this.config
+ }
+
+
+ private async loadConfig(): Promise<Artemisconfig> {
+
+ try {
+ const res = await fetch(ARTEMISCONFIG_JSON)
+ if (!res.ok) {
+
+ log.info("Unable to load Artemis Config using Default");
+ return {
+ jmx: {
+ domain: "org.apache.activemq.artemis"
+ }
+ }
+ }
+
+ const config = await res.json()
+
+ log.info("Loaded Artemis Config:", config);
+ return config
+ } catch (err) {
+ log.info("Unable to load Artemis Config using Default");
Review Comment:
Comma needed to make the log message more understandable: ", using Default"
##########
artemis-console-extension/artemis-extension/src/artemis-extension/artemis/config-manager.ts:
##########
@@ -0,0 +1,63 @@
+import { log } from "./globals"
+
+export type Artemisconfig = {
+ /**
+ * Configuration for branding & styles.
+ */
+ jmx: JMXConfig
+
+}
+
+/**
+ * JMX configuration type.
+ */
+export type JMXConfig = {
+ domain: string
+}
+
+export const ARTEMISCONFIG_JSON = 'artemisconfig.json'
+
+class ConfigManager {
+ private config?: Promise<Artemisconfig>
+
+ getArtemisconfig(): Promise<Artemisconfig> {
+ if (this.config) {
+ return this.config
+ }
+
+ this.config = this.loadConfig()
+ return this.config
+ }
+
+
+ private async loadConfig(): Promise<Artemisconfig> {
+
+ try {
+ const res = await fetch(ARTEMISCONFIG_JSON)
+ if (!res.ok) {
+
+ log.info("Unable to load Artemis Config using Default");
Review Comment:
Indentation seems wonky.
Comma needed to make the log message more understandable: ", using Default"
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact