Minor fixes

This commit is contained in:
Igor Kulikov 2020-08-14 13:08:17 +03:00
parent 985510b51d
commit 7a8683ef0d
5 changed files with 25 additions and 17 deletions

View File

@ -98,7 +98,12 @@
"react-ace", "react-ace",
"schema-inspector", "schema-inspector",
"@flowjs/flow.js", "@flowjs/flow.js",
"mousetrap" "mousetrap",
"prop-types",
"react-is",
"hoist-non-react-statics",
"classnames",
"raf"
] ]
}, },
"configurations": { "configurations": {

View File

@ -3,7 +3,7 @@
"version": "3.1.1", "version": "3.1.1",
"scripts": { "scripts": {
"ng": "ng", "ng": "ng",
"start": "ng serve --host 0.0.0.0 --open", "start": "node --max_old_space_size=8048 ./node_modules/@angular/cli/bin/ng serve --host 0.0.0.0 --open",
"build": "ng build", "build": "ng build",
"build:prod": "ng build --prod --vendor-chunk", "build:prod": "ng build --prod --vendor-chunk",
"test": "ng test", "test": "ng test",

View File

@ -13,25 +13,28 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
const ruleNodeUiforwardHost = "localhost";
const ruleNodeUiforwardPort = 8080; const forwardUrl = "https://demo.thingsboard.io";
const wsForwardUrl = "wss://demo.thingsboard.io";
const ruleNodeUiforwardUrl = forwardUrl;
const PROXY_CONFIG = { const PROXY_CONFIG = {
"/api": { "/api": {
"target": "http://localhost:8080", "target": forwardUrl,
"secure": false, "secure": false,
}, },
"/static/rulenode": { "/static/rulenode": {
"target": `http://${ruleNodeUiforwardHost}:${ruleNodeUiforwardPort}`, "target": ruleNodeUiforwardUrl,
"secure": false, "secure": false,
}, },
"/static": { "/static": {
"target": "http://localhost:8080", "target": forwardUrl,
"secure": false, "secure": false,
}, },
"/api/ws": { "/api/ws": {
"target": "ws://localhost:8080", "target": wsForwardUrl,
"ws": true, "ws": true,
"secure": false
}, },
}; };

View File

@ -35,7 +35,7 @@ import { AuthUser } from '@shared/models/user.model';
import { getCurrentAuthUser } from '@core/auth/auth.selectors'; import { getCurrentAuthUser } from '@core/auth/auth.selectors';
import { Timewindow, toHistoryTimewindow } from '@shared/models/time/time.models'; import { Timewindow, toHistoryTimewindow } from '@shared/models/time/time.models';
import { TimeService } from '@core/services/time.service'; import { TimeService } from '@core/services/time.service';
import { GridsterComponent, GridsterConfig } from 'angular-gridster2'; import { GridsterComponent, GridsterConfig, GridType } from 'angular-gridster2';
import { import {
DashboardCallbacks, DashboardCallbacks,
DashboardWidget, DashboardWidget,
@ -183,7 +183,7 @@ export class DashboardComponent extends PageComponent implements IDashboardCompo
this.dashboardTimewindow = this.timeService.defaultTimewindow(); this.dashboardTimewindow = this.timeService.defaultTimewindow();
} }
this.gridsterOpts = { this.gridsterOpts = {
gridType: 'scrollVertical', gridType: GridType.ScrollVertical,
keepFixedHeightInMobile: true, keepFixedHeightInMobile: true,
disableWarnings: false, disableWarnings: false,
disableAutoPositionOnConflict: false, disableAutoPositionOnConflict: false,
@ -288,7 +288,7 @@ export class DashboardComponent extends PageComponent implements IDashboardCompo
ngAfterViewInit(): void { ngAfterViewInit(): void {
this.gridsterResize$ = new ResizeObserver(() => { this.gridsterResize$ = new ResizeObserver(() => {
this.onGridsterParentResize() this.onGridsterParentResize();
}); });
this.gridsterResize$.observe(this.gridster.el); this.gridsterResize$.observe(this.gridster.el);
} }
@ -473,9 +473,9 @@ export class DashboardComponent extends PageComponent implements IDashboardCompo
this.isMobileSize = this.checkIsMobileSize(); this.isMobileSize = this.checkIsMobileSize();
const autofillHeight = this.isAutofillHeight(); const autofillHeight = this.isAutofillHeight();
if (autofillHeight) { if (autofillHeight) {
this.gridsterOpts.gridType = this.isMobileSize ? 'fixed' : 'fit'; this.gridsterOpts.gridType = this.isMobileSize ? GridType.Fixed : GridType.Fit;
} else { } else {
this.gridsterOpts.gridType = this.isMobileSize ? 'fixed' : 'scrollVertical'; this.gridsterOpts.gridType = this.isMobileSize ? GridType.Fixed : GridType.ScrollVertical;
} }
const mobileBreakPoint = this.isMobileSize ? 20000 : 0; const mobileBreakPoint = this.isMobileSize ? 20000 : 0;
this.gridsterOpts.mobileBreakpoint = mobileBreakPoint; this.gridsterOpts.mobileBreakpoint = mobileBreakPoint;

View File

@ -325,7 +325,7 @@ export class WidgetContext {
pageLink(pageSize: number, page: number = 0, textSearch: string = null, sortOrder: SortOrder = null): PageLink { pageLink(pageSize: number, page: number = 0, textSearch: string = null, sortOrder: SortOrder = null): PageLink {
return new PageLink(pageSize, page, textSearch, sortOrder); return new PageLink(pageSize, page, textSearch, sortOrder);
}; }
} }
export interface IDynamicWidgetComponent { export interface IDynamicWidgetComponent {