Browse Source

Improved loading speed of code editors and fixed shifted or failing dashboard image screenshots (#16813)

* UI: Load Ace modes, snippets and themes on demand

The first editor used to load all 14 modes, 11 snippet files and 2 themes
up front (901 KB, 29 requests). Ace now loads only what an editor uses
through config.setModuleLoader; a JSON editor loads 534 KB in 5 requests.

- Once a module is defined, its loader is removed, so Ace resolves it
  synchronously again, as before.
- getAce() accepts modules to preload for editors that read the session
  mode synchronously after setMode; js-func preloads javascript and tbel.
- mode-c_cpp and snippets/protobuf are no longer loaded: no editor uses
  the C/C++ mode, mode-protobuf bundles its own copy, and the protobuf
  mode takes its snippets from snippets/c_cpp.

* UI: Load the SystemJS modules map lazily and cut eager imports of home code

- The SystemJS modules map, which imports most of the application, now
  loads only when a widget or rule node loads an extension module. Pages
  and dashboards no longer carry it.
- WidgetService, DashboardUtilsService and HomeService no longer import
  the widget config component, the dashboard component models and the
  router tabs component, which kept them in the login bundle:
  the basic config base class is passed to
  registerBasicWidgetConfigComponents, the gridster limits moved to
  shared dashboard models (re-exported from the old place), and router
  tabs are detected by a flag instead of instanceof.
- BlobEntitiesComponent reads the header actions panel from the widget
  context instead of injecting WidgetComponent. That import closed the
  only NgModule import cycle (SharedHomeComponentsModule ->
  WidgetComponentsModule), which crashed startup with "Cannot read
  properties of undefined (reading 'ngModule')" when the module init
  order changed.

* UI: Take dashboard screenshots with modern-screenshot, loaded on demand

The dashboard image dialog used html2canvas, which is no longer
maintained. It shifted and cropped the captured area and failed on
dashboards that use the CSS color() function (charts, gauges, maps).

- modern-screenshot (MIT, no dependencies, 10 KB gzip instead of 44 KB)
  renders the dashboard through the browser itself, so the thumbnail
  matches the page. It loads only when a screenshot is taken.
- The whole dashboard is captured and the selected area is cut out of
  the canvas; the development notice is still stamped before the image
  is serialised.
- Elements marked with data-html2canvas-ignore are still left out, and
  videos with no source are skipped, since the capture would wait for
  them forever.

* UI: Import entity type models directly in entity chips instead of the shared public API barrel

The barrel re-exports report-component.models, which imports the time series
chart models and with them echarts and zrender. Any eager import path to
entity chips would pull ~1.7 MB of chart code into the startup bundle, as
happened in PE through the AI audit log dialog.
pull/16847/head
Vladyslav Prykhodko 1 week ago
committed by GitHub
parent
commit
20528f3e42
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      application/src/test/java/org/thingsboard/server/controller/DevelopmentNoticeCaptureStampTest.java
  2. 2
      ui-ngx/package.json
  3. 9
      ui-ngx/src/app/core/http/widget.service.ts
  4. 2
      ui-ngx/src/app/core/services/dashboard-utils.service.ts
  5. 7
      ui-ngx/src/app/core/services/home.service.ts
  6. 18
      ui-ngx/src/app/modules/common/lazy-modules-map.ts
  7. 2
      ui-ngx/src/app/modules/home/components/blob-entity/blob-entities.component.html
  8. 5
      ui-ngx/src/app/modules/home/components/blob-entity/blob-entities.component.ts
  9. 42
      ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-image-dialog.component.ts
  10. 2
      ui-ngx/src/app/modules/home/components/entity/entity-chips.component.ts
  11. 4
      ui-ngx/src/app/modules/home/components/home-components.module.ts
  12. 2
      ui-ngx/src/app/modules/home/components/router-tabs.component.ts
  13. 3
      ui-ngx/src/app/modules/home/components/widget/config/basic/basic-widget-config.module.ts
  14. 3
      ui-ngx/src/app/modules/home/models/dashboard-component.models.ts
  15. 2
      ui-ngx/src/app/shared/components/js-func.component.ts
  16. 121
      ui-ngx/src/app/shared/models/ace/ace.models.ts
  17. 3
      ui-ngx/src/app/shared/models/dashboard.models.ts
  18. 39
      ui-ngx/yarn.lock

2
application/src/test/java/org/thingsboard/server/controller/DevelopmentNoticeCaptureStampTest.java

@ -62,7 +62,7 @@ public class DevelopmentNoticeCaptureStampTest {
.as("no subscribing call to %s in the capture path to order against", STAMP_METHOD)
.isTrue();
int captured = capture.indexOf("html2canvas(");
int captured = capture.indexOf("domToCanvas(");
int serialised = capture.indexOf("toDataURL");
assertThat(captured).as("no capture call found to order against").isNotNegative();
assertThat(serialised).as("no serialisation call found to order against").isNotNegative();

2
ui-ngx/package.json

@ -63,7 +63,6 @@
"flot": "https://github.com/thingsboard/flot.git#0.9-work",
"flot.curvedlines": "https://github.com/MichaelZinsmaier/CurvedLines.git#master",
"font-awesome": "^4.7.0",
"html2canvas": "^1.4.1",
"hugerte": "~1.0.14",
"jquery": "^3.7.1",
"jquery-sparkline": "^2.4.0",
@ -82,6 +81,7 @@
"libphonenumber-js": "^1.13.15",
"maplibre-gl": "6.15.0",
"marked": "~16.4.2",
"modern-screenshot": "^4.7.0",
"moment": "^2.31.0",
"moment-timezone": "^0.6.5",
"ngx-captcha": "^14.0.0",

9
ui-ngx/src/app/core/http/widget.service.ts

@ -26,10 +26,7 @@ import { filter, map, mergeMap, tap } from 'rxjs/operators';
import { WidgetTypeId } from '@shared/models/id/widget-type-id';
import { NULL_UUID } from '@shared/models/id/has-uuid';
import { ActivationEnd, Router } from '@angular/router';
import {
BasicWidgetConfigComponent,
IBasicWidgetConfigComponent
} from '@home/components/widget/config/widget-config.component.models';
import type { BasicWidgetConfigComponent, IBasicWidgetConfigComponent } from '@home/components/widget/config/widget-config.component.models';
import { ResourcesService } from '@core/services/resources.service';
import { UserPermissionsService } from '@core/http/user-permissions.service';
import { Operation, Resource } from '@shared/models/security.models';
@ -301,8 +298,8 @@ export class WidgetService {
this.widgetsInfoInMemoryCache.set(widgetInfo.fullFqn, widgetInfo);
}
public registerBasicWidgetConfigComponents(module: any) {
Object.assign(this.basicWidgetSettingsComponentsMap, this.resourcesService.extractComponentsFromModule<IBasicWidgetConfigComponent>(module, BasicWidgetConfigComponent));
public registerBasicWidgetConfigComponents(module: any, baseType: typeof BasicWidgetConfigComponent) {
Object.assign(this.basicWidgetSettingsComponentsMap, this.resourcesService.extractComponentsFromModule<IBasicWidgetConfigComponent>(module, baseType));
}
public getBasicWidgetSettingsComponentBySelector(selector: string): Type<IBasicWidgetConfigComponent> {

2
ui-ngx/src/app/core/services/dashboard-utils.service.ts

@ -65,7 +65,7 @@ import { BackgroundType, colorBackground, isBackgroundSettings } from '@shared/m
import { MediaBreakpoints } from '@shared/models/constants';
import { TranslateService } from '@ngx-translate/core';
import { DashboardPageLayout } from '@home/components/dashboard-page/dashboard-page.models';
import { maxGridsterCol, maxGridsterRow } from '@home/models/dashboard-component.models';
import { maxGridsterCol, maxGridsterRow } from '@shared/models/dashboard.models';
import {
findWidgetModelDefinition,
widgetHasTimewindow,

7
ui-ngx/src/app/core/services/home.service.ts

@ -1,10 +1,11 @@
// SPDX-FileCopyrightText: Copyright The ThingsBoard Authors
// SPDX-License-Identifier: Apache-2.0
// SPDX-FileCopyrightText: Modifications Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: Apache-2.0 AND BUSL-1.1
import { EventEmitter, Injectable } from '@angular/core';
import { ActiveComponentService } from '@core/services/active-component.service';
import { BehaviorSubject, Observable, shareReplay, Subject } from 'rxjs';
import { distinctUntilChanged } from 'rxjs/operators';
import { RouterTabsComponent } from '@home/components/router-tabs.component';
import type { RouterTabsComponent } from '@home/components/router-tabs.component';
import { isDefinedAndNotNull } from '@core/utils';
import { PageComponent } from '@shared/components/page.component';
@ -43,7 +44,7 @@ export class HomeService {
private activeComponentChanged(activeComponent: any) {
this.hideMainToolbarSubject.next(false);
let hideLoadingBar = false;
if (activeComponent && activeComponent instanceof RouterTabsComponent
if (activeComponent && (activeComponent as RouterTabsComponent).isRouterTabsComponent
&& isDefinedAndNotNull(activeComponent.activatedRoute?.snapshot?.data?.showMainLoadingBar)) {
hideLoadingBar = !activeComponent.activatedRoute.snapshot.data.showMainLoadingBar;
} else if (activeComponent && activeComponent instanceof PageComponent

18
ui-ngx/src/app/modules/common/lazy-modules-map.ts

@ -0,0 +1,18 @@
// SPDX-FileCopyrightText: Copyright ThingsBoard, Inc.
// SPDX-License-Identifier: BUSL-1.1
import { defer, map, Observable, shareReplay, switchMap } from 'rxjs';
import { IModulesMap } from '@modules/common/modules-map.models';
class LazyModulesMap implements IModulesMap {
private modulesMap$: Observable<IModulesMap> = defer(() => import('@modules/common/modules-map')).pipe(
switchMap(module => module.modulesMap.init().pipe(map(() => module.modulesMap))),
shareReplay(1)
);
init(): Observable<any> {
return this.modulesMap$;
}
}
export const lazyModulesMap = new LazyModulesMap();

2
ui-ngx/src/app/modules/home/components/blob-entity/blob-entities.component.html

@ -20,7 +20,7 @@
asButton historyOnly></tb-timewindow>
<span class="flex-1"></span>
@if (widgetMode) {
<ng-container *ngTemplateOutlet="widgetComponent.widgetHeaderActionsPanel"></ng-container>
<ng-container *ngTemplateOutlet="ctx.widgetHeaderActionsPanel"></ng-container>
} @else {
<section>
<button [disabled]="isLoading$ | async"

5
ui-ngx/src/app/modules/home/components/blob-entity/blob-entities.component.ts

@ -8,7 +8,6 @@ import {
Input,
NgZone,
OnInit,
Optional,
ViewChild,
ViewEncapsulation
} from '@angular/core';
@ -39,7 +38,6 @@ import { UtilsService } from '@core/services/utils.service';
import { hidePageSizePixelValue } from '@shared/models/constants';
import { FormBuilder } from '@angular/forms';
import { isValidPageStepCount, isValidPageStepIncrement } from '@home/components/widget/lib/table-widget.models';
import { WidgetComponent } from "@home/components/widget/widget.component";
@Component({
selector: 'tb-blob-entities',
@ -106,8 +104,7 @@ export class BlobEntitiesComponent extends PageComponent implements OnInit, Afte
private dialogService: DialogService,
private cd: ChangeDetectorRef,
private fb: FormBuilder,
private zone: NgZone,
@Optional() public widgetComponent: WidgetComponent) {
private zone: NgZone) {
super(store);
}

42
ui-ngx/src/app/modules/home/components/dashboard-page/dashboard-image-dialog.component.ts

@ -11,7 +11,6 @@ import { DialogComponent } from '@app/shared/components/dialog.component';
import { DashboardId } from '@shared/models/id/dashboard-id';
import { DashboardService } from '@core/http/dashboard.service';
import { DomSanitizer, SafeUrl } from '@angular/platform-browser';
import html2canvas from 'html2canvas';
import { map, share, switchMap } from 'rxjs/operators';
import { BehaviorSubject, from } from 'rxjs';
import { isNumber } from '@core/utils';
@ -114,22 +113,18 @@ export class DashboardImageDialogComponent extends DialogComponent<DashboardImag
const right = rightVal * rect.width;
const bottom = bottomVal * rect.height;
const x = rect.left + left;
const y = rect.top + top;
let width = right - left;
let height = bottom - top;
width = Math.max(1, width);
height = Math.max(1, height);
from(html2canvas(this.dashboardElement, {
logging: false,
useCORS: true,
foreignObjectRendering: false,
scale: 512 / width,
x,
y,
width,
height
})).pipe(
const scale = 512 / width;
from(import('modern-screenshot')).pipe(
switchMap(({domToCanvas}) => domToCanvas(this.dashboardElement, {
scale,
filter: (node) => this.includeInScreenshot(node),
fetch: {requestInit: {mode: 'cors'}}
})),
map(canvas => this.cropCanvas(canvas, left * scale, top * scale, width * scale, height * scale)),
// The capture is rooted at the dashboard element, so the body-level notice was never inside it - and this
// image is stored and shown to other users. Marked after the capture, where no stylesheet reaches it.
// Does not cover an image set from the gallery picker instead; that is a question for whoever owns the field.
@ -152,6 +147,27 @@ export class DashboardImageDialogComponent extends DialogComponent<DashboardImag
});
}
private includeInScreenshot(node: Node): boolean {
// A video with no source never loads, and the capture would wait for it forever.
if (node instanceof HTMLVideoElement && !node.srcObject && !node.currentSrc) {
return false;
}
return !(node instanceof Element && node.hasAttribute('data-html2canvas-ignore'));
}
private cropCanvas(source: HTMLCanvasElement, x: number, y: number, width: number, height: number): HTMLCanvasElement {
const targetWidth = Math.max(1, Math.round(width));
const targetHeight = Math.max(1, Math.round(height));
if (Math.round(x) === 0 && Math.round(y) === 0 && targetWidth === source.width && targetHeight === source.height) {
return source;
}
const target = document.createElement('canvas');
target.width = targetWidth;
target.height = targetHeight;
target.getContext('2d').drawImage(source, x, y, width, height, 0, 0, targetWidth, targetHeight);
return target;
}
cancel(): void {
this.dialogRef.close(null);
}

2
ui-ngx/src/app/modules/home/components/entity/entity-chips.component.ts

@ -4,7 +4,7 @@
import { Component, Input, OnChanges, SimpleChanges } from '@angular/core';
import { BaseData, GroupEntityInfo } from '@shared/models/base-data';
import { EntityId } from '@shared/models/id/entity-id';
import { baseDetailsPageByEntityType, EntityType, groupUrlPrefixByEntityType } from '@app/shared/public-api';
import { baseDetailsPageByEntityType, EntityType, groupUrlPrefixByEntityType } from '@shared/models/entity-type.models';
import { UserPermissionsService } from '@core/http/user-permissions.service';
import { isEqual, isNotEmptyStr, isObject } from '@core/utils';

4
ui-ngx/src/app/modules/home/components/home-components.module.ts

@ -220,7 +220,7 @@ import { ConverterTestDialogComponent } from '@home/components/converter/convert
import { UpdatedPayloadPanelComponent } from '@home/components/converter/updated-payload-panel.component';
import { IntegrationComponentModule } from '@home/components/integration/integration-component.module';
import { MODULES_MAP } from '@shared/models/constants';
import { modulesMap } from '@modules/common/modules-map';
import { lazyModulesMap } from '@modules/common/lazy-modules-map';
import { AlarmAssigneePanelComponent } from '@home/components/alarm/alarm-assignee-panel.component';
import { RouterTabsComponent } from '@home/components/router-tabs.component';
import { AllEntitiesTableConfigService } from '@home/components/entity/all-entities-table-config.service';
@ -665,7 +665,7 @@ import { RequestPePackComponent } from '@home/components/pe-pack/request-pe-pack
{provide: COMPLEX_FILTER_PREDICATE_DIALOG_COMPONENT_TOKEN, useValue: ComplexFilterPredicateDialogComponent},
{provide: DASHBOARD_PAGE_COMPONENT_TOKEN, useValue: DashboardPageComponent},
{provide: HOME_COMPONENTS_MODULE_TOKEN, useValue: HomeComponentsModule },
{provide: MODULES_MAP, useValue: modulesMap}
{provide: MODULES_MAP, useValue: lazyModulesMap}
]
})
export class HomeComponentsModule {

2
ui-ngx/src/app/modules/home/components/router-tabs.component.ts

@ -22,6 +22,8 @@ import { getCurrentAuthUser } from '@core/auth/auth.selectors';
})
export class RouterTabsComponent extends PageComponent implements OnInit {
readonly isRouterTabsComponent = true;
@ViewChild('replaceComponentAnchor', {static: true}) replaceComponentAnchor: TbAnchorComponent;
@ViewChild('tabsHeaderComponent', {static: true}) tabsHeaderComponentAnchor: TbAnchorComponent;

3
ui-ngx/src/app/modules/home/components/widget/config/basic/basic-widget-config.module.ts

@ -5,6 +5,7 @@ import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';
import { SharedModule } from '@shared/shared.module';
import { WidgetService } from '@core/http/widget.service';
import { BasicWidgetConfigComponent } from '@home/components/widget/config/widget-config.component.models';
import { WidgetConfigComponentsModule } from '@home/components/widget/config/widget-config-components.module';
import {
SimpleCardBasicConfigComponent
@ -246,6 +247,6 @@ import {
})
export class BasicWidgetConfigModule {
constructor(private widgetService: WidgetService) {
this.widgetService.registerBasicWidgetConfigComponents(this.constructor)
this.widgetService.registerBasicWidgetConfigComponents(this.constructor, BasicWidgetConfigComponent)
}
}

3
ui-ngx/src/app/modules/home/models/dashboard-component.models.ts

@ -96,8 +96,7 @@ interface DashboardWidgetUpdateRecord {
operation: DashboardWidgetUpdateOperation;
}
export const maxGridsterCol = 3000;
export const maxGridsterRow = 3000;
export { maxGridsterCol, maxGridsterRow } from '@shared/models/dashboard.models';
export class DashboardWidgets implements Iterable<DashboardWidget> {

2
ui-ngx/src/app/shared/components/js-func.component.ts

@ -194,7 +194,7 @@ export class JsFuncComponent implements OnInit, OnChanges, OnDestroy, ControlVal
};
editorOptions = {...editorOptions, ...advancedOptions};
getAce().subscribe(
getAce('ace/mode/javascript', 'ace/mode/tbel').subscribe(
(ace) => {
this.jsEditor = ace.edit(editorElement, editorOptions);
this.jsEditor.session.setUseWrapMode(true);

121
ui-ngx/src/app/shared/models/ace/ace.models.ts

@ -14,40 +14,62 @@ let aceModule: any;
let aceDiffModule: any;
let cssLanguageProvider: LanguageProvider;
function loadAceDependencies(): Observable<any> {
const aceModuleLoaders: Record<string, () => Promise<unknown>> = {
'ace/mode/java': () => import('ace-builds/src-noconflict/mode-java'),
'ace/mode/css': () => import('ace-builds/src-noconflict/mode-css'),
'ace/mode/json': () => import('ace-builds/src-noconflict/mode-json'),
'ace/mode/javascript': () => import('ace-builds/src-noconflict/mode-javascript'),
'ace/mode/text': () => import('ace-builds/src-noconflict/mode-text'),
'ace/mode/markdown': () => import('ace-builds/src-noconflict/mode-markdown'),
'ace/mode/html': () => import('ace-builds/src-noconflict/mode-html'),
'ace/mode/xml': () => import('ace-builds/src-noconflict/mode-xml'),
'ace/mode/svg': () => import('ace-builds/src-noconflict/mode-svg'),
'ace/mode/protobuf': () => import('ace-builds/src-noconflict/mode-protobuf'),
'ace/mode/yaml': () => import('ace-builds/src-noconflict/mode-yaml'),
'ace/mode/tbel': () => import('./tbel/mode-tbel'),
'ace/snippets/java': () => import('ace-builds/src-noconflict/snippets/java'),
'ace/snippets/css': () => import('ace-builds/src-noconflict/snippets/css'),
'ace/snippets/json': () => import('ace-builds/src-noconflict/snippets/json'),
'ace/snippets/javascript': () => import('ace-builds/src-noconflict/snippets/javascript'),
'ace/snippets/text': () => import('ace-builds/src-noconflict/snippets/text'),
'ace/snippets/markdown': () => import('ace-builds/src-noconflict/snippets/markdown'),
'ace/snippets/html': () => import('ace-builds/src-noconflict/snippets/html'),
'ace/snippets/xml': () => import('ace-builds/src-noconflict/snippets/xml'),
'ace/snippets/svg': () => import('ace-builds/src-noconflict/snippets/svg'),
// Snippets of the protobuf mode, which bundles the C/C++ mode
'ace/snippets/c_cpp': () => import('ace-builds/src-noconflict/snippets/c_cpp'),
'ace/theme/github': () => import('ace-builds/src-noconflict/theme-github')
};
const loadedAceModules = new Map<string, Promise<unknown>>();
function loadAceModule(ace: any, moduleName: string): Promise<unknown> {
let loaded = loadedAceModules.get(moduleName);
if (!loaded) {
loaded = aceModuleLoaders[moduleName]().then((module) => {
// Ace resolves a module that has a loader asynchronously on every use; dropping the loader once the module
// is defined lets Ace resolve it synchronously.
delete ace.config.dynamicModules[moduleName];
return module;
});
loaded.catch(() => loadedAceModules.delete(moduleName));
loadedAceModules.set(moduleName, loaded);
}
return loaded;
}
function loadAceDependencies(ace: any): Observable<any> {
if (aceDependenciesLoaded) {
return of(null);
} else {
const aceObservables: Observable<any>[] = [];
aceObservables.push(from(import('ace-builds/src-noconflict/ext-language_tools')));
aceObservables.push(from(import('ace-builds/src-noconflict/ext-searchbox')));
aceObservables.push(from(import('ace-builds/src-noconflict/mode-java')));
aceObservables.push(from(import('ace-builds/src-noconflict/mode-css')));
aceObservables.push(from(import('ace-builds/src-noconflict/mode-json')));
aceObservables.push(from(import('ace-builds/src-noconflict/mode-javascript')));
aceObservables.push(from(import('ace-builds/src-noconflict/mode-text')));
aceObservables.push(from(import('ace-builds/src-noconflict/mode-markdown')));
aceObservables.push(from(import('ace-builds/src-noconflict/mode-html')));
aceObservables.push(from(import('ace-builds/src-noconflict/mode-xml')));
aceObservables.push(from(import('ace-builds/src-noconflict/mode-svg')));
aceObservables.push(from(import('ace-builds/src-noconflict/mode-c_cpp')));
aceObservables.push(from(import('ace-builds/src-noconflict/mode-protobuf')));
aceObservables.push(from(import('ace-builds/src-noconflict/mode-yaml')));
aceObservables.push(from(import('ace-builds/src-noconflict/snippets/java')));
aceObservables.push(from(import('ace-builds/src-noconflict/snippets/css')));
aceObservables.push(from(import('ace-builds/src-noconflict/snippets/json')));
aceObservables.push(from(import('ace-builds/src-noconflict/snippets/javascript')));
aceObservables.push(from(import('./tbel/mode-tbel')));
aceObservables.push(from(import('ace-builds/src-noconflict/snippets/text')));
aceObservables.push(from(import('ace-builds/src-noconflict/snippets/markdown')));
aceObservables.push(from(import('ace-builds/src-noconflict/snippets/html')));
aceObservables.push(from(import('ace-builds/src-noconflict/snippets/xml')));
aceObservables.push(from(import('ace-builds/src-noconflict/snippets/svg')));
aceObservables.push(from(import('ace-builds/src-noconflict/snippets/c_cpp')));
aceObservables.push(from(import('ace-builds/src-noconflict/snippets/protobuf')));
aceObservables.push(from(import('ace-builds/src-noconflict/theme-textmate')));
aceObservables.push(from(import('ace-builds/src-noconflict/theme-github')));
return forkJoin(aceObservables).pipe(
for (const moduleName of Object.keys(aceModuleLoaders)) {
ace.config.setModuleLoader(moduleName, () => loadAceModule(ace, moduleName));
}
// Extensions register editor options (autocompletion, search box), so they must be loaded before an editor is created
return forkJoin([
import('ace-builds/src-noconflict/ext-language_tools'),
import('ace-builds/src-noconflict/ext-searchbox')
]).pipe(
tap(() => {
aceDependenciesLoaded = true;
})
@ -55,21 +77,28 @@ function loadAceDependencies(): Observable<any> {
}
}
export function getAce(): Observable<any> {
if (aceModule) {
return of(aceModule);
} else {
return from(import('ace-builds/src-noconflict/ace')).pipe(
mergeMap((module) => {
return loadAceDependencies().pipe(
map(() => unwrapModule(module))
);
}),
tap((module) => {
aceModule = module;
})
);
}
// Modes, snippets and themes load on first use, so the first `setMode` of a mode completes asynchronously.
// Pass the modes a caller reads synchronously right after `setMode` (e.g. `session.$mode`) as `preloadModules`.
export function getAce(...preloadModules: string[]): Observable<any> {
const ace$ = aceModule ? of(aceModule) : from(import('ace-builds/src-noconflict/ace')).pipe(
mergeMap((module) => {
const ace = unwrapModule(module);
return loadAceDependencies(ace).pipe(
map(() => ace)
);
}),
tap((module) => {
aceModule = module;
})
);
if (!preloadModules.length) {
return ace$;
}
return ace$.pipe(
mergeMap((ace) => forkJoin(preloadModules.map(moduleName => loadAceModule(ace, moduleName))).pipe(
map(() => ace)
))
);
}
export function getAceDiff(): Observable<any> {

3
ui-ngx/src/app/shared/models/dashboard.models.ts

@ -255,3 +255,6 @@ export const isCurrentPublicDashboardCustomer = (dashboard: DashboardInfo, custo
return false;
}
};
export const maxGridsterCol = 3000;
export const maxGridsterRow = 3000;

39
ui-ngx/yarn.lock

@ -3091,11 +3091,6 @@ bare-url@^2.2.2:
dependencies:
bare-path "^3.0.0"
base64-arraybuffer@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz#1c37589a7c4b0746e34bd1feb951da2df01c1bdc"
integrity sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==
base64-js@^1.3.1:
version "1.5.1"
resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
@ -3604,13 +3599,6 @@ cross-spawn@^7.0.0, cross-spawn@^7.0.3, cross-spawn@^7.0.5, cross-spawn@^7.0.6:
shebang-command "^2.0.0"
which "^2.0.1"
css-line-break@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/css-line-break/-/css-line-break-2.1.0.tgz#bfef660dfa6f5397ea54116bb3cb4873edbc4fa0"
integrity sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==
dependencies:
utrie "^1.0.2"
css-select@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/css-select/-/css-select-6.0.0.tgz#7e63f09881ad118084091048ed543786dad96644"
@ -5192,14 +5180,6 @@ html-entities@^2.6.0:
resolved "https://registry.yarnpkg.com/html-entities/-/html-entities-2.6.0.tgz#7c64f1ea3b36818ccae3d3fb48b6974208e984f8"
integrity sha512-kig+rMn/QOVRvr7c86gQ8lWXq+Hkv6CbAH1hLu+RG338StTpE8Z0b44SDVaqVu7HGKf27frdmUYEs9hTUX/cLQ==
html2canvas@^1.4.1:
version "1.4.1"
resolved "https://registry.yarnpkg.com/html2canvas/-/html2canvas-1.4.1.tgz#7cef1888311b5011d507794a066041b14669a543"
integrity sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==
dependencies:
css-line-break "^2.1.0"
text-segmentation "^1.0.3"
htmlparser2@^10.0.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/htmlparser2/-/htmlparser2-10.1.0.tgz#fe3f2e12c73b6e462d4e10395db9c1119e4d6ae4"
@ -6345,6 +6325,11 @@ mlly@^1.7.4, mlly@^1.8.0:
pkg-types "^1.3.1"
ufo "^1.6.3"
modern-screenshot@^4.7.0:
version "4.7.0"
resolved "https://registry.yarnpkg.com/modern-screenshot/-/modern-screenshot-4.7.0.tgz#22f6831de41df5717235a119bcd0cc309dacf7a9"
integrity sha512-9YxN+ddPSMMlhylOv25VHzXrl9u67QRxoh7+SEewGtgUw7t6hHTrjptSDJUSne9oG4Xk/h2cwG15nIt4Hc9ujg==
moment-timezone@^0.6.5:
version "0.6.5"
resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.6.5.tgz#a8153ebe88199bd76f2d2ce329eb1d568eafbdee"
@ -8226,13 +8211,6 @@ text-decoder@^1.1.0:
dependencies:
b4a "^1.6.4"
text-segmentation@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/text-segmentation/-/text-segmentation-1.0.3.tgz#52a388159efffe746b24a63ba311b6ac9f2d7943"
integrity sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==
dependencies:
utrie "^1.0.2"
thenify-all@^1.0.0:
version "1.6.0"
resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726"
@ -8566,13 +8544,6 @@ util-deprecate@^1.0.1, util-deprecate@^1.0.2, util-deprecate@~1.0.1:
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
integrity sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==
utrie@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/utrie/-/utrie-1.0.2.tgz#d42fe44de9bc0119c25de7f564a6ed1b2c87a645"
integrity sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==
dependencies:
base64-arraybuffer "^1.0.2"
"uuid@^11.1.0 || ^12 || ^13 || ^14.0.0":
version "14.0.3"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-14.0.3.tgz#48c9b0dcf5a42d983c23162399eeb9af8b2cc617"

Loading…
Cancel
Save