-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): add missing filter options for metrics (#6409)
- Loading branch information
1 parent
854d43c
commit d613034
Showing
4 changed files
with
102 additions
and
65 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import {useI18n} from "vue-i18n"; | ||
|
||
import State from "../../utils/state.js"; | ||
|
||
export function useValues(label?: string) { | ||
const {t} = useI18n({useScope: "global"}); | ||
|
||
const VALUES = { | ||
SCOPE: [ | ||
{label: t("scope_filter.user", {label}), value: "USER"}, | ||
{label: t("scope_filter.system", {label}), value: "SYSTEM"}, | ||
], | ||
CHILD: [ | ||
{label: t("trigger filter.options.ALL"), value: "ALL"}, | ||
{label: t("trigger filter.options.CHILD"), value: "CHILD"}, | ||
{label: t("trigger filter.options.MAIN"), value: "MAIN"}, | ||
], | ||
LEVEL: ["TRACE", "DEBUG", "INFO", "WARN", "ERROR"].map((value) => ({ | ||
label: value, | ||
value, | ||
})), | ||
RELATIVE_DATE: [ | ||
{label: t("datepicker.last5minutes"), value: "PT5M"}, | ||
{label: t("datepicker.last15minutes"), value: "PT15M"}, | ||
{label: t("datepicker.last1hour"), value: "PT1H"}, | ||
{label: t("datepicker.last12hours"), value: "PT12H"}, | ||
{label: t("datepicker.last24hours"), value: "PT24H"}, | ||
{label: t("datepicker.last48hours"), value: "PT48H"}, | ||
{label: t("datepicker.last7days"), value: "PT168H"}, | ||
{label: t("datepicker.last30days"), value: "PT720H"}, | ||
{label: t("datepicker.last365days"), value: "PT8760H"}, | ||
], | ||
EXECUTION_STATE: State.arrayAllStates().map( | ||
(state: { name: string }) => ({ | ||
label: state.name, | ||
value: state.name, | ||
}), | ||
), | ||
AGGREGATION: ["sum", "avg", "min", "max"].map((value) => ({ | ||
label: value, | ||
value, | ||
})), | ||
}; | ||
|
||
return {VALUES}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters