@adminforth/dashboard 1.8.0 → 1.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +81 -55
  2. package/custom/api/dashboardApi.ts +73 -36
  3. package/custom/model/dashboard.types.ts +6 -13
  4. package/custom/runtime/DashboardRuntime.vue +26 -22
  5. package/custom/skills/adminforth-dashboard/SKILL.md +13 -20
  6. package/dist/custom/api/dashboardApi.d.ts +24 -18
  7. package/dist/custom/api/dashboardApi.js +42 -18
  8. package/dist/custom/api/dashboardApi.ts +73 -36
  9. package/dist/custom/model/dashboard.types.d.ts +0 -5
  10. package/dist/custom/model/dashboard.types.ts +6 -13
  11. package/dist/custom/queries/useDashboardConfig.d.ts +20 -120
  12. package/dist/custom/queries/useWidgetData.d.ts +20 -120
  13. package/dist/custom/runtime/DashboardRuntime.vue +26 -22
  14. package/dist/custom/skills/adminforth-dashboard/SKILL.md +13 -20
  15. package/dist/endpoint/groups.js +22 -20
  16. package/dist/endpoint/widgets.js +28 -26
  17. package/dist/schema/api.d.ts +230 -3936
  18. package/dist/schema/api.js +7 -12
  19. package/dist/schema/widget.d.ts +20 -200
  20. package/dist/schema/widgets/charts.d.ts +24 -240
  21. package/dist/schema/widgets/common.d.ts +2 -20
  22. package/dist/schema/widgets/common.js +1 -10
  23. package/dist/schema/widgets/gauge-card.d.ts +2 -20
  24. package/dist/schema/widgets/kpi-card.d.ts +2 -20
  25. package/dist/schema/widgets/pivot-table.d.ts +2 -20
  26. package/dist/schema/widgets/table.d.ts +2 -20
  27. package/dist/services/calc-evaluator.d.ts +2 -0
  28. package/dist/services/calc-evaluator.js +54 -0
  29. package/dist/services/dashboardFilterService.d.ts +5 -0
  30. package/dist/services/dashboardFilterService.js +125 -0
  31. package/dist/services/widgetDataService.js +15 -168
  32. package/endpoint/groups.ts +22 -20
  33. package/endpoint/widgets.ts +28 -26
  34. package/package.json +2 -1
  35. package/schema/api.ts +7 -12
  36. package/schema/widgets/common.ts +1 -11
  37. package/services/calc-evaluator.ts +71 -0
  38. package/services/dashboardFilterService.ts +162 -0
  39. package/services/widgetDataService.ts +26 -213
