PluginProbe
Plugin Detective – Troubleshooting Conflicts / 1.1.4
Plugin Detective – Troubleshooting Conflicts v1.1.4
1.2.35 1.2.33 1.2.32 1.2.31 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.1.6 1.1.7 1.1.8 1.1.9 1.2 1.2.1 1.2.10 1.2.12 1.2.13 1.2.14 1.2.16 1.2.19 1.2.20 1.2.22 1.2.23 1.2.24 All 54 releases
plugin-detective / troubleshoot / app / src / store / getters.js

getters.js in Plugin Detective – Troubleshooting Conflicts 1.1.4, at troubleshoot/app/src/store/getters.js

82 lines 2.3 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 export default {
2 interrogatingCount (state) {
3 if (!state.activeCase) {
4 return 0
5 }
6 if (!state.activeCase.suspects_under_interrogation) {
7 return 0
8 }
9 return state.activeCase.suspects_under_interrogation.length
10 },
11 clearedCount (state) {
12 if (!state.activeCase) {
13 return 0
14 }
15 if (!state.activeCase.cleared_suspects) {
16 return 0
17 }
18 return state.activeCase.cleared_suspects.length
19 },
20 remainingCount (state, getters) {
21 return getters.holdingCell.length
22 },
23 notHolding (state) {
24 if (!state.activeCase) {
25 return []
26 }
27 if (!state.activeCase.cleared_suspects) {
28 return []
29 }
30 if (!state.activeCase.suspects_under_interrogation) {
31 return []
32 }
33 return [...state.activeCase.cleared_suspects, ...state.activeCase.suspects_under_interrogation]
34 },
35 holdingCell (state, getters) {
36 if (!state.activeCase) {
37 return []
38 }
39 if (!state.activeCase.all_suspects) {
40 return []
41 }
42 return Object.keys(state.activeCase.all_suspects).filter((el) => {
43 return getters.notHolding.indexOf(el) < 0
44 })
45 },
46 updatedApi (state) {
47 if (typeof state.api === 'undefined') {
48 return
49 }
50
51 let api = {}
52 for (var prop in state.api) {
53 if (state.api[prop] && typeof state.api[prop] === 'string' && state.api[prop].indexOf('http') > -1) {
54 let url = document.createElement('a')
55 url.setAttribute('href', state.api[prop])
56 api[prop] = state.api[prop].replace(url.protocol, state.requestProtocol)
57 } else {
58 api[prop] = state.api[prop]
59 }
60 }
61 return api
62 },
63 updatedActiveCase (state) {
64 if (typeof state.activeCase === 'undefined') {
65 return
66 }
67
68 let activeCase = {}
69 for (var prop in state.activeCase) {
70 if (state.activeCase[prop] && typeof state.activeCase[prop] === 'string' && state.activeCase[prop].indexOf('http') > -1) {
71 let url = document.createElement('a')
72 url.setAttribute('href', state.activeCase[prop])
73 activeCase[prop] = state.activeCase[prop].replace(url.protocol, state.requestProtocol)
74 } else {
75 activeCase[prop] = state.activeCase[prop]
76 }
77 }
78
79 return activeCase
80 }
81 }
82