| 1 |
import Vue from 'vue' |
| 2 |
import _ from 'lodash' |
| 3 |
import defaultTranslations from './strings' |
| 4 |
|
| 5 |
export default { |
| 6 |
defineApi (state, api) { |
| 7 |
state.api = api |
| 8 |
}, |
| 9 |
defineNonce (state, value) { |
| 10 |
Vue.set(state.api, 'nonce', value) |
| 11 |
}, |
| 12 |
defineRequestProtocol (state, value) { |
| 13 |
state.requestProtocol = value |
| 14 |
}, |
| 15 |
defineTranslations (state, translations) { |
| 16 |
let strings = _.isEmpty(translations) ? defaultTranslations : translations |
| 17 |
state.translations = strings |
| 18 |
}, |
| 19 |
defineUsername (state, value) { |
| 20 |
state.username = value |
| 21 |
}, |
| 22 |
definePassword (state, password) { |
| 23 |
state.password = password |
| 24 |
}, |
| 25 |
defineCaseUrl (state, value) { |
| 26 |
if (!state.activeCase) { |
| 27 |
return |
| 28 |
} |
| 29 |
Vue.set(state.activeCase, 'url', value) |
| 30 |
}, |
| 31 |
defineRequired (state, list) { |
| 32 |
if (!state.activeCase) { |
| 33 |
return |
| 34 |
} |
| 35 |
Vue.set(state.activeCase, 'required_plugins', list) |
| 36 |
}, |
| 37 |
defineCase (state, value) { |
| 38 |
state.activeCase = value |
| 39 |
}, |
| 40 |
defineUserId (state, value) { |
| 41 |
state.user_id = value |
| 42 |
}, |
| 43 |
removeImage (state, pluginKey) { |
| 44 |
Vue.set(state.activeCase.all_suspects[pluginKey], 'icon', null) |
| 45 |
}, |
| 46 |
deactivatePlugin (state, pluginKey) { |
| 47 |
Vue.set(state.activeCase.all_suspects[pluginKey], 'deactivated', true) |
| 48 |
} |
| 49 |
} |
| 50 |
|