@oneuptime/common 7.0.2989 → 7.0.2994

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 (85) hide show
  1. package/Server/Infrastructure/Queue.ts +36 -1
  2. package/UI/Components/Charts/ChartGroup/ChartGroup.tsx +4 -17
  3. package/UI/Components/Charts/ChartLibrary/LineChart/LineChart.tsx +1005 -0
  4. package/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.ts +3 -0
  5. package/UI/Components/Charts/ChartLibrary/Utils/ChartColors.ts +117 -0
  6. package/UI/Components/Charts/ChartLibrary/Utils/Cx.ts +8 -0
  7. package/UI/Components/Charts/ChartLibrary/Utils/GetYAxisDomain.ts +15 -0
  8. package/UI/Components/Charts/ChartLibrary/Utils/HasOnlyOneValueForKey.ts +19 -0
  9. package/UI/Components/Charts/ChartLibrary/Utils/UseWindowOnResize.ts +17 -0
  10. package/UI/Components/Charts/Line/LineChart.tsx +58 -225
  11. package/UI/Components/Charts/Types/ChartCurve.ts +7 -0
  12. package/UI/Components/Charts/Types/DataPoint.ts +7 -0
  13. package/UI/Components/Charts/Types/SeriesPoint.ts +7 -0
  14. package/UI/Components/Charts/Types/SeriesPoints.ts +6 -0
  15. package/UI/Components/Charts/Types/XAxis/XAxis.ts +21 -0
  16. package/UI/Components/Charts/Types/XAxis/XAxisMaxMin.ts +3 -0
  17. package/UI/Components/Charts/Types/XAxis/XAxisPrecision.ts +26 -0
  18. package/UI/Components/Charts/Types/XAxis/XAxisType.ts +6 -0
  19. package/UI/Components/Charts/Types/XValue.ts +3 -0
  20. package/UI/Components/Charts/Types/YAxis/YAxis.ts +22 -0
  21. package/UI/Components/Charts/Types/YAxis/YAxisMaxMin.ts +3 -0
  22. package/UI/Components/Charts/Types/YAxis/YAxisType.ts +5 -0
  23. package/UI/Components/Charts/Types/YValue.ts +3 -0
  24. package/UI/Components/Charts/Utils/DataPoint.ts +188 -0
  25. package/UI/Components/Charts/Utils/XAxis.ts +267 -0
  26. package/build/dist/Server/Infrastructure/Queue.js +20 -1
  27. package/build/dist/Server/Infrastructure/Queue.js.map +1 -1
  28. package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js +4 -9
  29. package/build/dist/UI/Components/Charts/ChartGroup/ChartGroup.js.map +1 -1
  30. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js +388 -0
  31. package/build/dist/UI/Components/Charts/ChartLibrary/LineChart/LineChart.js.map +1 -0
  32. package/build/dist/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.js +2 -0
  33. package/build/dist/UI/Components/Charts/ChartLibrary/Types/ChartDataPoint.js.map +1 -0
  34. package/build/dist/UI/Components/Charts/ChartLibrary/Utils/ChartColors.js +88 -0
  35. package/build/dist/UI/Components/Charts/ChartLibrary/Utils/ChartColors.js.map +1 -0
  36. package/build/dist/UI/Components/Charts/ChartLibrary/Utils/Cx.js +7 -0
  37. package/build/dist/UI/Components/Charts/ChartLibrary/Utils/Cx.js.map +1 -0
  38. package/build/dist/UI/Components/Charts/ChartLibrary/Utils/GetYAxisDomain.js +7 -0
  39. package/build/dist/UI/Components/Charts/ChartLibrary/Utils/GetYAxisDomain.js.map +1 -0
  40. package/build/dist/UI/Components/Charts/ChartLibrary/Utils/HasOnlyOneValueForKey.js +14 -0
  41. package/build/dist/UI/Components/Charts/ChartLibrary/Utils/HasOnlyOneValueForKey.js.map +1 -0
  42. package/build/dist/UI/Components/Charts/ChartLibrary/Utils/UseWindowOnResize.js +14 -0
  43. package/build/dist/UI/Components/Charts/ChartLibrary/Utils/UseWindowOnResize.js.map +1 -0
  44. package/build/dist/UI/Components/Charts/Line/LineChart.js +30 -136
  45. package/build/dist/UI/Components/Charts/Line/LineChart.js.map +1 -1
  46. package/build/dist/UI/Components/Charts/Types/ChartCurve.js +8 -0
  47. package/build/dist/UI/Components/Charts/Types/ChartCurve.js.map +1 -0
  48. package/build/dist/UI/Components/Charts/Types/DataPoint.js +2 -0
  49. package/build/dist/UI/Components/Charts/Types/DataPoint.js.map +1 -0
  50. package/build/dist/UI/Components/Charts/Types/SeriesPoint.js +2 -0
  51. package/build/dist/UI/Components/Charts/Types/SeriesPoint.js.map +1 -0
  52. package/build/dist/UI/Components/Charts/Types/SeriesPoints.js +2 -0
  53. package/build/dist/UI/Components/Charts/Types/SeriesPoints.js.map +1 -0
  54. package/build/dist/UI/Components/Charts/Types/XAxis/XAxis.js +8 -0
  55. package/build/dist/UI/Components/Charts/Types/XAxis/XAxis.js.map +1 -0
  56. package/build/dist/UI/Components/Charts/Types/XAxis/XAxisMaxMin.js +2 -0
  57. package/build/dist/UI/Components/Charts/Types/XAxis/XAxisMaxMin.js.map +1 -0
  58. package/build/dist/UI/Components/Charts/Types/XAxis/XAxisPrecision.js +27 -0
  59. package/build/dist/UI/Components/Charts/Types/XAxis/XAxisPrecision.js.map +1 -0
  60. package/build/dist/UI/Components/Charts/Types/XAxis/XAxisType.js +7 -0
  61. package/build/dist/UI/Components/Charts/Types/XAxis/XAxisType.js.map +1 -0
  62. package/build/dist/UI/Components/Charts/Types/XValue.js +2 -0
  63. package/build/dist/UI/Components/Charts/Types/XValue.js.map +1 -0
  64. package/build/dist/UI/Components/Charts/Types/YAxis/YAxis.js +8 -0
  65. package/build/dist/UI/Components/Charts/Types/YAxis/YAxis.js.map +1 -0
  66. package/build/dist/UI/Components/Charts/Types/YAxis/YAxisMaxMin.js +2 -0
  67. package/build/dist/UI/Components/Charts/Types/YAxis/YAxisMaxMin.js.map +1 -0
  68. package/build/dist/UI/Components/Charts/Types/YAxis/YAxisType.js +6 -0
  69. package/build/dist/UI/Components/Charts/Types/YAxis/YAxisType.js.map +1 -0
  70. package/build/dist/UI/Components/Charts/Types/YValue.js +2 -0
  71. package/build/dist/UI/Components/Charts/Types/YValue.js.map +1 -0
  72. package/build/dist/UI/Components/Charts/Utils/DataPoint.js +109 -0
  73. package/build/dist/UI/Components/Charts/Utils/DataPoint.js.map +1 -0
  74. package/build/dist/UI/Components/Charts/Utils/XAxis.js +241 -0
  75. package/build/dist/UI/Components/Charts/Utils/XAxis.js.map +1 -0
  76. package/package.json +6 -4
  77. package/UI/Components/Charts/Bar/Bar.tsx +0 -0
  78. package/UI/Components/Charts/Base/BaseChart.tsx +0 -0
  79. package/UI/Components/Charts/Tooltip/Tooltip.tsx +0 -84
  80. package/build/dist/UI/Components/Charts/Bar/Bar.js +0 -2
  81. package/build/dist/UI/Components/Charts/Bar/Bar.js.map +0 -1
  82. package/build/dist/UI/Components/Charts/Base/BaseChart.js +0 -2
  83. package/build/dist/UI/Components/Charts/Base/BaseChart.js.map +0 -1
  84. package/build/dist/UI/Components/Charts/Tooltip/Tooltip.js +0 -34
  85. package/build/dist/UI/Components/Charts/Tooltip/Tooltip.js.map +0 -1
