@sentio/ui-dashboard 0.3.6 → 0.3.7
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.
- package/dist/index.css +119 -0
- package/dist/index.css.map +1 -1
- package/dist/index.d.mts +94 -64
- package/dist/index.d.ts +94 -64
- package/dist/index.js +220 -0
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +223 -0
- package/dist/index.mjs.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -125,6 +125,18 @@ interface DashboardLike {
|
|
|
125
125
|
editPanels?: string[];
|
|
126
126
|
sharing?: unknown;
|
|
127
127
|
}
|
|
128
|
+
interface ComputeStatsLike {
|
|
129
|
+
computedAt?: string;
|
|
130
|
+
isRefreshing?: boolean;
|
|
131
|
+
}
|
|
132
|
+
interface SharingConfigLike {
|
|
133
|
+
isReadonly?: boolean;
|
|
134
|
+
hideModifiers?: boolean;
|
|
135
|
+
}
|
|
136
|
+
interface DashboardSharingLike {
|
|
137
|
+
id?: string;
|
|
138
|
+
config?: SharingConfigLike;
|
|
139
|
+
}
|
|
128
140
|
|
|
129
141
|
/** Sort key + direction (x-axis, bar-gauge). */
|
|
130
142
|
interface SortLike {
|
|
@@ -435,12 +447,12 @@ interface SeriesLike<T = Date> {
|
|
|
435
447
|
smooth?: boolean;
|
|
436
448
|
}
|
|
437
449
|
|
|
438
|
-
interface Props$
|
|
450
|
+
interface Props$x {
|
|
439
451
|
metric?: MetricInfoLike;
|
|
440
452
|
value: QueryLike;
|
|
441
453
|
onChange: (value: QueryLike) => void;
|
|
442
454
|
}
|
|
443
|
-
declare function AggregateInput({ metric, value, onChange }: Props$
|
|
455
|
+
declare function AggregateInput({ metric, value, onChange }: Props$x): react_jsx_runtime.JSX.Element;
|
|
444
456
|
|
|
445
457
|
declare enum ArgumentType {
|
|
446
458
|
String = 0,
|
|
@@ -475,28 +487,28 @@ declare const EventsFunctionMap: {
|
|
|
475
487
|
[name: string]: FunctionDef;
|
|
476
488
|
};
|
|
477
489
|
|
|
478
|
-
interface Props$
|
|
490
|
+
interface Props$w {
|
|
479
491
|
argument: ArgumentDef;
|
|
480
492
|
value?: ArgumentLike;
|
|
481
493
|
onChange?: (value: ArgumentLike) => void;
|
|
482
494
|
className?: string;
|
|
483
495
|
}
|
|
484
|
-
declare function ArgumentInput({ className, argument, value, onChange }: Props$
|
|
496
|
+
declare function ArgumentInput({ className, argument, value, onChange }: Props$w): react_jsx_runtime.JSX.Element;
|
|
485
497
|
|
|
486
|
-
interface Props$
|
|
498
|
+
interface Props$v {
|
|
487
499
|
value: QueryLike;
|
|
488
500
|
onChange: (value: QueryLike) => void;
|
|
489
501
|
}
|
|
490
|
-
declare function FunctionInput({ value, onChange }: Props$
|
|
502
|
+
declare function FunctionInput({ value, onChange }: Props$v): react_jsx_runtime.JSX.Element;
|
|
491
503
|
|
|
492
|
-
interface Props$
|
|
504
|
+
interface Props$u {
|
|
493
505
|
onClick: (func: FunctionDef) => void;
|
|
494
506
|
functionCategories?: typeof FunctionsCategories;
|
|
495
507
|
defaultFunc?: string;
|
|
496
508
|
}
|
|
497
|
-
declare function FunctionsPanel({ onClick, functionCategories, defaultFunc }: Props$
|
|
509
|
+
declare function FunctionsPanel({ onClick, functionCategories, defaultFunc }: Props$u): react_jsx_runtime.JSX.Element;
|
|
498
510
|
|
|
499
|
-
interface Props$
|
|
511
|
+
interface Props$t {
|
|
500
512
|
metric?: MetricInfoLike;
|
|
501
513
|
value: QueryLike;
|
|
502
514
|
onChange: (value: QueryLike) => void;
|
|
@@ -506,7 +518,7 @@ interface Props$r {
|
|
|
506
518
|
small?: boolean;
|
|
507
519
|
useRegex?: boolean;
|
|
508
520
|
}
|
|
509
|
-
declare function LabelsInput({ value, metric, variables, onChange, small, useRegex }: Props$
|
|
521
|
+
declare function LabelsInput({ value, metric, variables, onChange, small, useRegex }: Props$t): react_jsx_runtime.JSX.Element;
|
|
510
522
|
|
|
511
523
|
declare const SystemLabels: {
|
|
512
524
|
field: string;
|
|
@@ -569,7 +581,7 @@ type SeriesFinder = {
|
|
|
569
581
|
};
|
|
570
582
|
declare const ReactEChartsBase: react__default.ForwardRefExoticComponent<ReactEChartsProps & react__default.RefAttributes<EChartsHandle>>;
|
|
571
583
|
|
|
572
|
-
interface Props$
|
|
584
|
+
interface Props$s {
|
|
573
585
|
legend: string[];
|
|
574
586
|
legendSelected: Record<string, boolean>;
|
|
575
587
|
returnedSeries?: number;
|
|
@@ -577,7 +589,7 @@ interface Props$q {
|
|
|
577
589
|
onRendered: (v: boolean) => void;
|
|
578
590
|
chartHandle?: EChartsHandle;
|
|
579
591
|
}
|
|
580
|
-
declare const ChartLegend: ({ legend, legendSelected, returnedSeries, totalSeries, onRendered, chartHandle }: Props$
|
|
592
|
+
declare const ChartLegend: ({ legend, legendSelected, returnedSeries, totalSeries, onRendered, chartHandle }: Props$s) => react_jsx_runtime.JSX.Element;
|
|
581
593
|
|
|
582
594
|
declare const RefreshContext: react.Context<{
|
|
583
595
|
refresh?: () => void;
|
|
@@ -585,14 +597,14 @@ declare const RefreshContext: react.Context<{
|
|
|
585
597
|
}>;
|
|
586
598
|
declare const RefreshButton: (props: Partial<ButtonProps>) => react_jsx_runtime.JSX.Element | null;
|
|
587
599
|
|
|
588
|
-
type Props$
|
|
600
|
+
type Props$r = {
|
|
589
601
|
value: ChartTypeLike;
|
|
590
602
|
onChange: (value: ChartTypeLike) => void;
|
|
591
603
|
small?: boolean;
|
|
592
604
|
};
|
|
593
|
-
declare const ChartTypeButtonGroup: ({ value, onChange, small }: Props$
|
|
605
|
+
declare const ChartTypeButtonGroup: ({ value, onChange, small }: Props$r) => react_jsx_runtime.JSX.Element;
|
|
594
606
|
|
|
595
|
-
interface Props$
|
|
607
|
+
interface Props$q {
|
|
596
608
|
data: any;
|
|
597
609
|
compareTimeDuration?: DurationLike;
|
|
598
610
|
numberFormatter: (value: number, seriesId?: string) => string;
|
|
@@ -605,9 +617,9 @@ interface Props$o {
|
|
|
605
617
|
viewUsersDisabled?: (seriesId: string, seriesIndex: number) => boolean;
|
|
606
618
|
isFixed?: boolean;
|
|
607
619
|
}
|
|
608
|
-
declare function ChartTooltip({ data, numberFormatter, compareTimeDuration, highlightSeriesId, title, showTotal, onViewLogs, viewLogDisabled, onViewUsers, viewUsersDisabled, isFixed }: Props$
|
|
620
|
+
declare function ChartTooltip({ data, numberFormatter, compareTimeDuration, highlightSeriesId, title, showTotal, onViewLogs, viewLogDisabled, onViewUsers, viewUsersDisabled, isFixed }: Props$q): react_jsx_runtime.JSX.Element;
|
|
609
621
|
|
|
610
|
-
interface Props$
|
|
622
|
+
interface Props$p {
|
|
611
623
|
data: any;
|
|
612
624
|
compareTimeDuration?: DurationLike;
|
|
613
625
|
numberFormatter: (value: number) => string;
|
|
@@ -620,7 +632,7 @@ interface Props$n {
|
|
|
620
632
|
isFixed?: boolean;
|
|
621
633
|
sizeTitle?: string;
|
|
622
634
|
}
|
|
623
|
-
declare function ScatterChartTooltip({ data, numberFormatter, highlightSeriesId, title, onViewLogs, viewLogDisabled, onViewUsers, viewUsersDisabled, isFixed, sizeTitle }: Props$
|
|
635
|
+
declare function ScatterChartTooltip({ data, numberFormatter, highlightSeriesId, title, onViewLogs, viewLogDisabled, onViewUsers, viewUsersDisabled, isFixed, sizeTitle }: Props$p): react_jsx_runtime.JSX.Element;
|
|
624
636
|
|
|
625
637
|
/** Minimal shape consumed from a computed series — only name + first data point. */
|
|
626
638
|
interface PieSeriesInput {
|
|
@@ -773,42 +785,42 @@ interface TimeSeriesChartProps {
|
|
|
773
785
|
}
|
|
774
786
|
declare const TimeSeriesChart: react.ForwardRefExoticComponent<TimeSeriesChartProps & react.RefAttributes<EChartsHandle>>;
|
|
775
787
|
|
|
776
|
-
interface Props$
|
|
788
|
+
interface Props$o {
|
|
777
789
|
config?: LineConfigLike;
|
|
778
790
|
defaultOpen?: boolean;
|
|
779
791
|
onChange: (config: LineConfigLike) => void;
|
|
780
792
|
}
|
|
781
|
-
declare const LineControls: ({ config, defaultOpen, onChange }: Props$
|
|
793
|
+
declare const LineControls: ({ config, defaultOpen, onChange }: Props$o) => react_jsx_runtime.JSX.Element;
|
|
782
794
|
|
|
783
|
-
interface Props$
|
|
795
|
+
interface Props$n {
|
|
784
796
|
config?: LabelConfigLike;
|
|
785
797
|
setConfig: (value: LabelConfigLike) => void;
|
|
786
798
|
defaultOpen?: boolean;
|
|
787
799
|
}
|
|
788
|
-
declare const LabelControls: ({ config, setConfig, defaultOpen }: Props$
|
|
800
|
+
declare const LabelControls: ({ config, setConfig, defaultOpen }: Props$n) => react_jsx_runtime.JSX.Element;
|
|
789
801
|
|
|
790
|
-
interface Props$
|
|
802
|
+
interface Props$m {
|
|
791
803
|
config?: PieConfigLike;
|
|
792
804
|
defaultOpen?: boolean;
|
|
793
805
|
onChange: (config: PieConfigLike) => void;
|
|
794
806
|
}
|
|
795
807
|
declare const defaultConfig$6: PieConfigLike;
|
|
796
|
-
declare function PieChartControls({ config, defaultOpen, onChange }: Props$
|
|
808
|
+
declare function PieChartControls({ config, defaultOpen, onChange }: Props$m): react_jsx_runtime.JSX.Element;
|
|
797
809
|
|
|
798
|
-
interface Props$
|
|
810
|
+
interface Props$l {
|
|
799
811
|
config?: BarGaugeConfigLike;
|
|
800
812
|
defaultOpen?: boolean;
|
|
801
813
|
onChange: (config: BarGaugeConfigLike) => void;
|
|
802
814
|
}
|
|
803
815
|
declare const defaultConfig$5: BarGaugeConfigLike;
|
|
804
|
-
declare function BarGaugeControls({ config, defaultOpen, onChange }: Props$
|
|
816
|
+
declare function BarGaugeControls({ config, defaultOpen, onChange }: Props$l): react_jsx_runtime.JSX.Element;
|
|
805
817
|
|
|
806
818
|
interface ValueFormatter {
|
|
807
819
|
label: string;
|
|
808
820
|
value: ValueFormatterLike;
|
|
809
821
|
}
|
|
810
822
|
declare const ValueFormatters: ValueFormatter[];
|
|
811
|
-
interface Props$
|
|
823
|
+
interface Props$k {
|
|
812
824
|
config: ValueConfigLike;
|
|
813
825
|
defaultOpen?: boolean;
|
|
814
826
|
onChange: (config: ValueConfigLike) => void;
|
|
@@ -817,9 +829,9 @@ interface Props$i {
|
|
|
817
829
|
showSuffix?: boolean;
|
|
818
830
|
}
|
|
819
831
|
declare const defaultConfig$4: ValueConfigLike;
|
|
820
|
-
declare const ValueOptions: ({ config, onChange, formatters, showPrefix, showSuffix }: Props$
|
|
832
|
+
declare const ValueOptions: ({ config, onChange, formatters, showPrefix, showSuffix }: Props$k) => react_jsx_runtime.JSX.Element;
|
|
821
833
|
|
|
822
|
-
interface Props$
|
|
834
|
+
interface Props$j {
|
|
823
835
|
config?: ValueConfigLike;
|
|
824
836
|
defaultOpen?: boolean;
|
|
825
837
|
onChange: (config: ValueConfigLike) => void;
|
|
@@ -828,15 +840,15 @@ interface Props$h {
|
|
|
828
840
|
showSuffix?: boolean;
|
|
829
841
|
}
|
|
830
842
|
declare const defaultConfig$3: ValueConfigLike;
|
|
831
|
-
declare const ValueControls: ({ config, defaultOpen, onChange, formatters, showPrefix, showSuffix }: Props$
|
|
843
|
+
declare const ValueControls: ({ config, defaultOpen, onChange, formatters, showPrefix, showSuffix }: Props$j) => react_jsx_runtime.JSX.Element;
|
|
832
844
|
|
|
833
|
-
interface Props$
|
|
845
|
+
interface Props$i {
|
|
834
846
|
rules: MappingRuleLike[];
|
|
835
847
|
onChange: (rules: MappingRuleLike[]) => void;
|
|
836
848
|
}
|
|
837
|
-
declare function ValueStringMapping({ rules, onChange }: Props$
|
|
849
|
+
declare function ValueStringMapping({ rules, onChange }: Props$i): react_jsx_runtime.JSX.Element;
|
|
838
850
|
|
|
839
|
-
interface Props$
|
|
851
|
+
interface Props$h {
|
|
840
852
|
yAxis?: YAxisConfigLike;
|
|
841
853
|
setYAxis: (yAxis: YAxisConfigLike) => void;
|
|
842
854
|
defaultOpen?: boolean;
|
|
@@ -849,9 +861,9 @@ interface Props$f {
|
|
|
849
861
|
supportReset?: boolean;
|
|
850
862
|
panelTitle?: string;
|
|
851
863
|
}
|
|
852
|
-
declare function YaxisControls({ yAxis, setYAxis, defaultOpen, columnSelect, supportSetName, supportSetMinMax, supportStackSeries, supportAlwaysShowZero, supportReset, panelTitle }: Props$
|
|
864
|
+
declare function YaxisControls({ yAxis, setYAxis, defaultOpen, columnSelect, supportSetName, supportSetMinMax, supportStackSeries, supportAlwaysShowZero, supportReset, panelTitle }: Props$h): react_jsx_runtime.JSX.Element;
|
|
853
865
|
|
|
854
|
-
interface Props$
|
|
866
|
+
interface Props$g {
|
|
855
867
|
xAxis?: XAxisConfigLike;
|
|
856
868
|
setXAxis: (val?: XAxisConfigLike) => void;
|
|
857
869
|
defaultOpen?: boolean;
|
|
@@ -864,15 +876,15 @@ interface Props$e {
|
|
|
864
876
|
supportSort?: boolean;
|
|
865
877
|
supportSetType?: boolean;
|
|
866
878
|
}
|
|
867
|
-
declare const XAxisControls: ({ xAxis, setXAxis, defaultOpen, columnSelect, columnIsNonTime, panelTitle, supportName, supportSort, supportSetType }: Props$
|
|
879
|
+
declare const XAxisControls: ({ xAxis, setXAxis, defaultOpen, columnSelect, columnIsNonTime, panelTitle, supportName, supportSort, supportSetType }: Props$g) => react_jsx_runtime.JSX.Element;
|
|
868
880
|
|
|
869
|
-
interface Props$
|
|
881
|
+
interface Props$f {
|
|
870
882
|
markers?: MarkerLike[];
|
|
871
883
|
onChange: (v: MarkerLike[]) => void;
|
|
872
884
|
}
|
|
873
|
-
declare function MarkerControls({ markers, onChange }: Props$
|
|
885
|
+
declare function MarkerControls({ markers, onChange }: Props$f): react_jsx_runtime.JSX.Element;
|
|
874
886
|
|
|
875
|
-
interface Props$
|
|
887
|
+
interface Props$e {
|
|
876
888
|
defaultOpen?: boolean;
|
|
877
889
|
onChange: (config: DataConfigLike) => void;
|
|
878
890
|
chartConfig?: ChartConfigLike;
|
|
@@ -880,9 +892,9 @@ interface Props$c {
|
|
|
880
892
|
defaultSeriesLimit?: number;
|
|
881
893
|
}
|
|
882
894
|
declare const defaultConfig$2: DataConfigLike;
|
|
883
|
-
declare function DataControls({ defaultOpen, onChange, chartConfig, defaultSeriesLimit }: Props$
|
|
895
|
+
declare function DataControls({ defaultOpen, onChange, chartConfig, defaultSeriesLimit }: Props$e): react_jsx_runtime.JSX.Element;
|
|
884
896
|
|
|
885
|
-
interface Props$
|
|
897
|
+
interface Props$d {
|
|
886
898
|
config?: ScatterConfigLike;
|
|
887
899
|
defaultOpen?: boolean;
|
|
888
900
|
onChange: (config: ScatterConfigLike) => void;
|
|
@@ -898,9 +910,9 @@ interface Props$b {
|
|
|
898
910
|
}) => ReactNode;
|
|
899
911
|
}
|
|
900
912
|
declare const defaultConfig$1: ScatterConfigLike;
|
|
901
|
-
declare function ScatterControls({ config, defaultOpen, onChange, columnSelect, colorPicker }: Props$
|
|
913
|
+
declare function ScatterControls({ config, defaultOpen, onChange, columnSelect, colorPicker }: Props$d): react_jsx_runtime.JSX.Element;
|
|
902
914
|
|
|
903
|
-
interface Props$
|
|
915
|
+
interface Props$c {
|
|
904
916
|
config?: TableConfigLike;
|
|
905
917
|
defaultOpen?: boolean;
|
|
906
918
|
onChange: (config: TableConfigLike) => void;
|
|
@@ -908,7 +920,7 @@ interface Props$a {
|
|
|
908
920
|
}
|
|
909
921
|
declare const defaultConfig: TableConfigLike;
|
|
910
922
|
declare function getDefaultValueConfig(type?: ColumnTypeLike): ValueConfigLike;
|
|
911
|
-
declare function TableControls({ config, defaultOpen, onChange, data }: Props$
|
|
923
|
+
declare function TableControls({ config, defaultOpen, onChange, data }: Props$c): react_jsx_runtime.JSX.Element;
|
|
912
924
|
|
|
913
925
|
declare const sentioColors: {
|
|
914
926
|
light: {
|
|
@@ -1660,55 +1672,55 @@ declare const sentioThemeDark: {
|
|
|
1660
1672
|
};
|
|
1661
1673
|
};
|
|
1662
1674
|
|
|
1675
|
+
interface Props$b {
|
|
1676
|
+
className?: string;
|
|
1677
|
+
}
|
|
1678
|
+
declare const SvgIcon$7: ({ className }: Props$b) => react_jsx_runtime.JSX.Element;
|
|
1679
|
+
|
|
1680
|
+
interface Props$a {
|
|
1681
|
+
className?: string;
|
|
1682
|
+
}
|
|
1683
|
+
declare const SvgIcon$6: ({ className }: Props$a) => react_jsx_runtime.JSX.Element;
|
|
1684
|
+
|
|
1663
1685
|
interface Props$9 {
|
|
1664
1686
|
className?: string;
|
|
1665
1687
|
}
|
|
1666
|
-
declare const SvgIcon$
|
|
1688
|
+
declare const SvgIcon$5: ({ className }: Props$9) => react_jsx_runtime.JSX.Element;
|
|
1667
1689
|
|
|
1668
1690
|
interface Props$8 {
|
|
1669
1691
|
className?: string;
|
|
1670
1692
|
}
|
|
1671
|
-
declare const SvgIcon$
|
|
1693
|
+
declare const SvgIcon$4: ({ className }: Props$8) => react_jsx_runtime.JSX.Element;
|
|
1672
1694
|
|
|
1673
1695
|
interface Props$7 {
|
|
1674
1696
|
className?: string;
|
|
1675
1697
|
}
|
|
1676
|
-
declare const SvgIcon$
|
|
1698
|
+
declare const SvgIcon$3: ({ className }: Props$7) => react_jsx_runtime.JSX.Element;
|
|
1677
1699
|
|
|
1678
1700
|
interface Props$6 {
|
|
1679
1701
|
className?: string;
|
|
1680
1702
|
}
|
|
1681
|
-
declare const SvgIcon$
|
|
1703
|
+
declare const SvgIcon$2: ({ className }: Props$6) => react_jsx_runtime.JSX.Element;
|
|
1682
1704
|
|
|
1683
1705
|
interface Props$5 {
|
|
1684
1706
|
className?: string;
|
|
1685
1707
|
}
|
|
1686
|
-
declare const SvgIcon$
|
|
1708
|
+
declare const SvgIcon$1: ({ className }: Props$5) => react_jsx_runtime.JSX.Element;
|
|
1687
1709
|
|
|
1688
1710
|
interface Props$4 {
|
|
1689
1711
|
className?: string;
|
|
1690
1712
|
}
|
|
1691
|
-
declare const SvgIcon
|
|
1713
|
+
declare const SvgIcon: ({ className }: Props$4) => react_jsx_runtime.JSX.Element;
|
|
1692
1714
|
|
|
1693
1715
|
interface Props$3 {
|
|
1694
|
-
className?: string;
|
|
1695
|
-
}
|
|
1696
|
-
declare const SvgIcon$1: ({ className }: Props$3) => react_jsx_runtime.JSX.Element;
|
|
1697
|
-
|
|
1698
|
-
interface Props$2 {
|
|
1699
|
-
className?: string;
|
|
1700
|
-
}
|
|
1701
|
-
declare const SvgIcon: ({ className }: Props$2) => react_jsx_runtime.JSX.Element;
|
|
1702
|
-
|
|
1703
|
-
interface Props$1 {
|
|
1704
1716
|
dashboard?: DashboardLike;
|
|
1705
1717
|
open: boolean;
|
|
1706
1718
|
onClose: () => void;
|
|
1707
1719
|
onUpdate: (data: DashboardLike) => Promise<void>;
|
|
1708
1720
|
}
|
|
1709
|
-
declare const EditDashboardDialog: ({ dashboard, open, onClose, onUpdate }: Props$
|
|
1721
|
+
declare const EditDashboardDialog: ({ dashboard, open, onClose, onUpdate }: Props$3) => react_jsx_runtime.JSX.Element;
|
|
1710
1722
|
|
|
1711
|
-
interface Props {
|
|
1723
|
+
interface Props$2 {
|
|
1712
1724
|
open: boolean;
|
|
1713
1725
|
onClose: () => void;
|
|
1714
1726
|
title: string;
|
|
@@ -1720,7 +1732,25 @@ interface Props {
|
|
|
1720
1732
|
highlightColor: string;
|
|
1721
1733
|
}) => void;
|
|
1722
1734
|
}
|
|
1723
|
-
declare function EditGroupDialog({ open, onClose, title, style, highlightColor, onSave }: Props): react_jsx_runtime.JSX.Element;
|
|
1735
|
+
declare function EditGroupDialog({ open, onClose, title, style, highlightColor, onSave }: Props$2): react_jsx_runtime.JSX.Element;
|
|
1736
|
+
|
|
1737
|
+
interface Props$1 {
|
|
1738
|
+
stats?: ComputeStatsLike;
|
|
1739
|
+
onRefresh: () => Promise<void>;
|
|
1740
|
+
}
|
|
1741
|
+
declare const DashboardRefresh: ({ stats, onRefresh }: Props$1) => react_jsx_runtime.JSX.Element;
|
|
1742
|
+
|
|
1743
|
+
interface Props {
|
|
1744
|
+
open: boolean;
|
|
1745
|
+
initData?: DashboardSharingLike;
|
|
1746
|
+
onUnshare?: () => void;
|
|
1747
|
+
onClose: () => void;
|
|
1748
|
+
onConfigChange?: (config: SharingConfigLike) => void;
|
|
1749
|
+
startTime?: DateTimeValue;
|
|
1750
|
+
endTime?: DateTimeValue;
|
|
1751
|
+
tz?: string;
|
|
1752
|
+
}
|
|
1753
|
+
declare const ShareDashboardDialog: ({ open, initData, onUnshare, onClose, onConfigChange, startTime, endTime, tz }: Props) => react_jsx_runtime.JSX.Element;
|
|
1724
1754
|
|
|
1725
1755
|
type HighlightColorKey = '' | 'blue' | 'cyan' | 'pink' | 'yellow' | 'green' | 'lightblue' | 'purple' | 'red' | 'orange';
|
|
1726
1756
|
interface HighlightColorMeta {
|
|
@@ -1737,4 +1767,4 @@ interface ResolvedHighlight {
|
|
|
1737
1767
|
declare function resolveHighlight(colorKey: string | undefined, isDark: boolean): ResolvedHighlight;
|
|
1738
1768
|
declare function resolveHeaderStyle(style: GroupStyleLike | undefined, colorKey: string | undefined, isDark: boolean): React.CSSProperties;
|
|
1739
1769
|
|
|
1740
|
-
export { AggregateInput, SvgIcon$6 as AreaIcon, type ArgumentDef, ArgumentInput, ArgumentType, BarGaugeChart, type BarGaugeChartProps, BarGaugeControls, SvgIcon$4 as BarGuageIcon, SvgIcon$5 as BarIcon, type ChartConfigLike, ChartLegend, type ChartLike, ChartTooltip, ChartTypeButtonGroup, type ChartTypeLike, DEFAULT_HIGHLIGHT_KEY, type DashboardExtraLike, type DashboardLike, type DashboardVisibilityLike, DataControls, type DataSourceTypeLike, type EChartsHandle, type EChartsOption, EditDashboardDialog, EditGroupDialog, EventsFunctionCategories, EventsFunctionMap, type FunctionDef, FunctionInput, FunctionMap, FunctionsCategories, FunctionsPanel, type GroupLike, type GroupStyleLike, HIGHLIGHT_COLORS, type HighlightColorKey, type HighlightColorMeta, LabelControls, LabelSearchProvider, LabelsInput, type LayoutItemLike, type LayoutsLike, LineControls, SvgIcon$7 as LineIcon, type MarkArea, type MarkLine, MarkerControls, type NoteAlignmentLike, type NoteFontSizeLike, type NoteLike, type NoteVerticalAlignmentLike, type OverlayGraphLike, type PanelLike, PieChart, PieChartControls, type PieChartProps, SvgIcon$3 as PieIcon, type PieSeriesInput, QueryValueChart, type QueryValueChartProps, SvgIcon$2 as QueryValueIcon, ReactEChartsBase, type ReactEChartsProps, RefreshButton, RefreshContext, type ResolvedHighlight, type ResponsiveLayoutsLike, ScatterChartTooltip, ScatterControls, SvgIcon$1 as ScatterIcon, SystemLabels, TableControls, SvgIcon as TableIcon, type TemplateVariableLike, type TemplateViewLike, TimeSeriesChart, type TimeSeriesChartProps, ValueControls, type ValueFormatter, ValueFormatters, ValueOptions, ValueStringMapping, type ViewActionContext, XAxisControls, type YAxisConfigLike, YaxisControls, defaultConfig$5 as defaultBarGaugeConfig, defaultConfig$2 as defaultDataConfig, defaultConfig$6 as defaultPieConfig, defaultConfig$1 as defaultScatterConfig, defaultConfig as defaultTableConfig, defaultConfig$4 as defaultValueConfig, defaultConfig$3 as defaultValueControlsConfig, getDefaultValueConfig, getHighlightHex, isAggrOrRollupFunction, resolveHeaderStyle, resolveHighlight, sentioColors, sentioTheme, sentioThemeDark, sortMetricByName, useLabelSearch, useLabelSearchContext };
|
|
1770
|
+
export { AggregateInput, SvgIcon$6 as AreaIcon, type ArgumentDef, ArgumentInput, ArgumentType, BarGaugeChart, type BarGaugeChartProps, BarGaugeControls, SvgIcon$4 as BarGuageIcon, SvgIcon$5 as BarIcon, type ChartConfigLike, ChartLegend, type ChartLike, ChartTooltip, ChartTypeButtonGroup, type ChartTypeLike, type ComputeStatsLike, DEFAULT_HIGHLIGHT_KEY, type DashboardExtraLike, type DashboardLike, DashboardRefresh, type DashboardSharingLike, type DashboardVisibilityLike, DataControls, type DataSourceTypeLike, type EChartsHandle, type EChartsOption, EditDashboardDialog, EditGroupDialog, EventsFunctionCategories, EventsFunctionMap, type FunctionDef, FunctionInput, FunctionMap, FunctionsCategories, FunctionsPanel, type GroupLike, type GroupStyleLike, HIGHLIGHT_COLORS, type HighlightColorKey, type HighlightColorMeta, LabelControls, LabelSearchProvider, LabelsInput, type LayoutItemLike, type LayoutsLike, LineControls, SvgIcon$7 as LineIcon, type MarkArea, type MarkLine, MarkerControls, type NoteAlignmentLike, type NoteFontSizeLike, type NoteLike, type NoteVerticalAlignmentLike, type OverlayGraphLike, type PanelLike, PieChart, PieChartControls, type PieChartProps, SvgIcon$3 as PieIcon, type PieSeriesInput, QueryValueChart, type QueryValueChartProps, SvgIcon$2 as QueryValueIcon, ReactEChartsBase, type ReactEChartsProps, RefreshButton, RefreshContext, type ResolvedHighlight, type ResponsiveLayoutsLike, ScatterChartTooltip, ScatterControls, SvgIcon$1 as ScatterIcon, ShareDashboardDialog, type SharingConfigLike, SystemLabels, TableControls, SvgIcon as TableIcon, type TemplateVariableLike, type TemplateViewLike, TimeSeriesChart, type TimeSeriesChartProps, ValueControls, type ValueFormatter, ValueFormatters, ValueOptions, ValueStringMapping, type ViewActionContext, XAxisControls, type YAxisConfigLike, YaxisControls, defaultConfig$5 as defaultBarGaugeConfig, defaultConfig$2 as defaultDataConfig, defaultConfig$6 as defaultPieConfig, defaultConfig$1 as defaultScatterConfig, defaultConfig as defaultTableConfig, defaultConfig$4 as defaultValueConfig, defaultConfig$3 as defaultValueControlsConfig, getDefaultValueConfig, getHighlightHex, isAggrOrRollupFunction, resolveHeaderStyle, resolveHighlight, sentioColors, sentioTheme, sentioThemeDark, sortMetricByName, useLabelSearch, useLabelSearchContext };
|
package/dist/index.js
CHANGED
|
@@ -42,6 +42,7 @@ __export(index_exports, {
|
|
|
42
42
|
ChartTooltip: () => ChartTooltip,
|
|
43
43
|
ChartTypeButtonGroup: () => ChartTypeButtonGroup,
|
|
44
44
|
DEFAULT_HIGHLIGHT_KEY: () => DEFAULT_HIGHLIGHT_KEY,
|
|
45
|
+
DashboardRefresh: () => DashboardRefresh,
|
|
45
46
|
DataControls: () => DataControls,
|
|
46
47
|
EditDashboardDialog: () => EditDashboardDialog,
|
|
47
48
|
EditGroupDialog: () => EditGroupDialog,
|
|
@@ -69,6 +70,7 @@ __export(index_exports, {
|
|
|
69
70
|
ScatterChartTooltip: () => ScatterChartTooltip,
|
|
70
71
|
ScatterControls: () => ScatterControls,
|
|
71
72
|
ScatterIcon: () => ScatterIcon_default,
|
|
73
|
+
ShareDashboardDialog: () => ShareDashboardDialog,
|
|
72
74
|
SystemLabels: () => SystemLabels,
|
|
73
75
|
TableControls: () => TableControls,
|
|
74
76
|
TableIcon: () => TableIcon_default,
|
|
@@ -7160,6 +7162,222 @@ function EditGroupDialog({
|
|
|
7160
7162
|
}
|
|
7161
7163
|
);
|
|
7162
7164
|
}
|
|
7165
|
+
|
|
7166
|
+
// src/dashboard/DashboardRefresh.tsx
|
|
7167
|
+
var import_dayjs6 = __toESM(require("dayjs"));
|
|
7168
|
+
var import_relativeTime = __toESM(require("dayjs/plugin/relativeTime"));
|
|
7169
|
+
var import_updateLocale = __toESM(require("dayjs/plugin/updateLocale"));
|
|
7170
|
+
var import_ui_core30 = require("@sentio/ui-core");
|
|
7171
|
+
var import_react27 = require("react");
|
|
7172
|
+
var import_io2 = require("react-icons/io");
|
|
7173
|
+
var import_en = __toESM(require("dayjs/locale/en"));
|
|
7174
|
+
var import_jsx_runtime42 = require("react/jsx-runtime");
|
|
7175
|
+
import_dayjs6.default.extend(import_relativeTime.default);
|
|
7176
|
+
import_dayjs6.default.extend(import_updateLocale.default);
|
|
7177
|
+
import_dayjs6.default.locale("en.short", {
|
|
7178
|
+
...import_en.default,
|
|
7179
|
+
relativeTime: {
|
|
7180
|
+
// relative time format strings, keep %s %d as the same
|
|
7181
|
+
future: "in %s",
|
|
7182
|
+
past: "%s ago",
|
|
7183
|
+
s: "<1s",
|
|
7184
|
+
m: "1min",
|
|
7185
|
+
mm: "%dmin",
|
|
7186
|
+
h: "1h",
|
|
7187
|
+
hh: "%dh",
|
|
7188
|
+
d: "1d",
|
|
7189
|
+
dd: "%dd",
|
|
7190
|
+
M: "1m",
|
|
7191
|
+
MM: "%dm",
|
|
7192
|
+
y: "1y",
|
|
7193
|
+
yy: "%dy"
|
|
7194
|
+
}
|
|
7195
|
+
});
|
|
7196
|
+
import_dayjs6.default.locale("en");
|
|
7197
|
+
var DashboardRefresh = ({ stats, onRefresh }) => {
|
|
7198
|
+
const timeRef = (0, import_react27.useRef)(null);
|
|
7199
|
+
const [fetching, setFetching] = (0, import_react27.useState)(false);
|
|
7200
|
+
const [currentColor, setCurrentColor] = (0, import_react27.useState)("text-[#4CAF1D] border-[#4CAF1D] border" /* NORMAL */);
|
|
7201
|
+
(0, import_react27.useEffect)(() => {
|
|
7202
|
+
const updateFn = () => {
|
|
7203
|
+
if (!stats || !stats.computedAt) return;
|
|
7204
|
+
const computedAt = (0, import_dayjs6.default)(stats.computedAt).locale("en.short");
|
|
7205
|
+
timeRef.current.textContent = computedAt.fromNow(true);
|
|
7206
|
+
if (computedAt.isBefore((0, import_dayjs6.default)().subtract(1, "hour"))) {
|
|
7207
|
+
setCurrentColor("text-[#D98200] border-[#D98200] border" /* WARNNING */);
|
|
7208
|
+
} else {
|
|
7209
|
+
setCurrentColor("text-[#4CAF1D] border-[#4CAF1D] border" /* NORMAL */);
|
|
7210
|
+
}
|
|
7211
|
+
};
|
|
7212
|
+
updateFn();
|
|
7213
|
+
const interval = setInterval(() => {
|
|
7214
|
+
updateFn();
|
|
7215
|
+
}, 1e3);
|
|
7216
|
+
return () => {
|
|
7217
|
+
clearInterval(interval);
|
|
7218
|
+
};
|
|
7219
|
+
}, [stats]);
|
|
7220
|
+
const onClick = (0, import_react27.useCallback)(() => {
|
|
7221
|
+
setFetching((prevState) => {
|
|
7222
|
+
if (prevState) return prevState;
|
|
7223
|
+
onRefresh().finally(() => {
|
|
7224
|
+
setFetching(false);
|
|
7225
|
+
});
|
|
7226
|
+
return true;
|
|
7227
|
+
});
|
|
7228
|
+
}, [onRefresh]);
|
|
7229
|
+
(0, import_react27.useEffect)(() => {
|
|
7230
|
+
if (typeof window == "object") {
|
|
7231
|
+
window.addEventListener("refresh_all", onClick);
|
|
7232
|
+
return () => {
|
|
7233
|
+
window.removeEventListener("refresh_all", onClick);
|
|
7234
|
+
};
|
|
7235
|
+
}
|
|
7236
|
+
}, []);
|
|
7237
|
+
const showReload = fetching || stats?.isRefreshing;
|
|
7238
|
+
return /* @__PURE__ */ (0, import_jsx_runtime42.jsxs)(
|
|
7239
|
+
"div",
|
|
7240
|
+
{
|
|
7241
|
+
className: (0, import_ui_core30.classNames)(
|
|
7242
|
+
"group/refresh relative ml-1 flex items-center gap-1 rounded-sm py-px pl-1 text-xs transition-all",
|
|
7243
|
+
currentColor,
|
|
7244
|
+
showReload ? "pr-5" : "pr-1.5 hover:pr-5"
|
|
7245
|
+
),
|
|
7246
|
+
children: [
|
|
7247
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)("span", { className: "cursor-default text-[10px]", ref: timeRef }),
|
|
7248
|
+
/* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7249
|
+
"button",
|
|
7250
|
+
{
|
|
7251
|
+
onClick,
|
|
7252
|
+
className: (0, import_ui_core30.classNames)(
|
|
7253
|
+
"absolute right-1",
|
|
7254
|
+
showReload ? "block" : "hidden group-hover/refresh:block"
|
|
7255
|
+
),
|
|
7256
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime42.jsx)(
|
|
7257
|
+
import_io2.IoMdRefresh,
|
|
7258
|
+
{
|
|
7259
|
+
className: (0, import_ui_core30.classNames)(
|
|
7260
|
+
"h-3.5 w-3.5",
|
|
7261
|
+
showReload ? "animate-spin" : ""
|
|
7262
|
+
)
|
|
7263
|
+
}
|
|
7264
|
+
)
|
|
7265
|
+
}
|
|
7266
|
+
)
|
|
7267
|
+
]
|
|
7268
|
+
}
|
|
7269
|
+
);
|
|
7270
|
+
};
|
|
7271
|
+
|
|
7272
|
+
// src/dashboard/ShareDashboardDialog.tsx
|
|
7273
|
+
var import_react28 = require("react");
|
|
7274
|
+
var import_ui_core31 = require("@sentio/ui-core");
|
|
7275
|
+
var import_jsx_runtime43 = require("react/jsx-runtime");
|
|
7276
|
+
var ShareDashboardDialog = ({
|
|
7277
|
+
open,
|
|
7278
|
+
initData,
|
|
7279
|
+
onUnshare,
|
|
7280
|
+
onClose,
|
|
7281
|
+
onConfigChange,
|
|
7282
|
+
startTime,
|
|
7283
|
+
endTime,
|
|
7284
|
+
tz
|
|
7285
|
+
}) => {
|
|
7286
|
+
const [isReadonly, setIsReadonly] = (0, import_react28.useState)(
|
|
7287
|
+
initData?.config?.isReadonly ?? false
|
|
7288
|
+
);
|
|
7289
|
+
const [hideModifiers, setHideModifiers] = (0, import_react28.useState)(
|
|
7290
|
+
initData?.config?.hideModifiers ?? false
|
|
7291
|
+
);
|
|
7292
|
+
const linkText = (0, import_react28.useMemo)(() => {
|
|
7293
|
+
if (initData?.id) {
|
|
7294
|
+
let timeSuffix = startTime && endTime ? `?from=${encodeURIComponent((0, import_ui_core31.dateTimeToString)(startTime))}&to=${encodeURIComponent((0, import_ui_core31.dateTimeToString)(endTime))}&tz=${tz}` : "";
|
|
7295
|
+
if (tz) {
|
|
7296
|
+
timeSuffix += `&tz=${tz}`;
|
|
7297
|
+
}
|
|
7298
|
+
return `${location.origin}/share/${initData?.id}${timeSuffix}`;
|
|
7299
|
+
}
|
|
7300
|
+
return "";
|
|
7301
|
+
}, [initData?.id, startTime, endTime]);
|
|
7302
|
+
const handleConfigChange = (newIsReadonly, newHideModifiers) => {
|
|
7303
|
+
const config = {
|
|
7304
|
+
isReadonly: newIsReadonly,
|
|
7305
|
+
hideModifiers: newHideModifiers
|
|
7306
|
+
};
|
|
7307
|
+
onConfigChange?.(config);
|
|
7308
|
+
};
|
|
7309
|
+
const handleReadonlyChange = (checked) => {
|
|
7310
|
+
setIsReadonly(checked);
|
|
7311
|
+
handleConfigChange(checked, hideModifiers);
|
|
7312
|
+
};
|
|
7313
|
+
const handleHideModifiersChange = (checked) => {
|
|
7314
|
+
setHideModifiers(checked);
|
|
7315
|
+
handleConfigChange(isReadonly, checked);
|
|
7316
|
+
};
|
|
7317
|
+
return /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7318
|
+
import_ui_core31.BaseDialog,
|
|
7319
|
+
{
|
|
7320
|
+
title: "Sharing: ON",
|
|
7321
|
+
open,
|
|
7322
|
+
onCancel: () => {
|
|
7323
|
+
onUnshare?.();
|
|
7324
|
+
onClose();
|
|
7325
|
+
},
|
|
7326
|
+
cancelText: "Revoke URL",
|
|
7327
|
+
cancelProps: {
|
|
7328
|
+
status: "danger"
|
|
7329
|
+
},
|
|
7330
|
+
okText: "Done",
|
|
7331
|
+
onOk: () => {
|
|
7332
|
+
onClose();
|
|
7333
|
+
},
|
|
7334
|
+
onClose,
|
|
7335
|
+
buttonsClassName: "justify-between",
|
|
7336
|
+
footerBorder: false,
|
|
7337
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "mx-4 my-4", children: [
|
|
7338
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "flex overflow-hidden rounded-md border pl-3", children: [
|
|
7339
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("span", { className: "text-ilabel font-ilabel text-text-foreground flex-1 grow truncate leading-8", children: linkText }),
|
|
7340
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "group cursor-pointer border-l bg-gray-200 px-2 py-1 hover:bg-gray-100", children: /* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7341
|
+
import_ui_core31.CopyButton,
|
|
7342
|
+
{
|
|
7343
|
+
text: linkText,
|
|
7344
|
+
size: 18,
|
|
7345
|
+
className: "text-text-foreground group-hover:text-primary h-4 w-4 align-middle"
|
|
7346
|
+
}
|
|
7347
|
+
) })
|
|
7348
|
+
] }),
|
|
7349
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "text-text-foreground-secondary mt-2 text-[11px]", children: "Anyone with the link can access this dashboard. You can revoke the link at any time." }),
|
|
7350
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "mt-4 space-y-3 border-t pt-4", children: [
|
|
7351
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "text-text-foreground text-sm font-medium", children: "Access Settings" }),
|
|
7352
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { className: "space-y-4", children: [
|
|
7353
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { children: [
|
|
7354
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7355
|
+
import_ui_core31.Checkbox,
|
|
7356
|
+
{
|
|
7357
|
+
checked: isReadonly,
|
|
7358
|
+
onChange: handleReadonlyChange,
|
|
7359
|
+
label: "Panel read-only access"
|
|
7360
|
+
}
|
|
7361
|
+
),
|
|
7362
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "text-text-foreground-secondary ml-6 text-xs", children: "Viewers can only view the dashboard without entering panel edit mode or copy configuration." })
|
|
7363
|
+
] }),
|
|
7364
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsxs)("div", { children: [
|
|
7365
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)(
|
|
7366
|
+
import_ui_core31.Checkbox,
|
|
7367
|
+
{
|
|
7368
|
+
checked: hideModifiers,
|
|
7369
|
+
onChange: handleHideModifiersChange,
|
|
7370
|
+
label: "Hide controls"
|
|
7371
|
+
}
|
|
7372
|
+
),
|
|
7373
|
+
/* @__PURE__ */ (0, import_jsx_runtime43.jsx)("div", { className: "text-text-foreground-secondary ml-6 text-xs", children: "Hide panel creator and modifier for viewers" })
|
|
7374
|
+
] })
|
|
7375
|
+
] })
|
|
7376
|
+
] })
|
|
7377
|
+
] })
|
|
7378
|
+
}
|
|
7379
|
+
);
|
|
7380
|
+
};
|
|
7163
7381
|
// Annotate the CommonJS export names for ESM import in node:
|
|
7164
7382
|
0 && (module.exports = {
|
|
7165
7383
|
AggregateInput,
|
|
@@ -7174,6 +7392,7 @@ function EditGroupDialog({
|
|
|
7174
7392
|
ChartTooltip,
|
|
7175
7393
|
ChartTypeButtonGroup,
|
|
7176
7394
|
DEFAULT_HIGHLIGHT_KEY,
|
|
7395
|
+
DashboardRefresh,
|
|
7177
7396
|
DataControls,
|
|
7178
7397
|
EditDashboardDialog,
|
|
7179
7398
|
EditGroupDialog,
|
|
@@ -7201,6 +7420,7 @@ function EditGroupDialog({
|
|
|
7201
7420
|
ScatterChartTooltip,
|
|
7202
7421
|
ScatterControls,
|
|
7203
7422
|
ScatterIcon,
|
|
7423
|
+
ShareDashboardDialog,
|
|
7204
7424
|
SystemLabels,
|
|
7205
7425
|
TableControls,
|
|
7206
7426
|
TableIcon,
|