Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
105 changes: 61 additions & 44 deletions src/views/files/DownloadCategory.vue
Original file line number Diff line number Diff line change
@@ -1,65 +1,82 @@
<template>
<div :id="cat" class="col s12">
<div v-if="!files.length" class="no_files">No files in this category found</div>
<div class="download" v-else v-for="file in files" :key="file.id">
<a :href="`https://zabartcc.sfo3.digitaloceanspaces.com/downloads/${file.fileName}`" target="_blank" class="btn button"><i class="material-icons">file_download</i></a>
<div class="title">{{ file.name }}</div>
<div class="desc">{{ file.description }}</div>
<div class="info">Updated at {{ dtRegionalUS(file.updatedAt) }}z</div>
</div>
</div>
<div :id="cat" class="col s12">
<div v-if="!files.length" class="no_files">
No files in this category found
</div>

<div class="download" v-else v-for="file in files" :key="file.id">
<a
:href="file.redirectUrl || fileDownloadUrl(file)"
target="_blank"
class="btn button"
>
<i class="material-icons">
{{ file.redirectUrl ? "open_in_new" : "file_download" }}
</i>
</a>

<div class="title">{{ file.name }}</div>
<div class="desc">{{ file.description }}</div>
<div class="info">Updated at {{ dtRegionalUS(file.updatedAt) }}z</div>
</div>
</div>
</template>

<script>
export default {
props: ['cat', 'files']
props: ["cat", "files"],
methods: {
fileDownloadUrl(file) {
return `https://zabartcc.sfo3.digitaloceanspaces.com/downloads/${file.fileName}`;
},
},
};
</script>

<style lang="scss" scoped>
.download {
padding: 1em 1em .5em 1em;
transition: background-color .3s ease;
padding: 1em 1em 0.5em 1em;
transition: background-color 0.3s ease;

.title {
font-weight: 700;
font-size: 1.3rem;
width: calc(100% - 45px);
}
.title {
font-weight: 700;
font-size: 1.3rem;
width: calc(100% - 45px);
}

.desc {
font-size: .9rem;
width: calc(100% - 45px);
}
.desc {
font-size: 0.9rem;
width: calc(100% - 45px);
}

.button {
float: right;
background: $primary-color-light;
.button {
float: right;
background: $primary-color-light;

&.btn {
width: auto;
padding: 0 .6em;
color: #fff;
}
}
&.btn {
width: auto;
padding: 0 0.6em;
color: #fff;
}
}

.info {
font-size: .8rem;
margin-top: 5px;
color: #9e9e9e;
}
.info {
font-size: 0.8rem;
margin-top: 5px;
color: #9e9e9e;
}

&:nth-of-type(odd) {
background: hsla(0,0%,94.9%,.5);
}
&:nth-of-type(odd) {
background: hsla(0, 0%, 94.9%, 0.5);
}

&:hover {
background: #eaeaea;
}
&:hover {
background: #eaeaea;
}
}

.no_files {
padding: 1.5em 1em;
font-style: italic;
padding: 1.5em 1em;
font-style: italic;
}
</style>
</style>
214 changes: 116 additions & 98 deletions src/views/files/Downloads.vue
Original file line number Diff line number Diff line change
@@ -1,123 +1,141 @@
<template>
<div class="card card_downloads">
<div class="card-content">
<span class="card-title">Downloads</span>
</div>
<div class="row">
<div class="col s12">
<ul class="tabs tabs-fixed-width">
<li class="tab"><a href="#veram">vERAM</a></li>
<li class="tab"><a href="#vstars">vSTARS</a></li>
<li class="tab"><a href="#vatis">vATIS</a></li>
<li class="tab"><a href="#misc">Miscellaneous</a></li>
</ul>
</div>
<div class="loading_container loading_files" v-if="!downloads">
<Spinner />
</div>
<div class="tabs_content" v-else>
<DownloadCategory v-for="(files, cat) in downloads" :key="cat" :cat="cat" :files="files" />
</div>
</div>
</div>
<div class="card card_downloads">
<div class="card-content">
<span class="card-title">Downloads</span>
</div>
<div class="row">
<div class="col s12">
<ul class="tabs tabs-fixed-width">
<li class="tab"><a href="#veram">vERAM</a></li>
<li class="tab"><a href="#vstars">vSTARS</a></li>
<li class="tab"><a href="#vatis">vATIS</a></li>
<li class="tab"><a href="#misc">Miscellaneous</a></li>
</ul>
</div>
<div class="loading_container loading_files" v-if="!downloads">
<Spinner />
</div>
<div class="tabs_content" v-else>
<DownloadCategory
v-for="(files, cat) in downloads"
:key="cat"
:cat="cat"
:files="files"
/>
</div>
</div>
</div>
</template>

