You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
72 lines
1.6 KiB
72 lines
1.6 KiB
import { mapState, mapActions, commit } from 'vuex'
|
|
import store from '@/store/index'
|
|
import axios from 'axios'
|
|
|
|
export default {
|
|
namespaced: true,
|
|
state: {
|
|
llo: {},
|
|
socketid:''
|
|
},
|
|
getters: {
|
|
getllosrc (state, container) {
|
|
//console.log("js1 get "+JSON.stringify(state.llo))
|
|
return state.llo
|
|
},
|
|
getsocketid (state, container) {
|
|
//console.log("js1 get "+JSON.stringify(state.llo))
|
|
return state.socketid
|
|
}
|
|
},
|
|
mutations: {
|
|
setllo (state, data) {
|
|
//console.log("js1 set "+JSON.stringify(data))
|
|
state.llo=data;
|
|
},
|
|
setsocketid (state, data) {
|
|
//console.log("js1 set "+JSON.stringify(data))
|
|
state.socketid = data;
|
|
}
|
|
},
|
|
actions: {
|
|
async get_data({commit,rootGetters}, value) {
|
|
try {
|
|
|
|
let p = await axios.get("http://localhost:8084/run", {
|
|
timeout: 45000,
|
|
params: {
|
|
code: value.code
|
|
}
|
|
});
|
|
|
|
//var p = value.code
|
|
console.log("paramp "+JSON.stringify(p))
|
|
store.dispatch('pipelineLLO/setScriptllo', p)
|
|
return p;
|
|
|
|
} catch (e) {
|
|
if(e.error == "invalid_token"){
|
|
window.location.href = 'https://api-login.swarmlab.io:8089';
|
|
}else{
|
|
var R = {
|
|
ERROR_str: e,
|
|
ERROR: 'yes'
|
|
}
|
|
return R;
|
|
}
|
|
}
|
|
},
|
|
setScriptllo({commit}, value) {
|
|
//console.log("container "+value)
|
|
commit('setllo', value)
|
|
},
|
|
setsocketllo({commit}, value) {
|
|
//console.log("container "+value)
|
|
commit('setsocketid', value)
|
|
},
|
|
setScriptCodlogAction({commit}, value) {
|
|
//console.log("container "+value)
|
|
commit('setScriptCodelog', value)
|
|
}
|
|
}
|
|
}
|
|
|