@bitblit/ngx-acute-common 5.0.577-alpha → 5.0.579-alpha

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,20 @@
1
+ import { Router } from '@angular/router';
2
+ import { BehaviorSubject } from "rxjs";
3
+ import { LogMessage } from "@bitblit/ratchet-common/logger/log-message";
4
+ import * as i0 from "@angular/core";
5
+ export declare class LogDisplayComponent {
6
+ router: Router;
7
+ buttonIcon: string;
8
+ displayShowIcon: boolean;
9
+ visible: boolean;
10
+ snap: BehaviorSubject<LogMessage[]>;
11
+ updatedEpoch: number;
12
+ constructor(router: Router);
13
+ fetchMessagesCopy(): LogMessage[];
14
+ refresh(): void;
15
+ formatTime(tm: number): string;
16
+ format(lm: LogMessage): string;
17
+ open(): void;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<LogDisplayComponent, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<LogDisplayComponent, "ngx-acute-common-log-display", never, { "buttonIcon": { "alias": "buttonIcon"; "required": false; }; "displayShowIcon": { "alias": "displayShowIcon"; "required": false; }; }, {}, never, never, true, never>;
20
+ }
@@ -0,0 +1,117 @@
1
+ import { Component, Input } from '@angular/core';
2
+ import { Router } from '@angular/router';
3
+ import { CardModule } from "primeng/card";
4
+ import { ButtonModule } from "primeng/button";
5
+ import { TooltipModule } from "primeng/tooltip";
6
+ import { DividerModule } from "primeng/divider";
7
+ import { InputTextModule } from "primeng/inputtext";
8
+ import { Drawer } from "primeng/drawer";
9
+ import { TableModule } from "primeng/table";
10
+ import { BehaviorSubject } from "rxjs";
11
+ import { AsyncPipe } from "@angular/common";
12
+ import { Logger } from "@bitblit/ratchet-common/logger/logger";
13
+ import { DurationRatchet } from "@bitblit/ratchet-common/lang/duration-ratchet";
14
+ import * as i0 from "@angular/core";
15
+ import * as i1 from "@angular/router";
16
+ import * as i2 from "primeng/api";
17
+ import * as i3 from "primeng/button";
18
+ import * as i4 from "primeng/table";
19
+ function LogDisplayComponent_ng_template_7_Template(rf, ctx) { if (rf & 1) {
20
+ i0.ɵɵelementStart(0, "tr")(1, "th", 7);
21
+ i0.ɵɵtext(2, "Timestamp ");
22
+ i0.ɵɵelement(3, "p-sortIcon", 8);
23
+ i0.ɵɵelementEnd();
24
+ i0.ɵɵelementStart(4, "th");
25
+ i0.ɵɵtext(5, "Level");
26
+ i0.ɵɵelementEnd();
27
+ i0.ɵɵelementStart(6, "th");
28
+ i0.ɵɵtext(7, "Message");
29
+ i0.ɵɵelementEnd()();
30
+ } }
31
+ function LogDisplayComponent_ng_template_8_Template(rf, ctx) { if (rf & 1) {
32
+ i0.ɵɵelementStart(0, "tr")(1, "td");
33
+ i0.ɵɵtext(2);
34
+ i0.ɵɵelementEnd();
35
+ i0.ɵɵelementStart(3, "td");
36
+ i0.ɵɵtext(4);
37
+ i0.ɵɵelementEnd();
38
+ i0.ɵɵelementStart(5, "td");
39
+ i0.ɵɵtext(6);
40
+ i0.ɵɵelementEnd()();
41
+ } if (rf & 2) {
42
+ const element_r1 = ctx.$implicit;
43
+ const ctx_r1 = i0.ɵɵnextContext();
44
+ i0.ɵɵadvance(2);
45
+ i0.ɵɵtextInterpolate(ctx_r1.formatTime(element_r1.timestamp));
46
+ i0.ɵɵadvance(2);
47
+ i0.ɵɵtextInterpolate(element_r1.lvl);
48
+ i0.ɵɵadvance(2);
49
+ i0.ɵɵtextInterpolate(ctx_r1.format(element_r1));
50
+ } }
51
+ export class LogDisplayComponent {
52
+ router;
53
+ buttonIcon = 'pi pi-arrow-up';
54
+ displayShowIcon = true;
55
+ visible = false;
56
+ snap = new BehaviorSubject(this.fetchMessagesCopy());
57
+ updatedEpoch;
58
+ constructor(router) {
59
+ this.router = router;
60
+ }
61
+ fetchMessagesCopy() {
62
+ const rval = Object.assign([], Logger.getRingBuffer().getMessages().reverse());
63
+ return rval;
64
+ }
65
+ refresh() {
66
+ this.snap.next(this.fetchMessagesCopy());
67
+ this.updatedEpoch = Date.now();
68
+ }
69
+ formatTime(tm) {
70
+ const rval = new Date(tm).toLocaleTimeString() + ' (' + DurationRatchet.thinFormatMsDuration(Date.now() - tm) + ' ago)';
71
+ return rval;
72
+ }
73
+ format(lm) {
74
+ const rval = Logger.getLogger().formatMessage(lm);
75
+ return rval;
76
+ }
77
+ open() {
78
+ this.refresh();
79
+ this.visible = true;
80
+ }
81
+ static ɵfac = function LogDisplayComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || LogDisplayComponent)(i0.ɵɵdirectiveInject(i1.Router)); };
82
+ static ɵcmp = i0.ɵɵdefineComponent({ type: LogDisplayComponent, selectors: [["ngx-acute-common-log-display"]], inputs: { buttonIcon: "buttonIcon", displayShowIcon: "displayShowIcon" }, decls: 10, vars: 7, consts: [["header", "Logs", "position", "full", 3, "visibleChange", "visible"], [2, "display", "flex", "flex-direction", "row"], ["label", "Refresh", 3, "click"], [3, "value"], ["pTemplate", "header"], ["pTemplate", "body"], [3, "click", "icon", "hidden"], ["pSortableColumn", "timestamp"], ["field", "timestamp"]], template: function LogDisplayComponent_Template(rf, ctx) { if (rf & 1) {
83
+ i0.ɵɵelementStart(0, "p-drawer", 0);
84
+ i0.ɵɵtwoWayListener("visibleChange", function LogDisplayComponent_Template_p_drawer_visibleChange_0_listener($event) { i0.ɵɵtwoWayBindingSet(ctx.visible, $event) || (ctx.visible = $event); return $event; });
85
+ i0.ɵɵelementStart(1, "div", 1)(2, "p-button", 2);
86
+ i0.ɵɵlistener("click", function LogDisplayComponent_Template_p_button_click_2_listener() { return ctx.refresh(); });
87
+ i0.ɵɵelementEnd();
88
+ i0.ɵɵelementStart(3, "div");
89
+ i0.ɵɵtext(4);
90
+ i0.ɵɵelementEnd()();
91
+ i0.ɵɵelementStart(5, "p-table", 3);
92
+ i0.ɵɵpipe(6, "async");
93
+ i0.ɵɵtemplate(7, LogDisplayComponent_ng_template_7_Template, 8, 0, "ng-template", 4)(8, LogDisplayComponent_ng_template_8_Template, 7, 3, "ng-template", 5);
94
+ i0.ɵɵelementEnd()();
95
+ i0.ɵɵelementStart(9, "p-button", 6);
96
+ i0.ɵɵlistener("click", function LogDisplayComponent_Template_p_button_click_9_listener() { return ctx.open(); });
97
+ i0.ɵɵelementEnd();
98
+ } if (rf & 2) {
99
+ i0.ɵɵtwoWayProperty("visible", ctx.visible);
100
+ i0.ɵɵadvance(4);
101
+ i0.ɵɵtextInterpolate1("Updated ", ctx.formatTime(ctx.updatedEpoch), "");
102
+ i0.ɵɵadvance();
103
+ i0.ɵɵproperty("value", i0.ɵɵpipeBind1(6, 5, ctx.snap));
104
+ i0.ɵɵadvance(4);
105
+ i0.ɵɵproperty("icon", ctx.buttonIcon)("hidden", !ctx.displayShowIcon);
106
+ } }, dependencies: [CardModule, i2.PrimeTemplate, ButtonModule, i3.Button, TooltipModule, DividerModule, InputTextModule, Drawer, TableModule, i4.Table, i4.SortableColumn, i4.SortIcon, AsyncPipe], encapsulation: 2 });
107
+ }
108
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(LogDisplayComponent, [{
109
+ type: Component,
110
+ args: [{ selector: 'ngx-acute-common-log-display', standalone: true, imports: [CardModule, ButtonModule, TooltipModule, DividerModule, InputTextModule, Drawer, TableModule, AsyncPipe], template: "<p-drawer [(visible)]=\"visible\" header=\"Logs\" position=\"full\">\n <div style=\"display:flex; flex-direction: row\">\n <p-button (click)=\"refresh()\" label=\"Refresh\"></p-button>\n <div>Updated {{formatTime(updatedEpoch)}}</div>\n </div>\n <p-table [value]=\"snap | async\">\n <ng-template pTemplate=\"header\">\n <tr>\n <th pSortableColumn=\"timestamp\">Timestamp <p-sortIcon field=\"timestamp\" /></th>\n <th>Level</th>\n <th>Message</th>\n </tr>\n </ng-template>\n <ng-template pTemplate=\"body\" let-element>\n <tr>\n <td>{{formatTime(element.timestamp)}}</td>\n <td>{{element.lvl}}</td>\n <td>{{format(element)}}</td>\n </tr>\n </ng-template>\n </p-table>\n</p-drawer>\n<p-button (click)=\"open()\" [icon]=\"buttonIcon\" [hidden]=\"!displayShowIcon\"/>\n" }]
111
+ }], () => [{ type: i1.Router }], { buttonIcon: [{
112
+ type: Input
113
+ }], displayShowIcon: [{
114
+ type: Input
115
+ }] }); })();
116
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(LogDisplayComponent, { className: "LogDisplayComponent", filePath: "components/log-display/log-display.component.ts", lineNumber: 24 }); })();
117
+ //# sourceMappingURL=log-display.component.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"log-display.component.js","sourceRoot":"","sources":["../../../src/components/log-display/log-display.component.ts","../../../src/components/log-display/log-display.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAC,SAAS,EAAE,KAAK,EAAC,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAC,MAAM,EAAC,MAAM,iBAAiB,CAAC;AACvC,OAAO,EAAC,UAAU,EAAC,MAAM,cAAc,CAAC;AACxC,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAC,eAAe,EAAC,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAC,MAAM,EAAC,MAAM,gBAAgB,CAAC;AACtC,OAAO,EAAC,WAAW,EAAC,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAC,eAAe,EAAC,MAAM,MAAM,CAAC;AACrC,OAAO,EAAC,SAAS,EAAC,MAAM,iBAAiB,CAAC;AAE1C,OAAO,EAAE,MAAM,EAAE,MAAM,uCAAuC,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;;;;;;;ICLxE,AADF,0BAAI,YAC8B;IAAA,0BAAW;IAAA,gCAAgC;IAAA,iBAAK;IAChF,0BAAI;IAAA,qBAAK;IAAA,iBAAK;IACd,0BAAI;IA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CAAC,CAAC;QAC1D,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,IAAI;QACT,IAAI,CAAC,OAAO,EAAE,CAAC;QACf,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACtB,CAAC;6GAnCU,mBAAmB;+CAAnB,mBAAmB;YCvBhC,mCAA8D;YAApD,8MAAqB;YAE3B,AADF,8BAA+C,kBACC;YAApC,kGAAS,aAAS,IAAC;YAAiB,iBAAW;YACzD,2BAAK;YAAA,YAAoC;YAC3C,AAD2C,iBAAM,EAC3C;YACN,kCAAgC;;YAQ9B,AAPA,oFAAgC,uEAOU;YAQ9C,AADE,iBAAU,EACD;YACX,mCAA4E;YAAlE,kGAAS,UAAM,IAAC;YAA1B,iBAA4E;;YAtBlE,2CAAqB;YAGtB,eAAoC;YAApC,uEAAoC;YAElC,cAAsB;YAAtB,sDAAsB;YAiBN,eAAmB;YAAC,AAApB,qCAAmB,gCAA4B;4BDF9D,UAAU,oBAAE,YAAY,aAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,4CAAE,SAAS;;iFAGtG,mBAAmB;cAR/B,SAAS;2BACE,8BAA8B,cAG5B,IAAI,WACP,CAAC,UAAU,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,EAAE,WAAW,EAAE,SAAS,CAAC;uCAIlG,UAAU;kBAAzB,KAAK;YACU,eAAe;kBAA9B,KAAK;;kFAFK,mBAAmB"}
package/lib/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './build/ngx-acute-common-info';
2
+ export * from './components/log-display/log-display.component';
2
3
  export * from './components/dialogs/alert/alert.component';
3
4
  export * from './components/dialogs/block-ui/block-ui.component';
4
5
  export * from './model/google-analytics-config';
package/lib/index.js CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './build/ngx-acute-common-info';
2
+ export * from './components/log-display/log-display.component';
2
3
  export * from './components/dialogs/alert/alert.component';
3
4
  export * from './components/dialogs/block-ui/block-ui.component';
4
5
  export * from './model/google-analytics-config';
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAE9C,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kDAAkD,CAAC;AAEjE,cAAc,iCAAiC,CAAC;AAEhD,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AAEpC,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,+BAA+B,CAAC;AAE9C,cAAc,gDAAgD,CAAC;AAE/D,cAAc,4CAA4C,CAAC;AAC3D,cAAc,kDAAkD,CAAC;AAEjE,cAAc,iCAAiC,CAAC;AAEhD,cAAc,yBAAyB,CAAC;AACxC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,uBAAuB,CAAC;AACtC,cAAc,gCAAgC,CAAC;AAC/C,cAAc,qBAAqB,CAAC;AACpC,cAAc,oBAAoB,CAAC;AACnC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qBAAqB,CAAC;AAEpC,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AACjD,cAAc,kCAAkC,CAAC;AACjD,cAAc,+BAA+B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitblit/ngx-acute-common",
3
- "version": "5.0.577-alpha",
3
+ "version": "5.0.579-alpha",
4
4
  "description": "Library for using angular",
