Skip to content

Commit

Permalink
Additional Fixes. UwU
Browse files Browse the repository at this point in the history
  • Loading branch information
BossOfGames committed Jul 15, 2020
1 parent ed21aee commit d5c53fd
Show file tree
Hide file tree
Showing 7 changed files with 179 additions and 7 deletions.
50 changes: 50 additions & 0 deletions Resources/assets/js/components/ApiPullAutoComplete.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<template>
<v-autocomplete
v-model="output"
:loading="loading"
:items="items"
:search-input.sync="search"
cache-items
flat
hide-no-data
hide-details
:label="label"
item-text="name"
:item-value="itemvalue"
:return-object="returnobj"
></v-autocomplete>
</template>
<script>
import axios from 'axios'
export default {
name: "ApiPullAutoComplete",
props: ['label', 'url', 'returnobj', 'itemvalue'],
data() {
return {
output: null,
loading: false,
items: [],
search: null
}
},
watch: {
search (val) {
val && val !== this.depapt && this.dep_querySelections(val)
},
output (val) {
this.$emit('input', this.output)
},
},
methods: {
dep_querySelections (v) {
this.loading = true;
this.items = [];
axios.get(this.url, { params: { keyword: this.search }})
.then(res => {
this.items = res.data;
this.loading = false;
});
},
}
}
</script>
12 changes: 11 additions & 1 deletion Resources/assets/js/router/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

import Vue from 'vue'
import Router from 'vue-router'

import store from '../store'

import Dashboard from '../views/Dashboard'
import FlightListView from "../views/Flights/FlightListView";
Expand All @@ -16,9 +16,13 @@ import PersonalAircraftDetailedView from "../views/Aircraft/PersonalAircraftDeta
import ProfileStatsView from "../views/Profile/ProfileStatsView";
import iFrameContainerView from "../views/iFrameContainerView";
import InterfaceSettingsAdminView from "../views/Admin/InterfaceSettingsAdminView";
import ScheduleView from "../views/Schedule/ScheduleView";

Vue.use(Router);

function doAuth(to, from, next) {

}
export default new Router({
routes: [
{ path: '/', name: 'dashboard', component: Dashboard },
Expand All @@ -27,7 +31,13 @@ export default new Router({
{ path: '/flights/new', name: 'new_flight', component: NewFlightSelection},
{ path: '/flights/upcoming', name: 'upcoming_flights', component: FlightListView},
{ path: '/flights/:id', name: 'flight_detailed', component: FlightDetailedView},
{ path: '/schedule', name: 'schedule', component: ScheduleView},
{ path: '/trips', name: 'trips', component: FlightListView},
{ path: '/trips/create', name: 'new_trip', component: FlightListView},
// User Profiles
{ path: '/profile', redirect: to => {
return `/users/${this.$store.state.user.id}`;
}},
{ path: '/users/:id', name: 'profile', component: ProfileIndexView},
{ path: '/users/:id/logbook', name: 'profile_logbook', component: ProfileLogbookView},
{ path: '/users/:id/hanger', name: 'profile_hanger', component: ProfileHangerView},
Expand Down
48 changes: 47 additions & 1 deletion Resources/assets/js/views/Dashboard.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@
<template>
<v-img :aspect-ratio="16/5" src="https://i.imgur.com/Fj4dbUx.png" gradient="rgba(100,115,201,.33), rgba(25,32,72,.7)"></v-img>
<div>
<div style="position: absolute; height: inherit; width: 100%; z-index: 0">
<v-img :aspect-ratio="16/5" src="https://i.imgur.com/Fj4dbUx.png" gradient="rgba(100,115,201,.33), rgba(25,32,72,.7)"></v-img>
</div>
<div style="position: relative; z-index: 1; padding-top: 20rem">
<v-container grid-list-lg>
<v-layout grid row>
<v-flex lg4 md6 sm12>
<v-card class="mx-auto mb-4">
<v-img class="white--text align-end" height="150px" src="https://upload.wikimedia.org/wikipedia/commons/2/2c/SLC_airport%2C_2010.jpg"></v-img>
<v-card-title>Welcome Back Taylor!</v-card-title>
<v-card-subtitle class="pb-0">Currently at <b>Salt Lake City International Airport</b></v-card-subtitle>
<v-card-actions>
<v-btn text color="primary">Start Flight Here</v-btn>
</v-card-actions>
</v-card>
<v-card class="mx-auto">
<v-card-title>Statistics</v-card-title>
<v-list>
<v-list-item>Total Flights: 200</v-list-item>
<v-list-item>Total Hours: 156.2h</v-list-item>
<v-list-item>Total Airports Visited: 27</v-list-item>
</v-list>
<v-card-actions>
<v-btn text color="primary">View Profile</v-btn>
</v-card-actions>
</v-card>
</v-flex>
<v-flex lg8 md6 sm12>
<v-card>
<v-responsive :aspect-ratio="16/9">
<iframe style="height: 100%; width: 100%; border: none;" src="https://fsvaos.net/map_dev"></iframe>
</v-responsive>
</v-card>
</v-flex>
</v-layout>
<v-layout grid row>
<v-flex md6 sm12>
<v-card class="mx-auto">
<v-card-title>Recent Flights</v-card-title>
</v-card>
</v-flex>
</v-layout>
</v-container>
</div>
</div>

</template>

<script>
Expand Down
2 changes: 1 addition & 1 deletion Resources/assets/js/views/Layouts/MainLayout.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
<slot></slot>
</v-content>
<v-footer app>
VAOS Web 3.0 | Licensed for Entertainment Use
VAOS Classic 2.1 | Material Crew Redux
</v-footer>
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion Resources/assets/js/views/Profile/ProfileIndexView.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div>
TEst
Test
</div>
</template>

Expand Down
2 changes: 1 addition & 1 deletion Resources/assets/js/views/Profile/ProfileStatsView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>

<div>Test</div>
</template>

<script>
Expand Down
70 changes: 68 additions & 2 deletions Resources/assets/js/views/Schedule/ScheduleView.vue
Original file line number Diff line number Diff line change
@@ -1,10 +1,76 @@
<template>

<div>
<div>
<v-container class="flex">
<v-layout grid row style="max-width: 400px; margin: 0 auto;">
<v-flex md6 sm12>
<ApiPullAutoComplete v-model="filter_options.depapt" label="Origin" url="https://fsvaos.net/api/data/airports/search"/>
<ApiPullAutoComplete v-model="filter_options.arrapt" label="Destination" url="https://fsvaos.net/api/data/airports/search"/>
</v-flex>
<v-flex md6 sm12>
<ApiPullAutoComplete v-model="filter_options.aircraft" label="Origin" url="https://fsvaos.net/api/data/aircraft/search"/>
<ApiPullAutoComplete v-model="filter_options.aviation_group" label="Destination" url="https://fsvaos.net/api/data/airports/search"/>
</v-flex>
</v-layout>
</v-container>
<v-img :aspect-ratio="16/5" src="https://i.imgur.com/Fj4dbUx.png" gradient="rgba(100,115,201,.33), rgba(25,32,72,.7)"></v-img>
</div>
<div>
<v-container grid-list-lg>
<v-layout grid row>
<v-flex lg4 md6 sm12 v-for="flight in schedule_list" :key="flight.id">
<v-card class="mx-auto mb-4">
<v-img class="white--text align-end" height="150px" src="https://upload.wikimedia.org/wikipedia/commons/2/2c/SLC_airport%2C_2010.jpg"></v-img>
<v-card-title>{{flight.callsign}}</v-card-title>
<v-card-subtitle class="pb-0">{{flight.depapt}}-{{flight.arrapt}}</v-card-subtitle>
<v-card-actions>
<v-btn text color="primary">View Details</v-btn>
</v-card-actions>
</v-card>
</v-flex>
</v-layout>
</v-container>
</div>
</div>
</template>

<script>
import ApiPullAutoComplete from "../../components/ApiPullAutoComplete";
export default {
name: "ScheduleView"
name: "ScheduleView",
components: {ApiPullAutoComplete},
data() {
return {
schedule_list: [],
filter_options: {
depapt: '',
arrapt: '',
aircraft: '',
deptime: '',
arrtime: '',
aviation_group: ''
}
}
},
created() {
this.$http.get('/api/materialcrewredux/schedule').then(res => {
this.schedule_list = res.data
})
},
computed: {
filtered_list() {
this.schedule_list.filter(flight => {
for (let key in this.filter_options) {
if (key === '') {
continue;
}
if (flight[key] === undefined || flight[key] !== this.filter_options[key])
return false;
}
return true;
})
}
}
}
</script>

Expand Down

0 comments on commit d5c53fd

Please sign in to comment.