adding whitelist

This commit is contained in:
José Conde 2023-01-06 19:13:17 +01:00
parent b979ba83b7
commit 0841c24f3c
3 changed files with 97 additions and 57 deletions

1
.env
View File

@ -1,3 +1,4 @@
# VITE_API_BASE=http://192.168.1.112:3101/api/v1
VITE_API_BASE=http://localhost:3000/api/v1
VITE_API_PATH_LIST=/ivao/list/today
VITE_API_PATH_WHITELIST=/ivao/whitelist

View File

@ -4,12 +4,14 @@
import moment from 'moment';
import FormatTime from './components/FormatTime.vue';
import { getMonthlyList } from './data/http/listRequest';
import { getMonthlyList, getWhitelist } from './data/http/listRequest';
export default {
data() {
return {
loading: true,
list: [],
whitelist: []
}
},
async mounted() {
@ -25,6 +27,7 @@ export default {
d._formattedTime = `${hours}:${minutes}`;
return d;
});
this.whitelist = await getWhitelist();
console.log(this.list);
},
dateTime(value) {
@ -44,13 +47,43 @@ export default {
</script>
<template>
<section class="section">
<header class="container is-fluid level block mt-2">
<div class="level-left">
<img src="@/assets/images/logo_28.png" alt="Latin Streaming Alliance" class="logo">
</div>
</header>
<div class="container">
<h1 class="title">
<img class="logo" src="@/assets/images/logo_28.png" />Horas mensuales
</h1>
<section class="section">
<h1 class="title">Pilotos activos con mas de 200 horas en ACARS</h1>
<table class="table is-striped is-hoverable is-fullwidth">
<thead>
<tr>
<th class="has-text-centered">VID</th>
<th class="">Nombre</th>
<th class="has-text-centered">Total Vuelos</th>
<th class="has-text-centered">Horas totales</th>
</tr>
</thead>
<tbody>
<tr v-for="item in whitelist" :key="item.vid">
<td class="has-text-centered">
{{ item.vid }}
</td>
<td>
{{ item.name }}
</td>
<td class="has-text-centered">
{{ item.flights }}
</td>
<td class="has-text-centered">
<FormatTime :value="item.flightTime" />
</td>
</tr>
</tbody>
</table>
</section>
<section class="section">
<h1 class="title">Status mensual IVAO</h1>
<table class="table is-striped is-hoverable is-fullwidth">
<thead>
<tr>
@ -98,8 +131,8 @@ export default {
</tr>
</tbody>
</table>
</div>
</section>
</div>
<!-- <RouterView /> -->
</template>

View File

@ -6,3 +6,9 @@ export async function getMonthlyList() {
const response = await request(`${VITE_API_BASE}${VITE_API_PATH_LIST}`);
return response;
}
export async function getWhitelist() {
const { VITE_API_BASE, VITE_API_PATH_WHITELIST } =
import.meta.env;
const response = await request(`${VITE_API_BASE}${VITE_API_PATH_WHITELIST}`);
return response;
}