MCPcopy Index your code
hub / github.com/bugy/script-server / selectExecution

Function selectExecution

web-src/src/common/store/executions-module.js:27–57  ·  view source on GitHub ↗
({commit, state}, executionId)

Source from the content-addressed store, hash-verified

25 },
26
27 selectExecution({commit, state}, executionId) {
28 if (isEmptyString(executionId)) {
29 commit('SET_EXECUTION_DETAILS', {id: executionId, execution: null});
30 commit('SET_DETAILS_LOADING', false);
31 return;
32 }
33
34 let execution = findById(state.executions, executionId);
35 if (isNull(execution)) {
36 execution = {
37 id: executionId,
38 user: 'Unknown',
39 script: 'Unknown'
40 };
41 }
42 commit('SET_EXECUTION_DETAILS', {id: executionId, execution});
43 commit('SET_DETAILS_LOADING', true);
44
45 axiosInstance.get('history/execution_log/long/' + executionId).then(({data: incomingLog}) => {
46 if (executionId !== state.selectedExecutionId) {
47 return;
48 }
49
50 const executionLog = translateExecutionLog(incomingLog);
51
52 commit('SET_EXECUTION_DETAILS', {id: executionId, execution: executionLog});
53 commit('SET_DETAILS_LOADING', false);
54 }).catch((error) => {
55 logError(error);
56 });
57 }
58 },
59 mutations: {
60 SET_LOADING(state, loading) {

Callers

nothing calls this directly

Calls 6

isEmptyStringFunction · 0.90
isNullFunction · 0.90
logErrorFunction · 0.90
findByIdFunction · 0.85
translateExecutionLogFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected