Added Mercure_URL var env
parent
67ebc5b926
commit
7a7c3e8e0d
|
|
@ -1 +1,2 @@
|
||||||
NG_APP_BASE_API_URL=https://127.0.0.1:8443
|
NG_APP_BASE_API_URL=https://127.0.0.1:8443
|
||||||
|
NG_APP_OGCORE_MERCURE_BASE_URL=http://localhost:3000/.well-known/mercure
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@ import {ToastrService} from "ngx-toastr";
|
||||||
})
|
})
|
||||||
export class TaskLogsComponent implements OnInit {
|
export class TaskLogsComponent implements OnInit {
|
||||||
baseUrl: string = import.meta.env.NG_APP_BASE_API_URL;
|
baseUrl: string = import.meta.env.NG_APP_BASE_API_URL;
|
||||||
|
mercureUrl: string = import.meta.env.NG_APP_OGCORE_MERCURE_BASE_URL;
|
||||||
traces: any[] = [];
|
traces: any[] = [];
|
||||||
groupedTraces: any[] = [];
|
groupedTraces: any[] = [];
|
||||||
commands: any[] = [];
|
commands: any[] = [];
|
||||||
|
|
@ -109,7 +110,7 @@ export class TaskLogsComponent implements OnInit {
|
||||||
map(name => (name ? this._filterClients(name) : this.clients.slice()))
|
map(name => (name ? this._filterClients(name) : this.clients.slice()))
|
||||||
);
|
);
|
||||||
|
|
||||||
const eventSource = new EventSource('http://localhost:3000/.well-known/mercure?topic='
|
const eventSource = new EventSource(`${this.mercureUrl}?topic=`
|
||||||
+ encodeURIComponent(`traces`));
|
+ encodeURIComponent(`traces`));
|
||||||
|
|
||||||
eventSource.onmessage = (event) => {
|
eventSource.onmessage = (event) => {
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,7 @@ enum NodeType {
|
||||||
})
|
})
|
||||||
export class GroupsComponent implements OnInit, OnDestroy {
|
export class GroupsComponent implements OnInit, OnDestroy {
|
||||||
baseUrl: string = import.meta.env.NG_APP_BASE_API_URL;
|
baseUrl: string = import.meta.env.NG_APP_BASE_API_URL;
|
||||||
|
mercureUrl: string = import.meta.env.NG_APP_OGCORE_MERCURE_BASE_URL;
|
||||||
organizationalUnits: UnidadOrganizativa[] = [];
|
organizationalUnits: UnidadOrganizativa[] = [];
|
||||||
selectedUnidad: UnidadOrganizativa | null = null;
|
selectedUnidad: UnidadOrganizativa | null = null;
|
||||||
selectedDetail: UnidadOrganizativa | null = null;
|
selectedDetail: UnidadOrganizativa | null = null;
|
||||||
|
|
@ -138,7 +139,7 @@ export class GroupsComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
this.arrayClients = this.selectedClients.data;
|
this.arrayClients = this.selectedClients.data;
|
||||||
|
|
||||||
const eventSource = new EventSource('http://localhost:3000/.well-known/mercure?topic='
|
const eventSource = new EventSource(`${this.mercureUrl}?topic=`
|
||||||
+ encodeURIComponent(`clients`));
|
+ encodeURIComponent(`clients`));
|
||||||
|
|
||||||
eventSource.onmessage = (event) => {
|
eventSource.onmessage = (event) => {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
interface ImportMetaEnv {
|
interface ImportMetaEnv {
|
||||||
readonly NG_APP_BASE_API_URL: string; // Define aquí todas las variables que necesitas
|
readonly NG_APP_BASE_API_URL: string;
|
||||||
|
readonly NG_APP_OGCORE_MERCURE_BASE_URL: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ImportMeta {
|
interface ImportMeta {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue