Skip to content

Commit

Permalink
fix(ui): properly parse date parameters from url and pass on the endp…
Browse files Browse the repository at this point in the history
…oints (#6200)
  • Loading branch information
MilosPaunovic authored Nov 29, 2024
1 parent 6fa7eeb commit a5328b2
Showing 1 changed file with 25 additions and 10 deletions.
35 changes: 25 additions & 10 deletions ui/src/components/dashboard/Dashboard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
'scope',
'relative_date',
'absolute_date',
]"
]
"
:refresh="{
shown: true,
callback: custom.shown ? refreshCustom : fetchAll,
Expand Down Expand Up @@ -229,7 +230,7 @@
import {useStore} from "vuex";
import {useI18n} from "vue-i18n";
// import moment from "moment";
import moment from "moment";
import {apiUrl} from "override/utils/route";
import State from "../../utils/state";
Expand Down Expand Up @@ -499,6 +500,20 @@
// route.query.endDate = moment().toISOString(true);
// }
route.query.startDate = route.query.timeRange
? moment()
.subtract(
moment.duration(route.query.timeRange).as("milliseconds"),
)
.toISOString(true)
: route.query.startDate ||
moment()
.subtract(moment.duration("PT720H").as("milliseconds"))
.toISOString(true);
route.query.endDate = route.query.timeRange
? moment().toISOString(true)
: route.query.endDate || moment().toISOString(true);
try {
await Promise.any([
fetchNumbers(),
Expand All @@ -525,15 +540,15 @@
router.replace({query: {...route.query, flowId: props.flowID}});
}
// if (!route.query.namespace && props.restoreURL) {
// router.replace({query: {...route.query, namespace: defaultNamespace}});
// filters.value.namespace = route.query.namespace || defaultNamespace;
// }
// else {
// filters.value.namespace = null
// }
// if (!route.query.namespace && props.restoreURL) {
// router.replace({query: {...route.query, namespace: defaultNamespace}});
// filters.value.namespace = route.query.namespace || defaultNamespace;
// }
// else {
// filters.value.namespace = null
// }
// updateParams(route.query);
// updateParams(route.query);
});
watch(
Expand Down

0 comments on commit a5328b2

Please sign in to comment.