debian-mirror-gitlab/app/assets/javascripts/serverless/store/mutations.js

50 lines
1.4 KiB
JavaScript
Raw Normal View History

2019-07-07 11:18:12 +05:30
import * as types from './mutation_types';
export default {
[types.REQUEST_FUNCTIONS_LOADING](state) {
state.isLoading = true;
},
[types.RECEIVE_FUNCTIONS_SUCCESS](state, data) {
2019-09-04 21:01:54 +05:30
state.functions = data.functions;
state.installed = data.knative_installed;
2019-07-07 11:18:12 +05:30
state.isLoading = false;
state.hasFunctionData = true;
},
2019-09-04 21:01:54 +05:30
[types.RECEIVE_FUNCTIONS_PARTIAL](state, data) {
state.functions = data.functions;
state.installed = true;
state.isLoading = true;
state.hasFunctionData = true;
},
[types.RECEIVE_FUNCTIONS_TIMEOUT](state) {
state.isLoading = false;
},
[types.RECEIVE_FUNCTIONS_NODATA_SUCCESS](state, data) {
2019-07-07 11:18:12 +05:30
state.isLoading = false;
2019-09-04 21:01:54 +05:30
state.installed = data.knative_installed;
2019-07-07 11:18:12 +05:30
state.hasFunctionData = false;
},
[types.RECEIVE_FUNCTIONS_ERROR](state, error) {
state.error = error;
state.hasFunctionData = false;
state.isLoading = false;
},
[types.RECEIVE_METRICS_SUCCESS](state, data) {
state.isLoading = false;
state.hasPrometheusData = true;
state.graphData = data;
},
[types.RECEIVE_METRICS_NODATA_SUCCESS](state) {
state.isLoading = false;
state.hasPrometheusData = false;
},
[types.RECEIVE_METRICS_ERROR](state, error) {
state.hasPrometheusData = false;
state.error = error;
},
[types.RECEIVE_METRICS_NO_PROMETHEUS](state) {
state.hasPrometheusData = false;
state.hasPrometheus = false;
},
};