This commit is contained in:
portree_kid
2020-05-03 09:48:38 +02:00
parent cb2f9c69ab
commit 59d58b05ab
6 changed files with 64 additions and 9 deletions
+29 -6
View File
@@ -1,21 +1,26 @@
<template>
<div>
<span>
<el-row>
<el-col :span="6" class='text'>
<el-col :span="3" class='text'>
{{airport.icao}}
</el-col>
<el-col :span="10" class='text'>
<el-col :span="6" class='text'>
{{date}}
</el-col>
<el-col :span="6">
<el-button @click="goto">Goto</el-button>
<el-col :span="6" class='text'>
{{upload_date}}
</el-col>
<el-col :span="9">
<el-button @click="goto" class="button"><i class="fas fa-bullseye"></i></el-button>
<el-button @click="remove" tooltip="Remove wip file" class="button"><i class="fas fa-trash-alt"></i></el-button>
<el-button @click="upload" tooltip="Upload to groundweb" class="button"><i class="fas fa-upload"></i></el-button>
</el-col>
</el-row>
</span>
</div>
</template>
<script lang="js">
import {removeWip} from '../loaders/groundnet_functions'
/* eslint-disable */
export default {
name: 'airport',
@@ -34,6 +39,12 @@
if (airports.length > 0) {
this.$store.commit('CENTER', [airports[0].geometry.coordinates[1], airports[0].geometry.coordinates[0]])
}
},
remove() {
removeWip(this.$store.state.Settings.settings.airportsDirectory, this.airport.icao)
this.$store.dispatch('removeWip', this.airport.icao);
},
upload() {
}
},
@@ -41,6 +52,14 @@
date: function () {
var d = new Date(this.airport.time)
return d.toLocaleDateString() + ' ' + d.toLocaleTimeString()
},
upload_date: function () {
if( this.airport.upload !== undefined ) {
var d = new Date(this.airport.upload)
return d.toLocaleDateString() + ' ' + d.toLocaleTimeString()
} else {
return "-"
}
}
}
}
@@ -52,4 +71,8 @@
.text {
padding: 10px;
}
.button {
padding-left: 10px;
padding-right: 10px;
}
</style>
+1
View File
@@ -602,6 +602,7 @@
node.extensions();
}
},
// Finde nearest node
closestLayerSnap (eventLatlng, snap) {
var layers = []
this.groundnetLayerGroup.eachLayer((layer) => {
+2
View File
@@ -62,6 +62,8 @@
parent.$refs.upload.message == e.srcElement.statusText
} else if(JSON.parse(e.srcElement.response).message.match('[A-Z0-9]* Imported Successfully')) {
Vue.set(parent, 'uploadVisible', false)
parent.$store.commit('UPLOAD_WIP', parent.$store.state.Airports.currentAirport.icao)
} else if(JSON.parse(e.srcElement.response).message === 'XML Errors') {
var response = JSON.parse(e.srcElement.response);
if (response.validationErrors) {
+6 -3
View File
@@ -7,12 +7,15 @@
</h1>
<div>
<el-row>
<el-col :span="6" class="text">
<el-col :span="3" class="text">
ICAO
</el-col>
<el-col :span="10" class="text">
<el-col :span="7" class="text">
Edited
</el-col>
<el-col :span="9" class="text">
Uploaded
</el-col>
<el-col :span="6" class="text">
</el-col>
</el-row>
@@ -40,7 +43,7 @@
},
computed: {
wip: function () {
return this.$store.state.Settings.wip.sort((p, p2) => { return p.date > p2.date })
return this.$store.state.Settings.wip
}
}
}