2020-04-08 14:13:33 +05:30
|
|
|
import { convertToFixedRange } from '~/lib/utils/datetime_range';
|
2021-03-11 19:13:27 +05:30
|
|
|
import { timeRanges, defaultTimeRange } from '~/vue_shared/constants';
|
2020-04-08 14:13:33 +05:30
|
|
|
|
|
|
|
export default () => ({
|
|
|
|
/**
|
|
|
|
* Full text search
|
|
|
|
*/
|
|
|
|
search: '',
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Time range (Show last)
|
|
|
|
*/
|
|
|
|
timeRange: {
|
|
|
|
options: timeRanges,
|
|
|
|
// Selected time range, can be fixed or relative
|
|
|
|
selected: defaultTimeRange,
|
|
|
|
// Current time range, must be fixed
|
|
|
|
current: convertToFixedRange(defaultTimeRange),
|
2020-04-22 19:07:51 +05:30
|
|
|
|
|
|
|
invalidWarning: false,
|
2020-04-08 14:13:33 +05:30
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Environments list information
|
|
|
|
*/
|
|
|
|
environments: {
|
|
|
|
options: [],
|
|
|
|
isLoading: false,
|
|
|
|
current: null,
|
2020-04-22 19:07:51 +05:30
|
|
|
fetchError: false,
|
2020-04-08 14:13:33 +05:30
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
2021-11-18 22:05:49 +05:30
|
|
|
* Jobs with logs
|
2020-04-08 14:13:33 +05:30
|
|
|
*/
|
|
|
|
logs: {
|
|
|
|
lines: [],
|
|
|
|
isLoading: false,
|
|
|
|
/**
|
|
|
|
* Logs `cursor` represents the current pagination position,
|
|
|
|
* Should be sent in next batch (page) of logs to be fetched
|
|
|
|
*/
|
|
|
|
cursor: null,
|
|
|
|
isComplete: false,
|
2020-04-22 19:07:51 +05:30
|
|
|
|
|
|
|
fetchError: false,
|
2020-04-08 14:13:33 +05:30
|
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Pods list information
|
|
|
|
*/
|
|
|
|
pods: {
|
|
|
|
options: [],
|
|
|
|
current: null,
|
|
|
|
},
|
|
|
|
});
|