Disable AI Layer
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
/* eslint-disable */
|
||||
const path = require('path');
|
||||
const fs = require('fs');
|
||||
|
||||
const state = {
|
||||
settings: { flightgearDirectory: '.', testDirectory: '.', email: 'flightgearairports@example.org', name: 'unknown', phi_url: 'http://localhost:8080' },
|
||||
zoom: 14,
|
||||
@@ -8,41 +11,52 @@ const state = {
|
||||
}
|
||||
|
||||
const mutations = {
|
||||
'DELETE_INDEXED_DB' () { },
|
||||
'FLIGHTGEAR_DIRECTORY' (state, flightgearDirectory) {
|
||||
state.settings.flightgearDirectory = flightgearDirectory
|
||||
state.settings.flightgearDirectory_ai = flightgearDirectory + '/data/AI'
|
||||
state.settings.flightgearDirectory_traffic = flightgearDirectory + '/data/AI/Traffic'
|
||||
state.settings.flightgearDirectory_apt = flightgearDirectory + '/data/Airports/apt.dat.gz'
|
||||
'DELETE_INDEXED_DB'() { },
|
||||
'FLIGHTGEAR_DIRECTORY'(state, flightgearDirectory) {
|
||||
try {
|
||||
fs.accessSync(flightgearDirectory)
|
||||
state.settings.flightgearDirectory = flightgearDirectory
|
||||
} catch (err) {
|
||||
try {
|
||||
fs.accessSync(flightgearDirectory.replace(/\.App/, ''))
|
||||
state.settings.flightgearDirectory = flightgearDirectory.replace(/\.App/, '')
|
||||
} catch (error) {
|
||||
console.warn(error)
|
||||
}
|
||||
}
|
||||
|
||||
state.settings.flightgearDirectory_ai = flightgearDirectory + path.sep + 'AI'
|
||||
state.settings.flightgearDirectory_traffic = path.join(flightgearDirectory, 'AI', 'Traffic');
|
||||
state.settings.flightgearDirectory_apt = path.join(flightgearDirectory, 'Airports', 'apt.dat.gz');
|
||||
},
|
||||
'AIPORTS_DIRECTORY' (state, airportsDirectory) {
|
||||
'AIPORTS_DIRECTORY'(state, airportsDirectory) {
|
||||
state.settings.airportsDirectory = airportsDirectory
|
||||
},
|
||||
'TEST_DIRECTORY' (state, testDirectory) {
|
||||
'TEST_DIRECTORY'(state, testDirectory) {
|
||||
state.settings.testDirectory = testDirectory
|
||||
},
|
||||
'ZOOM' (state, zoom) {
|
||||
'ZOOM'(state, zoom) {
|
||||
state.zoom = zoom
|
||||
},
|
||||
'CENTER' (state, center) {
|
||||
'CENTER'(state, center) {
|
||||
state.center = center
|
||||
},
|
||||
'BOUNDS' (state, bounds) {
|
||||
'BOUNDS'(state, bounds) {
|
||||
state.bounds = bounds
|
||||
},
|
||||
'SET_EMAIL' (state, email) {
|
||||
'SET_EMAIL'(state, email) {
|
||||
state.settings.email = email
|
||||
},
|
||||
'SET_NAME' (state, name) {
|
||||
'SET_NAME'(state, name) {
|
||||
state.settings.name = name
|
||||
},
|
||||
'SET_PHI_URL' (state, phi_url) {
|
||||
'SET_PHI_URL'(state, phi_url) {
|
||||
state.settings.phi_url = phi_url
|
||||
},
|
||||
'SET_SCAN_LOGGING' (state, scanLogging) {
|
||||
},
|
||||
'SET_SCAN_LOGGING'(state, scanLogging) {
|
||||
state.settings.scanLogging = scanLogging
|
||||
},
|
||||
'ADD_WIP' (state, airport) {
|
||||
'ADD_WIP'(state, airport) {
|
||||
const item = state.wip.find((e) => e.icao === airport.icao)
|
||||
airport.time = Date.now()
|
||||
if (item === null || item === undefined) {
|
||||
@@ -52,12 +66,12 @@ const mutations = {
|
||||
}
|
||||
state.wip.sort((w1, w2) => w1.time - w2.time)
|
||||
},
|
||||
'UPLOAD_WIP' (state, icao) {
|
||||
'UPLOAD_WIP'(state, icao) {
|
||||
const item = state.wip.find((e) => e.icao === icao)
|
||||
item.upload = Date.now()
|
||||
state.wip.sort((p, p2) => { return p.time - p2.time })
|
||||
},
|
||||
'REMOVE_WIP' (state, icao) {
|
||||
'REMOVE_WIP'(state, icao) {
|
||||
const item = state.wip.find((e) => e.icao === icao)
|
||||
const index = state.wip.indexOf(item)
|
||||
if (index > -1) {
|
||||
@@ -69,21 +83,21 @@ const mutations = {
|
||||
const plugins = []
|
||||
|
||||
const actions = {
|
||||
async setZoom (context, zoom) {
|
||||
async setZoom(context, zoom) {
|
||||
context.commit('ZOOM', zoom)
|
||||
},
|
||||
async setCenter (context, center) {
|
||||
if( center.lat !== context.state.center.lat || center.lng !== context.state.center.lng) {
|
||||
async setCenter(context, center) {
|
||||
if (center.lat !== context.state.center.lat || center.lng !== context.state.center.lng) {
|
||||
context.commit('CENTER', center)
|
||||
}
|
||||
},
|
||||
async setBounds (context, bounds) {
|
||||
async setBounds(context, bounds) {
|
||||
context.commit('BOUNDS', bounds)
|
||||
},
|
||||
async addWip (context, airport) {
|
||||
async addWip(context, airport) {
|
||||
context.commit('ADD_WIP', airport)
|
||||
},
|
||||
async removeWip (context, icao) {
|
||||
async removeWip(context, icao) {
|
||||
context.commit('REMOVE_WIP', icao)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user