From f93ce2780db6ec89ec79b7719ab62ecd992e111f Mon Sep 17 00:00:00 2001 From: Spencer Flagg Date: Sat, 2 Oct 2021 18:12:35 +0200 Subject: [PATCH] spencer --- .drone.yml | 5 +++++ Dockerfile | 28 ++++++++++++++++++++++++++++ components/AirportPicker.vue | 1 - components/Calendar.vue | 29 ++++++++++++++++++++++++++--- components/TheSideBar.vue | 2 +- fl-run.sh | 7 +++++++ nuxt.config.js | 13 +++++++++---- pages/_mountain.vue | 33 --------------------------------- pages/dates.vue | 4 ++-- pages/flights.vue | 7 ++++--- pages/go.vue | 6 ------ pages/mtns.vue | 20 -------------------- 12 files changed, 82 insertions(+), 73 deletions(-) create mode 100644 .drone.yml create mode 100644 Dockerfile create mode 100644 fl-run.sh delete mode 100644 pages/_mountain.vue delete mode 100644 pages/mtns.vue diff --git a/.drone.yml b/.drone.yml new file mode 100644 index 0000000..471c190 --- /dev/null +++ b/.drone.yml @@ -0,0 +1,5 @@ +kind: pipeline +type: docker +name: default + +steps: \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..b0a5243 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +FROM node:14.5.0-alpine + +# create destination directory +RUN mkdir -p /usr/src/flylocal-web +WORKDIR /usr/src/flylocal-web + +# update and install dependency +RUN apk update && apk upgrade +RUN apk add git + +# copy the app, note .dockerignore +COPY . /usr/src/flylocal-web/ +RUN yarn install + +# build necessary, even if no static files are needed, +# since it builds the server as well +RUN yarn build + +# expose 3000 on container +EXPOSE 3000 + +# set app serving to permissive / assigned +ENV NUXT_HOST=0.0.0.0 +# set app port +ENV NUXT_PORT=3000 + +# start the app +CMD [ "yarn", "start" ] \ No newline at end of file diff --git a/components/AirportPicker.vue b/components/AirportPicker.vue index 5bed72b..b52d6f6 100644 --- a/components/AirportPicker.vue +++ b/components/AirportPicker.vue @@ -110,7 +110,6 @@ export default { }, data: () => ({ OpenIndicator, - mountains: [], filterBy: (option, label, search) => { const temp = search.toLowerCase() return option.search.toLowerCase().includes(temp) diff --git a/components/Calendar.vue b/components/Calendar.vue index dff4ca9..c6c0eb1 100644 --- a/components/Calendar.vue +++ b/components/Calendar.vue @@ -118,9 +118,32 @@ export default { }, scheduleTime (dow) { // console.log(dow) - const thisDate = new Date(dow.DepartureTimeFormatted) - const hours = thisDate.getHours() + Math.round(thisDate.getMinutes() / 60) - return ((hours > 12) ? (hours - 12) + 'pm' : hours + 'am') + // const thisDate = new Date(dow.Departure_TimeL) + const timeArray = dow.Departure_TimeL.split(':') + const thisHour = timeArray[0] + const thisMinute = timeArray[1] + const hours = parseInt(thisHour) + Math.round(parseInt(thisMinute) / 60) + + let timeString = '' + + switch (true) { + case (hours > 12): + timeString = (hours - 12) + 'pm' + break + case (hours === 12): + timeString = '12pm' + break + case (hours < 12 && hours > 0): + timeString = hours + 'am' + break + case (hours === 0): + timeString = '12am' + break + default: + break + } + + return timeString } } } diff --git a/components/TheSideBar.vue b/components/TheSideBar.vue index f67ec0a..06cfc0f 100644 --- a/components/TheSideBar.vue +++ b/components/TheSideBar.vue @@ -254,7 +254,7 @@
  • - + -
    -

    Continent: {{ continent }}

    -

    Mountain: {{ mountain }}

    -

    Path: {{ $route.path }}

    - - Back to Mountains - -
    - - diff --git a/pages/dates.vue b/pages/dates.vue index 8075f6b..01d5e8c 100644 --- a/pages/dates.vue +++ b/pages/dates.vue @@ -69,7 +69,7 @@ export default { // const tomorrow = addDays(new Date(), 1).toLocaleDateString('en-CA') const scheduleFetchFilterFormula = `AND(Is_Current="Yes",Origin_IATA="${this.$route.params.o}",Destination_IATA="${this.$route.params.d}",Effective_End>"${today}")` - const scheduleFetchSort = '&sort[0][field]=DepartureTimeFormatted&sort[0][direction]=asc' + const scheduleFetchSort = '&sort[0][field]=Departure_TimeL&sort[0][direction]=asc' const response = await fetch(`https://api.airtable.com/v0/appiQwfVZixRgRICe/Schedule?filterByFormula=${scheduleFetchFilterFormula}${scheduleFetchSort}`, { method: 'GET', @@ -94,7 +94,7 @@ export default { DowsList: this.daysList(schedule.fields.Frequency_Convert), Effective_Start: schedule.fields.Effective_Start, Effective_End: schedule.fields.Effective_End, - DepartureTimeFormatted: schedule.fields.DepartureTimeFormatted + Departure_TimeL: schedule.fields.Departure_TimeL } }) return mappedDows diff --git a/pages/flights.vue b/pages/flights.vue index e21f4b7..3295576 100644 --- a/pages/flights.vue +++ b/pages/flights.vue @@ -204,7 +204,7 @@ export default { const scheduleFetchFilterFormula = `AND(Is_Current="Yes",Origin_IATA="${this.$route.params.o}",Destination_IATA="${this.$route.params.d}",Effective_End>"${today}",SEARCH("${new Date(this.$route.params.departure).getDay()}",Frequency)>0)` // console.log(scheduleFetchFilterFormula) - const scheduleFetchSort = '&sort[0][field]=DepartureTimeFormatted&sort[0][direction]=asc' + const scheduleFetchSort = '&sort[0][field]=Departure_TimeL&sort[0][direction]=asc' const response = await fetch(`https://api.airtable.com/v0/appiQwfVZixRgRICe/Schedule?filterByFormula=${scheduleFetchFilterFormula}${scheduleFetchSort}`, { method: 'GET', @@ -235,7 +235,7 @@ export default { const thisDate = new Date(date) const month = thisDate.toLocaleString('en-us', { month: 'short' }) const year = ((thisDate.getFullYear() !== new Date().getFullYear()) ? ', ' + thisDate.getFullYear() : '') - return month + ' ' + thisDate.getDate() + year + return month + ' ' + thisDate.getUTCDate() + year }, daysList (days) { const list = days.split(', ').map((day) => { @@ -506,7 +506,8 @@ span.text--flight-num { span.text--dow { font-weight: 300; - letter-spacing: -0.1em; + font-size: 0.8rem; + color: #007fff; } span.badge--avail { diff --git a/pages/go.vue b/pages/go.vue index a1d1747..5781d14 100644 --- a/pages/go.vue +++ b/pages/go.vue @@ -107,12 +107,6 @@ export default { data () { return { color: 'red', - mountains: [ - { - slug: 'sluggy', - title: 'titly' - } - ], isSidebarVisible: false, isPickerVisible: false, airports_orig: [], diff --git a/pages/mtns.vue b/pages/mtns.vue deleted file mode 100644 index e4c5063..0000000 --- a/pages/mtns.vue +++ /dev/null @@ -1,20 +0,0 @@ - -