@@ -95,17 +95,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
95
95
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
96
96
  } | {
97
97
  source: "steps";
98
- steps: ({
99
- name: string;
100
- resource: string;
101
- metric: {
102
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
103
- field?: string | undefined;
104
- as: string;
105
- filters?: any;
106
- };
107
- filters?: any;
108
- } | {
98
+ steps: {
109
99
  name: string;
110
100
  resource: string;
111
101
  select: {
@@ -115,7 +105,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
115
105
  filters?: any;
116
106
  }[];
117
107
  filters?: any;
118
- })[];
108
+ }[];
119
109
  calcs?: {
120
110
  calc: string;
121
111
  as: string;
@@ -230,17 +220,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
230
220
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
231
221
  } | {
232
222
  source: "steps";
233
- steps: ({
234
- name: string;
235
- resource: string;
236
- metric: {
237
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
238
- field?: string | undefined;
239
- as: string;
240
- filters?: any;
241
- };
242
- filters?: any;
243
- } | {
223
+ steps: {
244
224
  name: string;
245
225
  resource: string;
246
226
  select: {
@@ -250,7 +230,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
250
230
  filters?: any;
251
231
  }[];
252
232
  filters?: any;
253
- })[];
233
+ }[];
254
234
  calcs?: {
255
235
  calc: string;
256
236
  as: string;
@@ -361,17 +341,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
361
341
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
362
342
  } | {
363
343
  source: "steps";
364
- steps: ({
365
- name: string;
366
- resource: string;
367
- metric: {
368
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
369
- field?: string | undefined;
370
- as: string;
371
- filters?: any;
372
- };
373
- filters?: any;
374
- } | {
344
+ steps: {
375
345
  name: string;
376
346
  resource: string;
377
347
  select: {
@@ -381,7 +351,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
381
351
  filters?: any;
382
352
  }[];
383
353
  filters?: any;
384
- })[];
354
+ }[];
385
355
  calcs?: {
386
356
  calc: string;
387
357
  as: string;
@@ -477,17 +447,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
477
447
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
478
448
  } | {
479
449
  source: "steps";
480
- steps: ({
481
- name: string;
482
- resource: string;
483
- metric: {
484
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
485
- field?: string | undefined;
486
- as: string;
487
- filters?: any;
488
- };
489
- filters?: any;
490
- } | {
450
+ steps: {
491
451
  name: string;
492
452
  resource: string;
493
453
  select: {
@@ -497,7 +457,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
497
457
  filters?: any;
498
458
  }[];
499
459
  filters?: any;
500
- })[];
460
+ }[];
501
461
  calcs?: {
502
462
  calc: string;
503
463
  as: string;
@@ -590,17 +550,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
590
550
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
591
551
  } | {
592
552
  source: "steps";
593
- steps: ({
594
- name: string;
595
- resource: string;
596
- metric: {
597
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
598
- field?: string | undefined;
599
- as: string;
600
- filters?: any;
601
- };
602
- filters?: any;
603
- } | {
553
+ steps: {
604
554
  name: string;
605
555
  resource: string;
606
556
  select: {
@@ -610,7 +560,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
610
560
  filters?: any;
611
561
  }[];
612
562
  filters?: any;
613
- })[];
563
+ }[];
614
564
  calcs?: {
615
565
  calc: string;
616
566
  as: string;
@@ -720,17 +670,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
720
670
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
721
671
  } | {
722
672
  source: "steps";
723
- steps: ({
724
- name: string;
725
- resource: string;
726
- metric: {
727
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
728
- field?: string | undefined;
729
- as: string;
730
- filters?: any;
731
- };
732
- filters?: any;
733
- } | {
673
+ steps: {
734
674
  name: string;
735
675
  resource: string;
736
676
  select: {
@@ -740,7 +680,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
740
680
  filters?: any;
741
681
  }[];
742
682
  filters?: any;
743
- })[];
683
+ }[];
744
684
  calcs?: {
745
685
  calc: string;
746
686
  as: string;
@@ -855,17 +795,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
855
795
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
856
796
  } | {
857
797
  source: "steps";
858
- steps: ({
859
- name: string;
860
- resource: string;
861
- metric: {
862
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
863
- field?: string | undefined;
864
- as: string;
865
- filters?: any;
866
- };
867
- filters?: any;
868
- } | {
798
+ steps: {
869
799
  name: string;
870
800
  resource: string;
871
801
  select: {
@@ -875,7 +805,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
875
805
  filters?: any;
876
806
  }[];
877
807
  filters?: any;
878
- })[];
808
+ }[];
879
809
  calcs?: {
880
810
  calc: string;
881
811
  as: string;
@@ -986,17 +916,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
986
916
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
987
917
  } | {
988
918
  source: "steps";
989
- steps: ({
990
- name: string;
991
- resource: string;
992
- metric: {
993
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
994
- field?: string | undefined;
995
- as: string;
996
- filters?: any;
997
- };
998
- filters?: any;
999
- } | {
919
+ steps: {
1000
920
  name: string;
1001
921
  resource: string;
1002
922
  select: {
@@ -1006,7 +926,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
1006
926
  filters?: any;
1007
927
  }[];
1008
928
  filters?: any;
1009
- })[];
929
+ }[];
1010
930
  calcs?: {
1011
931
  calc: string;
1012
932
  as: string;
@@ -1102,17 +1022,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
1102
1022
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
1103
1023
  } | {
1104
1024
  source: "steps";
1105
- steps: ({
1106
- name: string;
1107
- resource: string;
1108
- metric: {
1109
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
1110
- field?: string | undefined;
1111
- as: string;
1112
- filters?: any;
1113
- };
1114
- filters?: any;
1115
- } | {
1025
+ steps: {
1116
1026
  name: string;
1117
1027
  resource: string;
1118
1028
  select: {
@@ -1122,7 +1032,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
1122
1032
  filters?: any;
1123
1033
  }[];
1124
1034
  filters?: any;
1125
- })[];
1035
+ }[];
1126
1036
  calcs?: {
1127
1037
  calc: string;
1128
1038
  as: string;
@@ -1215,17 +1125,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
1215
1125
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
1216
1126
  } | {
1217
1127
  source: "steps";
1218
- steps: ({
1219
- name: string;
1220
- resource: string;
1221
- metric: {
1222
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
1223
- field?: string | undefined;
1224
- as: string;
1225
- filters?: any;
1226
- };
1227
- filters?: any;
1228
- } | {
1128
+ steps: {
1229
1129
  name: string;
1230
1130
  resource: string;
1231
1131
  select: {
@@ -1235,7 +1135,7 @@ export declare function useDashboardConfig(slug: Ref<string>): {
1235
1135
  filters?: any;
1236
1136
  }[];
1237
1137
  filters?: any;
1238
- })[];
1138
+ }[];
1239
1139
  calcs?: {
1240
1140
  calc: string;
1241
1141
  as: string;
@@ -85,17 +85,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
85
85
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
86
86
  } | {
87
87
  source: "steps";
88
- steps: ({
89
- name: string;
90
- resource: string;
91
- metric: {
92
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
93
- field?: string | undefined;
94
- as: string;
95
- filters?: any;
96
- };
97
- filters?: any;
98
- } | {
88
+ steps: {
99
89
  name: string;
100
90
  resource: string;
101
91
  select: {
@@ -105,7 +95,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
105
95
  filters?: any;
106
96
  }[];
107
97
  filters?: any;
108
- })[];
98
+ }[];
109
99
  calcs?: {
110
100
  calc: string;
111
101
  as: string;
@@ -220,17 +210,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
220
210
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
221
211
  } | {
222
212
  source: "steps";
223
- steps: ({
224
- name: string;
225
- resource: string;
226
- metric: {
227
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
228
- field?: string | undefined;
229
- as: string;
230
- filters?: any;
231
- };
232
- filters?: any;
233
- } | {
213
+ steps: {
234
214
  name: string;
235
215
  resource: string;
236
216
  select: {
@@ -240,7 +220,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
240
220
  filters?: any;
241
221
  }[];
242
222
  filters?: any;
243
- })[];
223
+ }[];
244
224
  calcs?: {
245
225
  calc: string;
246
226
  as: string;
@@ -351,17 +331,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
351
331
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
352
332
  } | {
353
333
  source: "steps";
354
- steps: ({
355
- name: string;
356
- resource: string;
357
- metric: {
358
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
359
- field?: string | undefined;
360
- as: string;
361
- filters?: any;
362
- };
363
- filters?: any;
364
- } | {
334
+ steps: {
365
335
  name: string;
366
336
  resource: string;
367
337
  select: {
@@ -371,7 +341,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
371
341
  filters?: any;
372
342
  }[];
373
343
  filters?: any;
374
- })[];
344
+ }[];
375
345
  calcs?: {
376
346
  calc: string;
377
347
  as: string;
@@ -467,17 +437,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
467
437
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
468
438
  } | {
469
439
  source: "steps";
470
- steps: ({
471
- name: string;
472
- resource: string;
473
- metric: {
474
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
475
- field?: string | undefined;
476
- as: string;
477
- filters?: any;
478
- };
479
- filters?: any;
480
- } | {
440
+ steps: {
481
441
  name: string;
482
442
  resource: string;
483
443
  select: {
@@ -487,7 +447,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
487
447
  filters?: any;
488
448
  }[];
489
449
  filters?: any;
490
- })[];
450
+ }[];
491
451
  calcs?: {
492
452
  calc: string;
493
453
  as: string;
@@ -580,17 +540,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
580
540
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
581
541
  } | {
582
542
  source: "steps";
583
- steps: ({
584
- name: string;
585
- resource: string;
586
- metric: {
587
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
588
- field?: string | undefined;
589
- as: string;
590
- filters?: any;
591
- };
592
- filters?: any;
593
- } | {
543
+ steps: {
594
544
  name: string;
595
545
  resource: string;
596
546
  select: {
@@ -600,7 +550,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
600
550
  filters?: any;
601
551
  }[];
602
552
  filters?: any;
603
- })[];
553
+ }[];
604
554
  calcs?: {
605
555
  calc: string;
606
556
  as: string;
@@ -699,17 +649,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
699
649
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
700
650
  } | {
701
651
  source: "steps";
702
- steps: ({
703
- name: string;
704
- resource: string;
705
- metric: {
706
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
707
- field?: string | undefined;
708
- as: string;
709
- filters?: any;
710
- };
711
- filters?: any;
712
- } | {
652
+ steps: {
713
653
  name: string;
714
654
  resource: string;
715
655
  select: {
@@ -719,7 +659,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
719
659
  filters?: any;
720
660
  }[];
721
661
  filters?: any;
722
- })[];
662
+ }[];
723
663
  calcs?: {
724
664
  calc: string;
725
665
  as: string;
@@ -834,17 +774,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
834
774
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
835
775
  } | {
836
776
  source: "steps";
837
- steps: ({
838
- name: string;
839
- resource: string;
840
- metric: {
841
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
842
- field?: string | undefined;
843
- as: string;
844
- filters?: any;
845
- };
846
- filters?: any;
847
- } | {
777
+ steps: {
848
778
  name: string;
849
779
  resource: string;
850
780
  select: {
@@ -854,7 +784,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
854
784
  filters?: any;
855
785
  }[];
856
786
  filters?: any;
857
- })[];
787
+ }[];
858
788
  calcs?: {
859
789
  calc: string;
860
790
  as: string;
@@ -965,17 +895,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
965
895
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
966
896
  } | {
967
897
  source: "steps";
968
- steps: ({
969
- name: string;
970
- resource: string;
971
- metric: {
972
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
973
- field?: string | undefined;
974
- as: string;
975
- filters?: any;
976
- };
977
- filters?: any;
978
- } | {
898
+ steps: {
979
899
  name: string;
980
900
  resource: string;
981
901
  select: {
@@ -985,7 +905,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
985
905
  filters?: any;
986
906
  }[];
987
907
  filters?: any;
988
- })[];
908
+ }[];
989
909
  calcs?: {
990
910
  calc: string;
991
911
  as: string;
@@ -1081,17 +1001,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
1081
1001
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
1082
1002
  } | {
1083
1003
  source: "steps";
1084
- steps: ({
1085
- name: string;
1086
- resource: string;
1087
- metric: {
1088
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
1089
- field?: string | undefined;
1090
- as: string;
1091
- filters?: any;
1092
- };
1093
- filters?: any;
1094
- } | {
1004
+ steps: {
1095
1005
  name: string;
1096
1006
  resource: string;
1097
1007
  select: {
@@ -1101,7 +1011,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
1101
1011
  filters?: any;
1102
1012
  }[];
1103
1013
  filters?: any;
1104
- })[];
1014
+ }[];
1105
1015
  calcs?: {
1106
1016
  calc: string;
1107
1017
  as: string;
@@ -1194,17 +1104,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
1194
1104
  formatting?: Record<string, import("../model/dashboard.types.js").JsonValue> | undefined;
1195
1105
  } | {
1196
1106
  source: "steps";
1197
- steps: ({
1198
- name: string;
1199
- resource: string;
1200
- metric: {
1201
- agg: import("../model/dashboard.types.js").QueryAggregateOperation;
1202
- field?: string | undefined;
1203
- as: string;
1204
- filters?: any;
1205
- };
1206
- filters?: any;
1207
- } | {
1107
+ steps: {
1208
1108
  name: string;
1209
1109
  resource: string;
1210
1110
  select: {
@@ -1214,7 +1114,7 @@ export declare function useWidgetData(slug: Ref<string>, widgetId: Ref<string>,
1214
1114
  filters?: any;
1215
1115
  }[];
1216
1116
  filters?: any;
1217
- })[];
1117
+ }[];
1218
1118
  calcs?: {
1219
1119
  calc: string;
1220
1120
  as: string;
@@ -286,7 +286,8 @@ async function addGroup() {
286
286
  }
287
287
 
288
288
  try {
289
- applyDashboardResponse(await dashboardApi.addDashboardGroup(props.dashboardSlug))
289
+ await dashboardApi.addDashboardGroup(props.dashboardSlug)
290
+ await refreshDashboardConfig()
290
291
  } catch (error) {
291
292
  console.error('Failed to add dashboard group', error)
292
293
  }
@@ -298,7 +299,8 @@ async function addWidget(groupId: string) {
298
299
  }
299
300
 
300
301
  try {
301
- applyDashboardResponse(await dashboardApi.addDashboardWidget(props.dashboardSlug, groupId))
302
+ await dashboardApi.addDashboardWidget(props.dashboardSlug, groupId)
303
+ await refreshDashboardConfig()
302
304
  } catch (error) {
303
305
  console.error('Failed to add dashboard widget', error)
304
306
  }
@@ -310,9 +312,8 @@ async function moveGroup(groupId: string, direction: DashboardGroupMoveDirection
310
312
  }
311
313
 
312
314
  try {
313
- applyDashboardResponse(
314
- await dashboardApi.moveDashboardGroup(props.dashboardSlug, groupId, direction),
315
- )
315
+ await dashboardApi.moveDashboardGroup(props.dashboardSlug, groupId, direction)
316
+ await refreshDashboardConfig()
316
317
  } catch (error) {
317
318
  console.error('Failed to move dashboard group', error)
318
319
  }
@@ -324,7 +325,8 @@ async function removeGroup(groupId: string) {
324
325
  }
325
326
 
326
327
  try {
327
- applyDashboardResponse(await dashboardApi.removeDashboardGroup(props.dashboardSlug, groupId))
328
+ await dashboardApi.removeDashboardGroup(props.dashboardSlug, groupId)
329
+ await refreshDashboardConfig()
328
330
  } catch (error) {
329
331
  console.error('Failed to remove dashboard group', error)
330
332
  }
@@ -348,13 +350,12 @@ async function saveGroupConfig() {
348
350
  try {
349
351
  const groupConfig = parseYaml(groupConfigCode.value) as EditableDashboardGroupConfig
350
352
 
351
- applyDashboardResponse(
352
- await dashboardApi.setDashboardGroupConfig(
353
- props.dashboardSlug,
354
- editingGroupId.value,
355
- groupConfig,
356
- ),
353
+ await dashboardApi.setDashboardGroupConfig(
354
+ props.dashboardSlug,
355
+ editingGroupId.value,
356
+ groupConfig,
357
357
  )
358
+ await refreshDashboardConfig()
358
359
  closeGroupConfigEditor()
359
360
  } catch (error) {
360
361
  groupConfigError.value = error instanceof Error ? error.message : 'Invalid group config'
@@ -373,9 +374,8 @@ async function moveWidget(widgetId: string, direction: DashboardWidgetMoveDirect
373
374
  }
374
375
 
375
376
  try {
376
- applyDashboardResponse(
377
- await dashboardApi.moveDashboardWidget(props.dashboardSlug, widgetId, direction),
378
- )
377
+ await dashboardApi.moveDashboardWidget(props.dashboardSlug, widgetId, direction)
378
+ await refreshDashboardConfig()
379
379
  } catch (error) {
380
380
  console.error('Failed to move dashboard widget', error)
381
381
  }
@@ -387,7 +387,8 @@ async function removeWidget(widgetId: string) {
387
387
  }
388
388
 
389
389
  try {
390
- applyDashboardResponse(await dashboardApi.removeDashboardWidget(props.dashboardSlug, widgetId))
390
+ await dashboardApi.removeDashboardWidget(props.dashboardSlug, widgetId)
391
+ await refreshDashboardConfig()
391
392
  } catch (error) {
392
393
  console.error('Failed to remove dashboard widget', error)
393
394
  }
@@ -410,13 +411,12 @@ async function saveWidgetConfig() {
410
411
  widgetConfigFieldErrors.value = []
411
412
  const widgetConfig = parseYaml(widgetConfigCode.value) as DashboardWidgetConfig
412
413
 
413
- applyDashboardResponse(
414
- await dashboardApi.setWidgetConfig(
415
- props.dashboardSlug,
416
- editingWidgetId.value,
417
- serializeDashboardWidgetConfigForEditor(widgetConfig),
418
- ),
414
+ await dashboardApi.setWidgetConfig(
415
+ props.dashboardSlug,
416
+ editingWidgetId.value,
417
+ serializeDashboardWidgetConfigForEditor(widgetConfig),
419
418
  )
419
+ await refreshDashboardConfig()
420
420
  closeWidgetConfigEditor()
421
421
  } catch (error) {
422
422
  widgetConfigError.value = error instanceof Error ? error.message : 'Invalid widget config'
@@ -431,6 +431,10 @@ function closeWidgetConfigEditor() {
431
431
  widgetConfigFieldErrors.value = []
432
432
  }
433
433
 
434
+ async function refreshDashboardConfig() {
435
+ applyDashboardResponse(await dashboardApi.getDashboardConfig(props.dashboardSlug))
436
+ }
437
+
434
438
  function applyDashboardResponse(response: DashboardResponse) {
435
439
  draftConfig.value = cloneConfig(response.config)
436
440
  currentRevision.value = response.revision