@@ -1,7 +1,16 @@
1
- import { RedisHostname, RedisPassword, RedisPort } from "../EnvironmentConfig";
1
+ import {
2
+ ClusterKey,
3
+ RedisHostname,
4
+ RedisPassword,
5
+ RedisPort,
6
+ } from "../EnvironmentConfig";
2
7
  import Dictionary from "Common/Types/Dictionary";
3
8
  import { JSONObject } from "Common/Types/JSON";
4
9
  import { Queue as BullQueue, Job, JobsOptions } from "bullmq";
10
+ import { ExpressAdapter } from "@bull-board/express";
11
+ import { createBullBoard } from "@bull-board/api";
12
+ import { BullMQAdapter } from "@bull-board/api/bullMQAdapter";
13
+ import { ExpressRouter } from "../Utils/Express";
5
14
 
6
15
  export enum QueueName {
7
16
  Workflow = "Workflow",
@@ -51,6 +60,32 @@ export default class Queue {
51
60
  await this.getQueue(queueName).removeRepeatableByKey(jobId);
52
61
  }
53
62
 
63
+ public static getInspectorRoute(): string {
64
+ return "/api/inspect/queue/:clusterKey";
65
+ }
66
+
67
+ public static getQueueInspectorRouter(): ExpressRouter {
68
+ const serverAdapter: ExpressAdapter = new ExpressAdapter();
69
+
70
+ createBullBoard({
71
+ queues: [
72
+ ...Object.values(QueueName).map((queueName: QueueName) => {
73
+ return new BullMQAdapter(this.getQueue(queueName));
74
+ }),
75
+ ],
76
+ serverAdapter: serverAdapter,
77
+ });
78
+
79
+ serverAdapter.setBasePath(
80
+ this.getInspectorRoute().replace(
81
+ "/:clusterKey",
82
+ "/" + ClusterKey.toString(),
83
+ ),
84
+ );
85
+
86
+ return serverAdapter.getRouter();
87
+ }
88
+
54
89
  public static async addJob(
55
90
  queueName: QueueName,
56
91
  jobId: string,
@@ -1,5 +1,6 @@
1
+ import Text from "../../../../Types/Text";
1
2
  import LineChart, { ComponentProps as LineChartProps } from "../Line/LineChart";
2
- import React, { FunctionComponent, ReactElement, useState } from "react";
3
+ import React, { FunctionComponent, ReactElement } from "react";
3
4
 
4
5
  export enum ChartType {
5
6
  LINE = "line",
@@ -13,7 +14,6 @@ export interface Chart {
13
14
  description?: string | undefined;
14
15
  type: ChartType;
15
16
  props: LineChartProps;
16
- sync: boolean;
17
17
  }
18
18
 
19
19
  export interface ComponentProps {
@@ -23,9 +23,7 @@ export interface ComponentProps {
23
23
  const ChartGroup: FunctionComponent<ComponentProps> = (
24
24
  props: ComponentProps,
25
25
  ): ReactElement => {
26
- const [syncValue, setSyncValue] = useState<
27
- number | string | Date | undefined
28
- >(undefined);
26
+ const syncId: string = Text.generateRandomText(10);
29
27
 
30
28
  return (
31
29
  <div className="lg:grid grid-cols-1 gap-5">
@@ -49,18 +47,7 @@ const ChartGroup: FunctionComponent<ComponentProps> = (
49
47
  {chart.description}
50
48
  </p>
51
49
  )}
52
- <LineChart
53
- key={index}
54
- {...chart.props}
55
- xAxisMarker={{
56
- value: chart.sync ? syncValue : undefined,
57
- }}
58
- onHoverXAxis={(value: string | number | Date) => {
59
- if (chart.sync) {
60
- setSyncValue(value);
61
- }
62
- }}
63
- />
50
+ <LineChart key={index} {...chart.props} syncId={syncId} />
64
51
  </div>
65
52
  );
66
53
  default: