Browse Source

UI: Add support of inline images for exported entities.

pull/9542/head
Igor Kulikov 3 years ago
parent
commit
61cc1c63bf
  1. 4
      ui-ngx/src/app/core/http/asset-profile.service.ts
  2. 4
      ui-ngx/src/app/core/http/dashboard.service.ts
  3. 4
      ui-ngx/src/app/core/http/device-profile.service.ts
  4. 9
      ui-ngx/src/app/core/http/widget.service.ts
  5. 10
      ui-ngx/src/app/shared/import-export/import-export.service.ts

4
ui-ngx/src/app/core/http/asset-profile.service.ts

@ -40,6 +40,10 @@ export class AssetProfileService {
return this.http.get<AssetProfile>(`/api/assetProfile/${assetProfileId}`, defaultHttpOptionsFromConfig(config)); return this.http.get<AssetProfile>(`/api/assetProfile/${assetProfileId}`, defaultHttpOptionsFromConfig(config));
} }
public exportAssetProfile(assetProfileId: string, config?: RequestConfig): Observable<AssetProfile> {
return this.http.get<AssetProfile>(`/api/assetProfile/${assetProfileId}?inlineImages=true`, defaultHttpOptionsFromConfig(config));
}
public saveAssetProfile(assetProfile: AssetProfile, config?: RequestConfig): Observable<AssetProfile> { public saveAssetProfile(assetProfile: AssetProfile, config?: RequestConfig): Observable<AssetProfile> {
return this.http.post<AssetProfile>('/api/assetProfile', assetProfile, defaultHttpOptionsFromConfig(config)); return this.http.post<AssetProfile>('/api/assetProfile', assetProfile, defaultHttpOptionsFromConfig(config));
} }

4
ui-ngx/src/app/core/http/dashboard.service.ts

@ -71,6 +71,10 @@ export class DashboardService {
return this.http.get<Dashboard>(`/api/dashboard/${dashboardId}`, defaultHttpOptionsFromConfig(config)); return this.http.get<Dashboard>(`/api/dashboard/${dashboardId}`, defaultHttpOptionsFromConfig(config));
} }
public exportDashboard(dashboardId: string, config?: RequestConfig): Observable<Dashboard> {
return this.http.get<Dashboard>(`/api/dashboard/${dashboardId}?inlineImages=true`, defaultHttpOptionsFromConfig(config));
}
public getDashboardInfo(dashboardId: string, config?: RequestConfig): Observable<DashboardInfo> { public getDashboardInfo(dashboardId: string, config?: RequestConfig): Observable<DashboardInfo> {
return this.http.get<DashboardInfo>(`/api/dashboard/info/${dashboardId}`, defaultHttpOptionsFromConfig(config)); return this.http.get<DashboardInfo>(`/api/dashboard/info/${dashboardId}`, defaultHttpOptionsFromConfig(config));
} }

4
ui-ngx/src/app/core/http/device-profile.service.ts