<script>
import { zabApi } from '@/helpers/axios.js';
import DownloadCategory from './DownloadCategory.vue';
import { zabApi } from "@/helpers/axios.js";
import DownloadCategory from "./DownloadCategory.vue";

export default {
name: 'Downloads',
title: 'Downloads',
data() {
return {
downloads: null
};
},
components: {
DownloadCategory
},
async mounted() {
await this.getDownloads();
M.Tabs.init(document.querySelectorAll('.tabs'));
},
methods: {
async getDownloads() {
const { data: fileData } = await zabApi.get('/file/downloads');
this.downloads = {
veram: fileData.data.filter((file) => file.category === 'veram'),
vstars: fileData.data.filter((file) => file.category === 'vstars'),
vatis: fileData.data.filter((file) => file.category === 'vatis'),
misc: fileData.data.filter((file) => file.category === 'misc'),
};
},
},
name: "Downloads",
title: "Downloads",
data() {
return {
downloads: null,
};
},
components: {
DownloadCategory,
},
async mounted() {
await this.getDownloads();
M.Tabs.init(document.querySelectorAll(".tabs"));
},
methods: {
async getDownloads() {
const { data: fileData } = await zabApi.get("/file/downloads");

const miscFiles = fileData.data.filter(
(file) => file.category === "misc"
);

miscFiles.unshift({
id: "landline",
name: "Landline ATC Coordination",
description: "Virtual ATC coordination software used by controllers.",
updatedAt: "2026-01-17T00:00:00Z",
redirectUrl: "https://landline.creativeshrimp.dev/",
});

this.downloads = {
veram: fileData.data.filter((file) => file.category === "veram"),
vstars: fileData.data.filter((file) => file.category === "vstars"),
vatis: fileData.data.filter((file) => file.category === "vatis"),
misc: miscFiles,
};
},
},
};
</script>

<style scoped lang="scss">
.download {
padding: 1em 1em .5em 1em;
transition: background-color .3s ease;

.title {
font-weight: 700;
font-size: 1.3rem;
}

.desc {
font-size: .9rem;
}

.button {
float: right;
margin-top: -30px;
background: $primary-color-light;

&.btn {
width: auto;
padding: 0 .6em;
color: #fff;
}
}

.info {
font-size: .8rem;
margin-top: 5px;
color: #9e9e9e;
}

&:nth-of-type(odd) {
background: hsla(0,0%,94.9%,.5);
}

&:hover {
background: #eaeaea;
}
padding: 1em 1em 0.5em 1em;
transition: background-color 0.3s ease;

.title {
font-weight: 700;
font-size: 1.3rem;
}

.desc {
font-size: 0.9rem;
}

.button {
float: right;
margin-top: -30px;
background: $primary-color-light;

&.btn {
width: auto;
padding: 0 0.6em;
color: #fff;
}
}

.info {
font-size: 0.8rem;
margin-top: 5px;
color: #9e9e9e;
}

&:nth-of-type(odd) {
background: hsla(0, 0%, 94.9%, 0.5);
}

&:hover {
background: #eaeaea;
}
}

.no_files {
padding: 1.5em 1em;
font-style: italic;
padding: 1.5em 1em;
font-style: italic;
}

.tabs {
overflow-x: auto;
overflow-x: auto;

&::-webkit-scrollbar {
height: 3px;
}
&::-webkit-scrollbar {
height: 3px;
}

&::-webkit-scrollbar-track {
background-color: #fff;
}
&::-webkit-scrollbar-track {
background-color: #fff;
}

&::-webkit-scrollbar-thumb:horizontal {
background-color: $gray_light;
}
&::-webkit-scrollbar-thumb:horizontal {
background-color: $gray_light;
}
}

.loading_files {
padding-top: 5em;
padding-top: 5em;
}
</style>