diff --git a/quasar.config.js b/quasar.config.js index 03742e9..34a9798 100644 --- a/quasar.config.js +++ b/quasar.config.js @@ -79,8 +79,16 @@ module.exports = configure(function (/* ctx */) { // Full list of options: https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#devServer devServer: { - // https: true - open: true, // opens browser window automatically + // https: true, + // open: true, // opens browser window automatically + port: 4000, + strictport: true, + // For reverse-proxying via haproxy + hmr: { + clientPort: 443, + protocol: 'wss', + timeout: 0, + }, }, // https://v2.quasar.dev/quasar-cli-vite/quasar-config-js#framework diff --git a/src/assets/projectx_avatar.png b/src/assets/projectx_avatar.png new file mode 100644 index 0000000..91cd5a3 Binary files /dev/null and b/src/assets/projectx_avatar.png differ diff --git a/src/assets/projectx_avatar256.png b/src/assets/projectx_avatar256.png new file mode 100644 index 0000000..40345fd Binary files /dev/null and b/src/assets/projectx_avatar256.png differ diff --git a/src/assets/take5_avatar32.png b/src/assets/take5_avatar32.png new file mode 100644 index 0000000..c8e2e1f Binary files /dev/null and b/src/assets/take5_avatar32.png differ diff --git a/src/boot/appwrite.ts b/src/boot/appwrite.ts index 73cf5ae..a5d9462 100644 --- a/src/boot/appwrite.ts +++ b/src/boot/appwrite.ts @@ -23,7 +23,7 @@ const account = new Account(client); const databases = new Databases(client); let appRouter: Router; -export default boot(async ({ app, router }) => { +export default boot(async ({ router }) => { // Initialize store const authStore = useAuthStore(); await authStore.init(); diff --git a/src/components/ResourceScheduleViewerComponent.vue b/src/components/ResourceScheduleViewerComponent.vue new file mode 100644 index 0000000..b4a8b20 --- /dev/null +++ b/src/components/ResourceScheduleViewerComponent.vue @@ -0,0 +1,134 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/pages/IndexPage.vue b/src/pages/IndexPage.vue index 44b4bc9..1dd958b 100644 --- a/src/pages/IndexPage.vue +++ b/src/pages/IndexPage.vue @@ -8,7 +8,6 @@ :key="link.name" > import { links } from 'src/router/navlinks.js'; -import { useAuthStore } from 'stores/auth'; import ToolbarComponent from 'components/ToolbarComponent.vue'; - -const auth = useAuthStore(); diff --git a/src/pages/schedule/BoatReservationPage.vue b/src/pages/schedule/BoatReservationPage.vue index 8ba731d..2e0e3e0 100644 --- a/src/pages/schedule/BoatReservationPage.vue +++ b/src/pages/schedule/BoatReservationPage.vue @@ -1,165 +1,181 @@ - - - - - - - - - - - - - + + + + + + - - - - + + + + + + + + + + + + + + + + {{ scope.opt.name }} + {{ scope.opt.class }} + + + + This boat has defects. Select it to see details. + + + + + + + + + + This boat currently has the following defects: + + + {{ defect.description }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Booking Duration: {{ bookingDuration }} hours + + + diff --git a/src/pages/schedule/BoatScheduleView.vue b/src/pages/schedule/BoatScheduleView.vue new file mode 100644 index 0000000..1675e69 --- /dev/null +++ b/src/pages/schedule/BoatScheduleView.vue @@ -0,0 +1,8 @@ + + + + + + + diff --git a/src/pages/schedule/ScheduleIndexPage.vue b/src/pages/schedule/ScheduleIndexPage.vue index 0d82cca..f49a585 100644 --- a/src/pages/schedule/ScheduleIndexPage.vue +++ b/src/pages/schedule/ScheduleIndexPage.vue @@ -1,5 +1,27 @@ - + + + + + - + diff --git a/src/router/routes.ts b/src/router/routes.ts index ac73c46..ed7a90b 100644 --- a/src/router/routes.ts +++ b/src/router/routes.ts @@ -11,8 +11,9 @@ import IndexPageVue from 'src/pages/IndexPage.vue'; import ProfilePageVue from 'src/pages/ProfilePage.vue'; import TaskPageVue from 'src/pages/TaskPage.vue'; import { RouteRecordRaw } from 'vue-router'; -import BoatReservationPageVue from 'src/pages/schedule/BoatReservationPage.vue'; import SchedulePageView from 'pages/schedule/SchedulePageView.vue'; +import BoatReservationPageVue from 'src/pages/schedule/BoatReservationPage.vue'; +import BoatScheduleViewVue from 'src/pages/schedule/BoatScheduleView.vue'; const routes: RouteRecordRaw[] = [ { @@ -48,6 +49,11 @@ const routes: RouteRecordRaw[] = [ component: BoatReservationPageVue, name: 'reserve-boat', }, + { + path: 'view', + component: BoatScheduleViewVue, + name: 'boat-schedule', + }, ], }, { diff --git a/src/stores/boat.ts b/src/stores/boat.ts index ce6404f..3f3774c 100644 --- a/src/stores/boat.ts +++ b/src/stores/boat.ts @@ -3,11 +3,12 @@ import { defineStore } from 'pinia'; // const boatSource = null; export interface Boat { - id: number; + id: string; name: string; - class: string; - year: number; - imgsrc: string; + class?: string; + year?: number; + imgsrc?: string; + iconsrc?: string; booking?: { available: boolean; requiredCerts: string[]; @@ -18,27 +19,46 @@ export interface Boat { type: string; severity: string; description: string; - detail: string; + detail?: string; }[]; } const getSampleData = () => [ { - id: 1, + id: '1', name: 'ProjectX', class: 'J/27', year: 1981, imgsrc: '/src/assets/j27.png', + iconsrc: '/src/assets/projectx_avatar256.png', + defects: [ + { + type: 'engine', + severity: 'moderate', + description: 'Fuel line leaks at engine fitting.', + detail: `The gasket in the end of the fuel hose is damaged, and does not properly seal. +This will cause fuel to leak, and will allow air into the fuel chamber, causing a lean mixture, +and rough engine performance.`, + }, + { + type: 'rigging', + severity: 'moderate', + description: 'Tiller extension is broken.', + detail: + 'The tiller extension swivel is broken, and will not attach to the tiller.', + }, + ], }, { - id: 2, + id: '2', name: 'Take5', class: 'J/27', year: 1985, imgsrc: '/src/assets/j27.png', + iconsrc: '/src/assets/take5_avatar32.png', }, { - id: 3, + id: '3', name: 'WeeBeestie', class: 'Capri 25', year: 1989, diff --git a/src/stores/booking.ts b/src/stores/booking.ts new file mode 100644 index 0000000..70d250c --- /dev/null +++ b/src/stores/booking.ts @@ -0,0 +1,41 @@ +import { defineStore } from 'pinia'; +import { Boat } from './boat'; +import { reactive } from 'vue'; + +export type Booking = { + start: string; + title: string; + duration: number; + left?: number; + width?: number; +}; + +export const useBookingStore = defineStore('bookings', () => { + const bookings = reactive<{ [key: string]: Booking[] }>({ + 1: [ + { start: '06:00', title: 'John Smith', duration: 90 }, + { start: '12:00', title: 'Bob Barker', duration: 60 }, + ], + 2: [ + { start: '08:00', title: 'Peter Parker', duration: 120 }, + { start: '11:00', title: 'Vince McMahon', duration: 240 }, + ], + 3: [ + { start: '08:00', title: 'Heather Graham', duration: 240 }, + { start: '14:00', title: 'Lawrence Fishburne', duration: 60 }, + ], + }); + + // So nested... Trying to do something perhaps too complicated? + // const bookingsForResource = (boatid: string) => (bookings) => { + // return bookings.filter((booking: Booking) => booking.key == boatid ) + // } + // }, + + // actions: { + // increment () { + // this.counter++; + // } + // } + return { bookings }; +});