5
5
  "module": "lib/index.js",
6
6
  "types": "lib/index.d.ts",
@@ -44,8 +44,8 @@
44
44
  "@angular/platform-browser": "19.1.3",
45
45
  "@angular/platform-browser-dynamic": "19.1.3",
46
46
  "@angular/router": "19.1.3",
47
- "@bitblit/ratchet-common": "5.0.577-alpha",
48
- "@bitblit/ratchet-graphql": "5.0.577-alpha",
47
+ "@bitblit/ratchet-common": "5.0.579-alpha",
48
+ "@bitblit/ratchet-graphql": "5.0.579-alpha",
49
49
  "primeflex": "3.3.1",
50
50
  "primeicons": "7.0.0",
51
51
  "primeng": "19.0.5",
@@ -62,8 +62,8 @@
62
62
  "@angular/platform-browser": "^19.1.3",
63
63
  "@angular/platform-browser-dynamic": "^19.1.3",
64
64
  "@angular/router": "^19.1.3",
65
- "@bitblit/ratchet-common": "5.0.577-alpha",
66
- "@bitblit/ratchet-graphql": "5.0.577-alpha",
65
+ "@bitblit/ratchet-common": "5.0.579-alpha",
66
+ "@bitblit/ratchet-graphql": "5.0.579-alpha",
67
67
  "primeflex": "3.3.1",
68
68
  "primeicons": "7.0.0",
69
69
  "primeng": "19.0.5",
@@ -72,6 +72,6 @@
72
72
  },
73
73
  "devDependencies": {
74
74
  "@angular/compiler-cli": "19.1.3",
75
- "@bitblit/ratchet-node-only": "5.0.577-alpha"
75
+ "@bitblit/ratchet-node-only": "5.0.579-alpha"
76
76
  }
77
77
  }