diff --git a/src/app/components/layout/layout.component.ts b/src/app/components/layout/layout.component.ts
index 0aab866..4b1f993 100644
--- a/src/app/components/layout/layout.component.ts
+++ b/src/app/components/layout/layout.component.ts
@@ -75,10 +75,10 @@ export class LayoutComponent implements OnInit {
selectedDatasource: number | undefined;
onDatasourceChange(event: any) {
- this.storageService.getDatasource(event.value).then((dataset: Datasource) => {
+ this.storageService.getDatasource(event.value).then(async (dataset: Datasource) => {
this.toastr.success('Selected datasource: ' + dataset.name);
this.selectedDatasource = dataset.id!;
- this.storageService.saveAppSettings({selectedDatasourceId: dataset.id!});
+ await this.storageService.saveAppSettings({selectedDatasourceId: dataset.id!});
});
}
@@ -86,13 +86,9 @@ export class LayoutComponent implements OnInit {
this.refreshDatasources();
}
- refreshDatasources(): void {
- this.storageService.getAllDatasources().then((datasource: Datasource[]) => {
- this.datasources = datasource;
- if (this.datasources.length > 0) {
- this.selectedDatasource = this.datasources[0].id!;
- }
- });
+ async refreshDatasources() {
+ this.datasources = await this.storageService.getAllDatasources();
+ this.selectedDatasource = (await this.storageService.getAppSettings()).selectedDatasourceId;
}
async login() {
diff --git a/src/app/components/monte-carlo/monte-carlo-page.component.html b/src/app/components/monte-carlo/monte-carlo-page.component.html
index 591a644..7bfba60 100644
--- a/src/app/components/monte-carlo/monte-carlo-page.component.html
+++ b/src/app/components/monte-carlo/monte-carlo-page.component.html
@@ -1,5 +1,20 @@
Monte Carlo Simulation Results
+
Steps
+
+ -
+ Step 1: Read the throughput value from the last 20 days
+
+ -
+ Step 2: Simulate one time the next 14 days: Select 14 random values from step 1 and compute the sum of them
+
+ -
+ Step 3: repeat Step 2 10.000 times
+
+ -
+ Step 4: Plot the histogram of the 10.000 values from step 3
+
+