@ -53,6 +53,10 @@ export class DeviceProfileService {
return this.http.get<DeviceProfile>(`/api/deviceProfile/${deviceProfileId}`, defaultHttpOptionsFromConfig(config)); return this.http.get<DeviceProfile>(`/api/deviceProfile/${deviceProfileId}`, defaultHttpOptionsFromConfig(config));
} }
public exportDeviceProfile(deviceProfileId: string, config?: RequestConfig): Observable<DeviceProfile> {
return this.http.get<DeviceProfile>(`/api/deviceProfile/${deviceProfileId}?inlineImages=true`, defaultHttpOptionsFromConfig(config));
}
public getLwm2mObjects(sortOrder: SortOrder, objectIds?: string[], searchText?: string, config?: RequestConfig): public getLwm2mObjects(sortOrder: SortOrder, objectIds?: string[], searchText?: string, config?: RequestConfig):
Observable<Array<ObjectLwM2M>> { Observable<Array<ObjectLwM2M>> {
let url = `/api/resource/lwm2m/?sortProperty=${sortOrder.property}&sortOrder=${sortOrder.direction}`; let url = `/api/resource/lwm2m/?sortProperty=${sortOrder.property}&sortOrder=${sortOrder.direction}`;

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

@ -98,6 +98,11 @@ export class WidgetService {
return this.http.get<WidgetsBundle>(`/api/widgetsBundle/${widgetsBundleId}`, defaultHttpOptionsFromConfig(config)); return this.http.get<WidgetsBundle>(`/api/widgetsBundle/${widgetsBundleId}`, defaultHttpOptionsFromConfig(config));
} }
public exportWidgetsBundle(widgetsBundleId: string,
config?: RequestConfig): Observable<WidgetsBundle> {
return this.http.get<WidgetsBundle>(`/api/widgetsBundle/${widgetsBundleId}?inlineImages=true`, defaultHttpOptionsFromConfig(config));
}
public saveWidgetsBundle(widgetsBundle: WidgetsBundle, public saveWidgetsBundle(widgetsBundle: WidgetsBundle,
config?: RequestConfig): Observable<WidgetsBundle> { config?: RequestConfig): Observable<WidgetsBundle> {
return this.http.post<WidgetsBundle>('/api/widgetsBundle', widgetsBundle, return this.http.post<WidgetsBundle>('/api/widgetsBundle', widgetsBundle,
@ -137,9 +142,9 @@ export class WidgetService {
defaultHttpOptionsFromConfig(config)); defaultHttpOptionsFromConfig(config));
} }
public getBundleWidgetTypesDetails(widgetsBundleId: string, public exportBundleWidgetTypesDetails(widgetsBundleId: string,
config?: RequestConfig): Observable<Array<WidgetTypeDetails>> { config?: RequestConfig): Observable<Array<WidgetTypeDetails>> {
return this.http.get<Array<WidgetTypeDetails>>(`/api/widgetTypesDetails?widgetsBundleId=${widgetsBundleId}`, return this.http.get<Array<WidgetTypeDetails>>(`/api/widgetTypesDetails?widgetsBundleId=${widgetsBundleId}?inlineImages=true`,
defaultHttpOptionsFromConfig(config)); defaultHttpOptionsFromConfig(config));
} }

10
ui-ngx/src/app/shared/import-export/import-export.service.ts

@ -139,7 +139,7 @@ export class ImportExportService {
} }
public exportDashboard(dashboardId: string) { public exportDashboard(dashboardId: string) {
this.dashboardService.getDashboard(dashboardId).subscribe( this.dashboardService.exportDashboard(dashboardId).subscribe(
(dashboard) => { (dashboard) => {
let name = dashboard.title; let name = dashboard.title;
name = name.toLowerCase().replace(/\W/g, '_'); name = name.toLowerCase().replace(/\W/g, '_');
@ -348,7 +348,7 @@ export class ImportExportService {
} }
public exportWidgetsBundle(widgetsBundleId: string) { public exportWidgetsBundle(widgetsBundleId: string) {
this.widgetService.getWidgetsBundle(widgetsBundleId).subscribe( this.widgetService.exportWidgetsBundle(widgetsBundleId).subscribe(
(widgetsBundle) => { (widgetsBundle) => {
this.dialog.open<ExportWidgetsBundleDialogComponent, ExportWidgetsBundleDialogData, this.dialog.open<ExportWidgetsBundleDialogComponent, ExportWidgetsBundleDialogData,
ExportWidgetsBundleDialogResult>(ExportWidgetsBundleDialogComponent, { ExportWidgetsBundleDialogResult>(ExportWidgetsBundleDialogComponent, {
@ -376,7 +376,7 @@ export class ImportExportService {
} }
private exportWidgetsBundleWithWidgetTypes(widgetsBundle: WidgetsBundle) { private exportWidgetsBundleWithWidgetTypes(widgetsBundle: WidgetsBundle) {
this.widgetService.getBundleWidgetTypesDetails(widgetsBundle.id.id).subscribe( this.widgetService.exportBundleWidgetTypesDetails(widgetsBundle.id.id).subscribe(
(widgetTypesDetails) => { (widgetTypesDetails) => {
const widgetsBundleItem: WidgetsBundleItem = { const widgetsBundleItem: WidgetsBundleItem = {
widgetsBundle: this.prepareExport(widgetsBundle), widgetsBundle: this.prepareExport(widgetsBundle),
@ -620,7 +620,7 @@ export class ImportExportService {
} }
public exportDeviceProfile(deviceProfileId: string) { public exportDeviceProfile(deviceProfileId: string) {
this.deviceProfileService.getDeviceProfile(deviceProfileId).subscribe( this.deviceProfileService.exportDeviceProfile(deviceProfileId).subscribe(
(deviceProfile) => { (deviceProfile) => {
let name = deviceProfile.name; let name = deviceProfile.name;
name = name.toLowerCase().replace(/\W/g, '_'); name = name.toLowerCase().replace(/\W/g, '_');
@ -651,7 +651,7 @@ export class ImportExportService {
} }
public exportAssetProfile(assetProfileId: string) { public exportAssetProfile(assetProfileId: string) {
this.assetProfileService.getAssetProfile(assetProfileId).subscribe( this.assetProfileService.exportAssetProfile(assetProfileId).subscribe(
(assetProfile) => { (assetProfile) => {
let name = assetProfile.name; let name = assetProfile.name;
name = name.toLowerCase().replace(/\W/g, '_'); name = name.toLowerCase().replace(/\W/g, '_');

Loading…
Cancel
Save