Browse Source

Minor fixes

pull/3346/head
Igor Kulikov 6 years ago
parent
commit
7a8683ef0d
  1. 7
      ui-ngx/angular.json
  2. 2
      ui-ngx/package.json
  3. 15
      ui-ngx/proxy.conf.js
  4. 10
      ui-ngx/src/app/modules/home/components/dashboard/dashboard.component.ts
  5. 8
      ui-ngx/src/app/modules/home/models/widget-component.models.ts

7
ui-ngx/angular.json

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

2
ui-ngx/package.json

@ -3,7 +3,7 @@
"version": "3.1.1",
"scripts": {
"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:prod": "ng build --prod --vendor-chunk",
"test": "ng test",

15
ui-ngx/proxy.conf.js

@ -13,25 +13,28 @@
* See the License for the specific language governing permissions and
* 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 = {
"/api": {
"target": "http://localhost:8080",
"target": forwardUrl,
"secure": false,
},
"/static/rulenode": {
"target": `http://${ruleNodeUiforwardHost}:${ruleNodeUiforwardPort}`,
"target": ruleNodeUiforwardUrl,
"secure": false,
},
"/static": {
"target": "http://localhost:8080",
"target": forwardUrl,
"secure": false,
},
"/api/ws": {
"target": "ws://localhost:8080",
"target": wsForwardUrl,
"ws": true,
"secure": false
},
};

10
ui-ngx/src/app/modules/home/components/dashboard/dashboard.component.ts

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

8
ui-ngx/src/app/modules/home/models/widget-component.models.ts

@ -247,9 +247,9 @@ export class WidgetContext {
}
showInfoToast(message: string,
verticalPosition: NotificationVerticalPosition = 'bottom',
horizontalPosition: NotificationHorizontalPosition = 'left',
target?: string) {
verticalPosition: NotificationVerticalPosition = 'bottom',
horizontalPosition: NotificationHorizontalPosition = 'left',
target?: string) {
this.showToast('info', message, undefined, verticalPosition, horizontalPosition, target);
}
@ -325,7 +325,7 @@ export class WidgetContext {
pageLink(pageSize: number, page: number = 0, textSearch: string = null, sortOrder: SortOrder = null): PageLink {
return new PageLink(pageSize, page, textSearch, sortOrder);
};
}
}
export interface IDynamicWidgetComponent {

Loading…
Cancel
Save