replace randomUUID with something that is available in real live

This commit is contained in:
2023-03-12 20:15:29 +01:00
parent 1ca4f18e3d
commit 4679da480c
5 changed files with 13 additions and 5 deletions

View File

@@ -111,7 +111,7 @@ export class DashboardComponent implements OnInit {
data: {text:""},
width: '600px'
}).afterClosed().subscribe((text: string) => {
const widget = new TextWidget(crypto.randomUUID(),'MEDIUM', text);
const widget = new TextWidget((<any>window).randomId(),'MEDIUM', text);
this.dashboard!.texts.push(widget);
this.dashboard!.arrangement[0].push(widget.id);
});
@@ -124,7 +124,7 @@ export class DashboardComponent implements OnInit {
height: 'calc(100% - 1em)'
}).afterClosed().subscribe((config: PlotConfig | "") => {
if (config != "" && config.query.length > 0) {
const widget = new PlotWidget(crypto.randomUUID(), 'MEDIUM', config);
const widget = new PlotWidget((<any>window).randomId(), 'MEDIUM', config);
this.dashboard!.plots.push(widget);
this.dashboard!.arrangement[0].push(widget.id);
this.plotWidgetRenderData.push(new PlotWidgetRenderData(widget));