File tree Expand file tree Collapse file tree 8 files changed +32
-24
lines changed
portal-ui/src/screens/Console/Dashboard/Prometheus/Widgets Expand file tree Collapse file tree 8 files changed +32
-24
lines changed Original file line number Diff line number Diff line change @@ -116,7 +116,8 @@ const BarChartWidget = ({
116
116
if ( loading ) {
117
117
let stepCalc = 0 ;
118
118
if ( timeStart !== null && timeEnd !== null ) {
119
- const secondsInPeriod = timeEnd . unix ( ) - timeStart . unix ( ) ;
119
+ const secondsInPeriod =
120
+ timeEnd . toUnixInteger ( ) - timeStart . toUnixInteger ( ) ;
120
121
const periods = Math . floor ( secondsInPeriod / 60 ) ;
121
122
122
123
stepCalc = periods < 1 ? 15 : periods ;
@@ -128,9 +129,9 @@ const BarChartWidget = ({
128
129
`/api/v1/${ apiPrefix } /info/widgets/${
129
130
panelItem . id
130
131
} /?step=${ stepCalc } &${
131
- timeStart !== null ? `&start=${ timeStart . unix ( ) } ` : ""
132
+ timeStart !== null ? `&start=${ timeStart . toUnixInteger ( ) } ` : ""
132
133
} ${ timeStart !== null && timeEnd !== null ? "&" : "" } ${
133
- timeEnd !== null ? `end=${ timeEnd . unix ( ) } ` : ""
134
+ timeEnd !== null ? `end=${ timeEnd . toUnixInteger ( ) } ` : ""
134
135
} `
135
136
)
136
137
. then ( ( res : any ) => {
Original file line number Diff line number Diff line change @@ -65,7 +65,8 @@ const CapacityItem = ({
65
65
if ( loading ) {
66
66
let stepCalc = 0 ;
67
67
if ( timeStart !== null && timeEnd !== null ) {
68
- const secondsInPeriod = timeEnd . unix ( ) - timeStart . unix ( ) ;
68
+ const secondsInPeriod =
69
+ timeEnd . toUnixInteger ( ) - timeStart . toUnixInteger ( ) ;
69
70
const periods = Math . floor ( secondsInPeriod / 60 ) ;
70
71
71
72
stepCalc = periods < 1 ? 15 : periods ;
@@ -75,9 +76,9 @@ const CapacityItem = ({
75
76
. invoke (
76
77
"GET" ,
77
78
`/api/v1/${ apiPrefix } /info/widgets/${ value . id } /?step=${ stepCalc } &${
78
- timeStart !== null ? `&start=${ timeStart . unix ( ) } ` : ""
79
+ timeStart !== null ? `&start=${ timeStart . toUnixInteger ( ) } ` : ""
79
80
} ${ timeStart !== null && timeEnd !== null ? "&" : "" } ${
80
- timeEnd !== null ? `end=${ timeEnd . unix ( ) } ` : ""
81
+ timeEnd !== null ? `end=${ timeEnd . toUnixInteger ( ) } ` : ""
81
82
} `
82
83
)
83
84
. then ( ( res : any ) => {
Original file line number Diff line number Diff line change @@ -56,7 +56,8 @@ const EntityStateStatItem = ({
56
56
if ( loading ) {
57
57
let stepCalc = 0 ;
58
58
if ( timeStart !== null && timeEnd !== null ) {
59
- const secondsInPeriod = timeEnd . unix ( ) - timeStart . unix ( ) ;
59
+ const secondsInPeriod =
60
+ timeEnd . toUnixInteger ( ) - timeStart . toUnixInteger ( ) ;
60
61
const periods = Math . floor ( secondsInPeriod / 60 ) ;
61
62
62
63
stepCalc = periods < 1 ? 15 : periods ;
@@ -68,9 +69,9 @@ const EntityStateStatItem = ({
68
69
`/api/v1/${ apiPrefix } /info/widgets/${
69
70
panelItem . id
70
71
} /?step=${ stepCalc } &${
71
- timeStart !== null ? `&start=${ timeStart . unix ( ) } ` : ""
72
+ timeStart !== null ? `&start=${ timeStart . toUnixInteger ( ) } ` : ""
72
73
} ${ timeStart !== null && timeEnd !== null ? "&" : "" } ${
73
- timeEnd !== null ? `end=${ timeEnd . unix ( ) } ` : ""
74
+ timeEnd !== null ? `end=${ timeEnd . toUnixInteger ( ) } ` : ""
74
75
} `
75
76
)
76
77
. then ( ( res : any ) => {
Original file line number Diff line number Diff line change @@ -127,7 +127,8 @@ const LinearGraphWidget = ({
127
127
if ( loading ) {
128
128
let stepCalc = 0 ;
129
129
if ( timeStart !== null && timeEnd !== null ) {
130
- const secondsInPeriod = timeEnd . unix ( ) - timeStart . unix ( ) ;
130
+ const secondsInPeriod =
131
+ timeEnd . toUnixInteger ( ) - timeStart . toUnixInteger ( ) ;
131
132
const periods = Math . floor ( secondsInPeriod / 60 ) ;
132
133
133
134
stepCalc = periods < 1 ? 15 : periods ;
@@ -139,9 +140,9 @@ const LinearGraphWidget = ({
139
140
`/api/v1/${ apiPrefix } /info/widgets/${
140
141
panelItem . id
141
142
} /?step=${ stepCalc } &${
142
- timeStart !== null ? `&start=${ timeStart . unix ( ) } ` : ""
143
+ timeStart !== null ? `&start=${ timeStart . toUnixInteger ( ) } ` : ""
143
144
} ${ timeStart !== null && timeEnd !== null ? "&" : "" } ${
144
- timeEnd !== null ? `end=${ timeEnd . unix ( ) } ` : ""
145
+ timeEnd !== null ? `end=${ timeEnd . toUnixInteger ( ) } ` : ""
145
146
} `
146
147
)
147
148
. then ( ( res : any ) => {
Original file line number Diff line number Diff line change @@ -96,7 +96,8 @@ const PieChartWidget = ({
96
96
if ( loading ) {
97
97
let stepCalc = 0 ;
98
98
if ( timeStart !== null && timeEnd !== null ) {
99
- const secondsInPeriod = timeEnd . unix ( ) - timeStart . unix ( ) ;
99
+ const secondsInPeriod =
100
+ timeEnd . toUnixInteger ( ) - timeStart . toUnixInteger ( ) ;
100
101
const periods = Math . floor ( secondsInPeriod / 60 ) ;
101
102
102
103
stepCalc = periods < 1 ? 15 : periods ;
@@ -108,9 +109,9 @@ const PieChartWidget = ({
108
109
`/api/v1/${ apiPrefix } /info/widgets/${
109
110
panelItem . id
110
111
} /?step=${ stepCalc } &${
111
- timeStart !== null ? `&start=${ timeStart . unix ( ) } ` : ""
112
+ timeStart !== null ? `&start=${ timeStart . toUnixInteger ( ) } ` : ""
112
113
} ${ timeStart !== null && timeEnd !== null ? "&" : "" } ${
113
- timeEnd !== null ? `end=${ timeEnd . unix ( ) } ` : ""
114
+ timeEnd !== null ? `end=${ timeEnd . toUnixInteger ( ) } ` : ""
114
115
} `
115
116
)
116
117
. then ( ( res : any ) => {
Original file line number Diff line number Diff line change @@ -90,7 +90,8 @@ const SimpleWidget = ({
90
90
if ( loading ) {
91
91
let stepCalc = 0 ;
92
92
if ( timeStart !== null && timeEnd !== null ) {
93
- const secondsInPeriod = timeEnd . unix ( ) - timeStart . unix ( ) ;
93
+ const secondsInPeriod =
94
+ timeEnd . toUnixInteger ( ) - timeStart . toUnixInteger ( ) ;
94
95
const periods = Math . floor ( secondsInPeriod / 60 ) ;
95
96
96
97
stepCalc = periods < 1 ? 15 : periods ;
@@ -102,9 +103,9 @@ const SimpleWidget = ({
102
103
`/api/v1/${ apiPrefix } /info/widgets/${
103
104
panelItem . id
104
105
} /?step=${ stepCalc } &${
105
- timeStart !== null ? `&start=${ timeStart . unix ( ) } ` : ""
106
+ timeStart !== null ? `&start=${ timeStart . toUnixInteger ( ) } ` : ""
106
107
} ${ timeStart !== null && timeEnd !== null ? "&" : "" } ${
107
- timeEnd !== null ? `end=${ timeEnd . unix ( ) } ` : ""
108
+ timeEnd !== null ? `end=${ timeEnd . toUnixInteger ( ) } ` : ""
108
109
} `
109
110
)
110
111
. then ( ( res : any ) => {
Original file line number Diff line number Diff line change @@ -63,7 +63,8 @@ const SingleRepWidget = ({
63
63
if ( loading ) {
64
64
let stepCalc = 0 ;
65
65
if ( timeStart !== null && timeEnd !== null ) {
66
- const secondsInPeriod = timeEnd . unix ( ) - timeStart . unix ( ) ;
66
+ const secondsInPeriod =
67
+ timeEnd . toUnixInteger ( ) - timeStart . toUnixInteger ( ) ;
67
68
const periods = Math . floor ( secondsInPeriod / 60 ) ;
68
69
69
70
stepCalc = periods < 1 ? 15 : periods ;
@@ -75,9 +76,9 @@ const SingleRepWidget = ({
75
76
`/api/v1/${ apiPrefix } /info/widgets/${
76
77
panelItem . id
77
78
} /?step=${ stepCalc } &${
78
- timeStart !== null ? `&start=${ timeStart . unix ( ) } ` : ""
79
+ timeStart !== null ? `&start=${ timeStart . toUnixInteger ( ) } ` : ""
79
80
} ${ timeStart !== null && timeEnd !== null ? "&" : "" } ${
80
- timeEnd !== null ? `end=${ timeEnd . unix ( ) } ` : ""
81
+ timeEnd !== null ? `end=${ timeEnd . toUnixInteger ( ) } ` : ""
81
82
} `
82
83
)
83
84
. then ( ( res : any ) => {
Original file line number Diff line number Diff line change @@ -96,7 +96,8 @@ const SingleValueWidget = ({
96
96
if ( loading ) {
97
97
let stepCalc = 0 ;
98
98
if ( timeStart !== null && timeEnd !== null ) {
99
- const secondsInPeriod = timeEnd . unix ( ) - timeStart . unix ( ) ;
99
+ const secondsInPeriod =
100
+ timeEnd . toUnixInteger ( ) - timeStart . toUnixInteger ( ) ;
100
101
const periods = Math . floor ( secondsInPeriod / 60 ) ;
101
102
102
103
stepCalc = periods < 1 ? 15 : periods ;
@@ -108,9 +109,9 @@ const SingleValueWidget = ({
108
109
`/api/v1/${ apiPrefix } /info/widgets/${
109
110
panelItem . id
110
111
} /?step=${ stepCalc } &${
111
- timeStart !== null ? `&start=${ timeStart . unix ( ) } ` : ""
112
+ timeStart !== null ? `&start=${ timeStart . toUnixInteger ( ) } ` : ""
112
113
} ${ timeStart !== null && timeEnd !== null ? "&" : "" } ${
113
- timeEnd !== null ? `end=${ timeEnd . unix ( ) } ` : ""
114
+ timeEnd !== null ? `end=${ timeEnd . toUnixInteger ( ) } ` : ""
114
115
} `
115
116
)
116
117
. then ( ( res : any ) => {
You can’t perform that action at this time.
0 commit comments