Skip to content

Commit baa7f9d

Browse files
committed
Huge update and refactor
1 parent 5c3b990 commit baa7f9d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+3131
-3580
lines changed

.browserslistrc

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
> 1%
2+
last 2 versions
3+
not ie <= 8

.eslintignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
src/plugins/apollo/graphql/*
2+
*.glsl

.eslintrc.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
module.exports = {
22
root: true,
3-
'extends': [
4-
'plugin:vue/recommended',
5-
'@vue/standard'
6-
],
3+
extends: ['plugin:vue/recommended', '@vue/standard'],
74
rules: {
85
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
96
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off'

.postcssrc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ module.exports = {
22
plugins: {
33
autoprefixer: {}
44
}
5-
}
5+
}

babel.config.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
presets: ['@vue/app']
3+
}

package.json

+18-20
Original file line numberDiff line numberDiff line change
@@ -8,40 +8,38 @@
88
"lint": "vue-cli-service lint"
99
},
1010
"dependencies": {
11+
"apollo-client": "^2.4.5",
12+
"graphql": "^14.0.2",
1113
"pixi.js": "^4.8.2",
12-
"register-service-worker": "^1.0.0",
14+
"register-service-worker": "^1.5.2",
1315
"vue": "^2.5.17",
1416
"vue-apollo": "^3.0.0-beta.25",
1517
"vue-fullscreen": "^2.1.3",
1618
"vue-router": "^3.0.1",
1719
"vue-timers": "^1.7.3",
18-
"vuelayers": "^0.10.13",
19-
"vuetify": "^1.2.5",
20+
"vuelayers": "next",
21+
"vuetify": "^1.3.5",
2022
"vuex": "^3.0.1",
2123
"vuex-router-sync": "^5.0.0"
2224
},
2325
"devDependencies": {
24-
"@vue/cli-plugin-babel": "^3.0.3",
25-
"@vue/cli-plugin-eslint": "^3.0.3",
26-
"@vue/cli-plugin-pwa": "^3.0.3",
27-
"@vue/cli-service": "^3.0.3",
28-
"@vue/eslint-config-airbnb": "^3.0.3",
29-
"@vue/eslint-config-prettier": "^3.0.3",
30-
"@vue/eslint-config-standard": "^3.0.3",
31-
"cesium": "^1.49.0",
32-
"css-loader": "^1.0.0",
33-
"eslint-loader": "^2.1.1",
34-
"eslint-plugin-import": "^2.14.0",
35-
"node-sass": "^4.9.0",
26+
"@vue/eslint-config-standard": "^4.0.0",
27+
"@vue/cli-plugin-babel": "^3.1.1",
28+
"@vue/cli-plugin-eslint": "^3.1.4",
29+
"@vue/cli-plugin-pwa": "^3.1.1",
30+
"@vue/cli-service": "^3.1.3",
31+
"@vue/cli-shared-utils": "^3.1.1",
32+
"vue-cli-plugin-apollo": "^0.17.3",
33+
"cesium": "^1.51.0",
34+
"css-loader": "^1.0.1",
35+
"node-sass": "^4.10.0",
3636
"pug": "^2.0.3",
3737
"pug-plain-loader": "^1.0.0",
38-
"sass-loader": "^7.0.1",
39-
"strip-pragma-loader": "^1.0.0",
40-
"style-loader": "^0.23.0",
38+
"sass-loader": "^7.1.0",
39+
"style-loader": "^0.23.1",
4140
"stylus": "^0.54.5",
4241
"stylus-loader": "^3.0.2",
43-
"vue-cli-plugin-apollo": "^0.17.0",
4442
"vue-template-compiler": "^2.5.17",
45-
"webpack": "^4.19.1"
43+
"webpack": "^4.25.1"
4644
}
4745
}

public/robots.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
User-agent: *
2+
Disallow:

src/App.vue

+42-15
Original file line numberDiff line numberDiff line change
@@ -14,35 +14,62 @@ div#fullscreen
1414
import BottomNav from './components/common/BottomNav'
1515
import TopNav from './components/common/TopNav'
1616
import ActionButton from './components/common/ActionButton'
17+
1718
export default {
1819
name: 'App',
1920
components: { BottomNav, TopNav, ActionButton },
2021
data () {
21-
return {
22-
}
22+
return {}
2323
},
2424
computed: {
25-
darkUi () { return this.$store.state.darkUi },
26-
activeApi () { return this.$store.state.activeApi },
25+
darkUi () {
26+
return this.$store.state.darkUi
27+
},
28+
activeApi () {
29+
return this.$store.state.activeApi
30+
},
2731
moduleName () {
2832
switch (true) {
29-
case /^\/cockpit/.test(this.$store.state.route.path): this.$store.commit('setModuleName', 'cockpit'); break
30-
case /^\/planner/.test(this.$store.state.route.path): this.$store.commit('setModuleName', 'planner'); break
31-
case /^\/config/.test(this.$store.state.route.path): this.$store.commit('setModuleName', 'config'); break
32-
case /^\/analysis/.test(this.$store.state.route.path): this.$store.commit('setModuleName', 'analysis'); break
33-
default: this.$store.commit('setModuleName', 'home')
33+
case /^\/cockpit/.test(this.$store.state.route.path):
34+
this.$store.commit('setModuleName', 'cockpit')
35+
break
36+
case /^\/planner/.test(this.$store.state.route.path):
37+
this.$store.commit('setModuleName', 'planner')
38+
break
39+
case /^\/config/.test(this.$store.state.route.path):
40+
this.$store.commit('setModuleName', 'config')
41+
break
42+
case /^\/analysis/.test(this.$store.state.route.path):
43+
this.$store.commit('setModuleName', 'analysis')
44+
break
45+
default:
46+
this.$store.commit('setModuleName', 'home')
3447
}
3548
switch (this.$store.state.moduleName) {
36-
case 'cockpit': this.$store.commit('setNavColor', 'mavblue'); this.$store.commit('setNavIcon', false); break
37-
case 'planner': this.$store.commit('setNavColor', 'mavorange'); this.$store.commit('setNavIcon', false); break
38-
case 'config': this.$store.commit('setNavColor', 'mavpurple'); this.$store.commit('setNavIcon', true); break
39-
case 'analysis': this.$store.commit('setNavColor', 'mavgreen'); this.$store.commit('setNavIcon', false); break
40-
default: this.$store.commit('setNavColor', null); this.$store.commit('setNavIcon', false)
49+
case 'cockpit':
50+
this.$store.commit('setNavColor', 'mavblue')
51+
this.$store.commit('setNavIcon', false)
52+
break
53+
case 'planner':
54+
this.$store.commit('setNavColor', 'mavorange')
55+
this.$store.commit('setNavIcon', false)
56+
break
57+
case 'config':
58+
this.$store.commit('setNavColor', 'mavpurple')
59+
this.$store.commit('setNavIcon', true)
60+
break
61+
case 'analysis':
62+
this.$store.commit('setNavColor', 'mavgreen')
63+
this.$store.commit('setNavIcon', false)
64+
break
65+
default:
66+
this.$store.commit('setNavColor', null)
67+
this.$store.commit('setNavIcon', false)
4168
}
4269
return this.$store.state.moduleName
4370
},
4471
navState () {
45-
return (this.moduleName === 'home') ? false : this.$store.state.navState // Return false if home screen, otherwise from vuex state
72+
return this.moduleName === 'home' ? false : this.$store.state.navState // Return false if home screen, otherwise from vuex state
4673
}
4774
}
4875
}

src/components/common/ActionButton.vue

+38-20
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ v-card.transparent.navfab
5757
<script>
5858
import fullscreen from 'vue-fullscreen'
5959
import Vue from 'vue'
60+
6061
Vue.use(fullscreen)
6162
6263
export default {
@@ -67,23 +68,41 @@ export default {
6768
},
6869
computed: {
6970
// Global states
70-
navState () { return this.$store.state.navState },
71-
navColor () { return this.$store.state.navColor },
72-
fullScreen () { return this.$store.state.fullScreen },
73-
moduleName () { return this.$store.state.moduleName },
71+
navState () {
72+
return this.$store.state.navState
73+
},
74+
navColor () {
75+
return this.$store.state.navColor
76+
},
77+
fullScreen () {
78+
return this.$store.state.fullScreen
79+
},
80+
moduleName () {
81+
return this.$store.state.moduleName
82+
},
7483
navIcon () {
7584
switch (this.moduleName) {
76-
case 'cockpit': return 'flight_takeoff'
77-
case 'planner': return 'explore'
78-
case 'config': return 'settings'
79-
case 'analysis': return 'equalizer'
85+
case 'cockpit':
86+
return 'flight_takeoff'
87+
case 'planner':
88+
return 'explore'
89+
case 'config':
90+
return 'settings'
91+
case 'analysis':
92+
return 'equalizer'
8093
}
8194
},
8295
// Config states
83-
cockpitMapState () { return this.$store.state.cockpit.mapState },
84-
cockpitHudState () { return this.$store.state.cockpit.hudState },
96+
cockpitMapState () {
97+
return this.$store.state.cockpit.mapState
98+
},
99+
cockpitHudState () {
100+
return this.$store.state.cockpit.hudState
101+
},
85102
// Planner states
86-
plannerViewState () { return this.$store.state.planner.viewState }
103+
plannerViewState () {
104+
return this.$store.state.planner.viewState
105+
}
87106
},
88107
methods: {
89108
toggleNavState () {
@@ -105,18 +124,17 @@ export default {
105124
this.$store.commit('planner/setViewState', !this.plannerViewState)
106125
}
107126
}
108-
109127
}
110128
</script>
111129

112130
<style scoped>
113-
.navfab .v-speed-dial {
114-
position: fixed;
115-
bottom: 25px;
116-
right: 25px;
117-
}
131+
.navfab .v-speed-dial {
132+
position: fixed;
133+
bottom: 25px;
134+
right: 25px;
135+
}
118136
119-
.navfab .btn--floating {
120-
position: relative;
121-
}
137+
.navfab .btn--floating {
138+
position: relative;
139+
}
122140
</style>

src/components/common/BottomNav.vue

+8-2
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,14 @@ v-bottom-nav(app fixed :color="navColor" :value="navState")
1616
export default {
1717
name: 'BottomNav',
1818
computed: {
19-
navColor () { return this.$store.state.navColor },
20-
navState () { return (this.$store.state.moduleName === 'home') ? false : this.$store.state.navState } // Return false if home screen, otherwise from vuex state
19+
navColor () {
20+
return this.$store.state.navColor
21+
},
22+
navState () {
23+
return this.$store.state.moduleName === 'home'
24+
? false
25+
: this.$store.state.navState
26+
} // Return false if home screen, otherwise from vuex state
2127
}
2228
}
2329
</script>

src/components/common/TopNav.vue

+51-23
Original file line numberDiff line numberDiff line change
@@ -44,23 +44,29 @@ div
4444
</template>
4545

4646
<script>
47-
import { vfrHudQuery, vfrHudSubscription } from '../../plugins/apollo/graphql/VfrHudMessage.gql'
48-
import { stateQuery, stateSubscription } from '../../plugins/apollo/graphql/StateMessage.gql'
49-
import { statusTextQuery, statusTextSubscription } from '../../plugins/apollo/graphql/StatusTextMessage.gql'
47+
import {
48+
vfrHudQuery,
49+
vfrHudSubscription
50+
} from '../../plugins/apollo/graphql/VfrHudMessage.gql'
51+
import {
52+
stateQuery,
53+
stateSubscription
54+
} from '../../plugins/apollo/graphql/StateMessage.gql'
55+
import {
56+
statusTextQuery,
57+
statusTextSubscription
58+
} from '../../plugins/apollo/graphql/StatusTextMessage.gql'
5059
5160
export default {
5261
name: 'TopNav',
5362
data () {
5463
return {
5564
stateMessage: [],
5665
vfrHudMessage: [],
57-
flightModes: [
58-
'Guided',
59-
'Stabilize'
60-
],
66+
flightModes: ['Guided', 'Stabilize'],
6167
tickers: {
62-
'stateMessage': false,
63-
'vfrHudMessage': false
68+
stateMessage: false,
69+
vfrHudMessage: false
6470
},
6571
snackbar: false,
6672
statusTextMessage: '',
@@ -75,13 +81,27 @@ export default {
7581
},
7682
7783
computed: {
78-
routePath () { return this.$store.state.route.path },
79-
navIcon () { return this.$store.state.navIcon },
80-
navColor () { return this.$store.state.navColor },
81-
navDrawer () { return this.$store.state.navDrawer },
82-
apis () { return this.$store.state.apis },
83-
activeApi () { return this.$store.state.activeApi },
84-
height () { return window.innerHeight }
84+
routePath () {
85+
return this.$store.state.route.path
86+
},
87+
navIcon () {
88+
return this.$store.state.navIcon
89+
},
90+
navColor () {
91+
return this.$store.state.navColor
92+
},
93+
navDrawer () {
94+
return this.$store.state.navDrawer
95+
},
96+
apis () {
97+
return this.$store.state.apis
98+
},
99+
activeApi () {
100+
return this.$store.state.activeApi
101+
},
102+
height () {
103+
return window.innerHeight
104+
}
85105
},
86106
87107
methods: {
@@ -92,13 +112,15 @@ export default {
92112
this.$store.commit('setNavDrawer', !this.$store.state.navDrawer)
93113
},
94114
setTickers () {
95-
this.tickers['stateMessage'] = true
96-
this.tickers['vfrHudMessage'] = true
115+
this.tickers.stateMessage = true
116+
this.tickers.vfrHudMessage = true
97117
}
98118
},
99119
100120
apollo: {
101-
$client () { return this.activeApi },
121+
$client () {
122+
return this.activeApi
123+
},
102124
103125
// Setup apollo queries
104126
statusTextMessage: statusTextQuery,
@@ -110,18 +132,24 @@ export default {
110132
vfrHudMessage: {
111133
query: vfrHudSubscription,
112134
result ({ data }) {
113-
if (this.vfrHudMessage !== data.vfrHudMessage && this.tickers['vfrHudMessage']) {
135+
if (
136+
this.vfrHudMessage !== data.vfrHudMessage &&
137+
this.tickers.vfrHudMessage
138+
) {
114139
this.vfrHudMessage = data.vfrHudMessage
115-
this.tickers['vfrHudMessage'] = false // Turn the ticker off until the next interval
140+
this.tickers.vfrHudMessage = false // Turn the ticker off until the next interval
116141
}
117142
}
118143
},
119144
stateMessage: {
120145
query: stateSubscription,
121146
result ({ data }) {
122-
if (this.stateMessage !== data.stateMessage && this.tickers['stateMessage']) {
147+
if (
148+
this.stateMessage !== data.stateMessage &&
149+
this.tickers.stateMessage
150+
) {
123151
this.stateMessage = data.stateMessage
124-
this.tickers['stateMessage'] = false // Turn the ticker off until the next interval
152+
this.tickers.stateMessage = false // Turn the ticker off until the next interval
125153
this.fcTime = data.stateMessage.secs
126154
}
127155
}

0 commit comments

Comments
 (0)