mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-07-29 20:32:03 +08:00

* feat: update the SideNav component * feat: add the Trace Explorer page with Query Builder * chore: build is fixed * chore: tsc build is fixed * chore: menu items is updated --------- Co-authored-by: Nazarenko19 <danil.nazarenko2000@gmail.com> Co-authored-by: Palash Gupta <palashgdev@gmail.com>
33 lines
804 B
TypeScript
33 lines
804 B
TypeScript
import getStartEndRangeTime from 'lib/getStartEndRangeTime';
|
|
import store from 'store';
|
|
|
|
export const getDashboardVariables = (): Record<string, unknown> => {
|
|
try {
|
|
const {
|
|
globalTime,
|
|
dashboards: { dashboards },
|
|
} = store.getState();
|
|
const [selectedDashboard] = dashboards;
|
|
const {
|
|
data: { variables = {} },
|
|
} = selectedDashboard;
|
|
|
|
const { start, end } = getStartEndRangeTime({
|
|
type: 'GLOBAL_TIME',
|
|
interval: globalTime.selectedTime,
|
|
});
|
|
|
|
const variablesTuple: Record<string, unknown> = {
|
|
SIGNOZ_START_TIME: parseInt(start, 10) * 1e3,
|
|
SIGNOZ_END_TIME: parseInt(end, 10) * 1e3,
|
|
};
|
|
Object.keys(variables).forEach((key) => {
|
|
variablesTuple[key] = variables[key].selectedValue;
|
|
});
|
|
return variablesTuple;
|
|
} catch (e) {
|
|
console.error(e);
|
|
}
|
|
return {};
|
|
};
|