diff --git a/.forgejo/workflows/build.yml b/.forgejo/workflows/build.yml index b3bbb18..6aba9fc 100644 --- a/.forgejo/workflows/build.yml +++ b/.forgejo/workflows/build.yml @@ -58,20 +58,20 @@ jobs: push: ${{ github.event_name != 'pull_request' }} tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} - - name: Extract Binary For Release - uses: https://github.com/moosetheory/actions-docker-extract@v3.1 - id: extract - if: startsWith(github.ref, 'refs/tags/') - with: - shell_command: /bin/ash -c - image: ${{ fromJSON(steps.meta.outputs.json).tags[0] }} - path: /dist - destination: dist - - name: Create a Release - uses: https://forgejo.merr.is/actions/forgejo-release@alpinev1 - if: startsWith(github.ref, 'refs/tags/') - with: - direction: upload - release-dir: dist - token: ${{ secrets.ADMIN_TOKEN }} + # - name: Extract Binary For Release + # uses: https://github.com/moosetheory/actions-docker-extract@v3.1 + # id: extract + # if: startsWith(github.ref, 'refs/tags/') + # with: + # shell_command: /bin/ash -c + # image: ${{ fromJSON(steps.meta.outputs.json).tags[0] }} + # path: /usr/share/nginx/html + # destination: dist + # - name: Create a Release + # uses: https://forgejo.merr.is/actions/forgejo-release@alpinev1 + # if: startsWith(github.ref, 'refs/tags/') + # with: + # direction: upload + # release-dir: dist + # token: ${{ secrets.ADMIN_TOKEN }} diff --git a/Dockerfile b/Dockerfile index 7b34b52..82032c6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,6 +22,10 @@ COPY . . # [optional] tests & build ENV NODE_ENV=production +# I can't run the type checking because of some sort of issue with +# bun and vue-tsc. +# see https://github.com/oven-sh/bun/issues/4754 +# RUN bunx --bun vue-tsc --build --force RUN bunx --bun vite build # Copy the distribution folder into the final image. diff --git a/Dockerfile.dev b/Dockerfile.dev deleted file mode 100644 index f25be24..0000000 --- a/Dockerfile.dev +++ /dev/null @@ -1,31 +0,0 @@ -# This is making minimal changes from the guide at -# https://bun.sh/guides/ecosystem/docker (as of 2024-02-04) - -# use the official Bun image -# see all versions at https://hub.docker.com/r/oven/bun/tags -FROM oven/bun:1-alpine as base -WORKDIR /app - -# install dependencies into temp directory -# this will cache them and speed up future builds -FROM base as install -RUN mkdir -p /tmp/dev -COPY package.json bun.lockb /temp/dev/ -RUN cd /temp/dev && bun install --frozen-lockfile - -# install with --production (exclude devDependencies) -RUN mkdir -p /temp/prod -COPY package.json bun.lockb /temp/prod/ -RUN cd /temp/prod && bun install --frozen-lockfile --production -# ^ Is this necessary? Don't we either need prod or not prod? - -# copy node_modules from temp directory -# then copy all (non-ignored) project files into the image -FROM base AS prerelease -COPY --from=install /temp/dev/node_modules node_modules -COPY . . - -FROM nginx:stable-alpine as release - -COPY --from=build-stage /app/docker/nginx.conf /etc/nginx/nginx.conf -COPY --from=build-stage /app/dist /usr/share/nginx/html diff --git a/bun.lockb b/bun.lockb index 6e01c21..39c0ac4 100755 Binary files a/bun.lockb and b/bun.lockb differ diff --git a/package.json b/package.json index b08cacf..5323011 100644 --- a/package.json +++ b/package.json @@ -15,9 +15,11 @@ }, "dependencies": { "axios": "^1.6.5", + "axios-retry": "^4.0.0", + "oidc-client-ts": "^3.0.1", "pinia": "^2.1.7", - "sass": "^1.69.7", "vue": "^3.3.11", + "vue-oidc-client": "^1.0.0-alpha.5", "vue-router": "^4.2.5", "vuetify": "^3.4.10" }, @@ -41,6 +43,8 @@ "typescript": "~5.3.0", "vite": "^5.0.10", "vitest": "^1.0.4", - "vue-tsc": "^1.8.25" + "vue-tsc": "^1.8.25", + "sass": "^1.69.7", + "vite-plugin-vuetify": "^2.0.1" } } diff --git a/public/config.json b/public/config.json new file mode 100644 index 0000000..e89a2f4 --- /dev/null +++ b/public/config.json @@ -0,0 +1,6 @@ +{ + "apiBaseURL": "http://coder.local.merr.is:3001", + "oidcAuthority": "https://auth.joes.moosenet.work", + "oidcClientID": "255988227184328707@isekai:_slow_life_calculator", + "oidcProjectID": "255987963094106115" +} \ No newline at end of file diff --git a/src/App.vue b/src/App.vue index 63d145c..5248187 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,25 +1,13 @@ - + Copyright Annika Merris 2024 diff --git a/src/components/GlobalHeader.vue b/src/components/GlobalHeader.vue index fd1edfb..4ae83ce 100644 --- a/src/components/GlobalHeader.vue +++ b/src/components/GlobalHeader.vue @@ -1,7 +1,22 @@ @@ -25,5 +40,11 @@ const drawer = ref(false) Intimacy Power + + + Logout + Login + + diff --git a/src/components/NewItemForm.vue b/src/components/NewItemForm.vue new file mode 100644 index 0000000..63fa5d6 --- /dev/null +++ b/src/components/NewItemForm.vue @@ -0,0 +1,213 @@ + + + + + + + + Add New Item + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Submit + Clear + + + + + + diff --git a/src/components/SpecialItemsCard.vue b/src/components/SpecialItemsCard.vue index 7677514..7c3b14c 100644 --- a/src/components/SpecialItemsCard.vue +++ b/src/components/SpecialItemsCard.vue @@ -1,72 +1,82 @@ - + Special Items Items from events @@ -151,9 +169,9 @@ toggle() density="compact" v-model:sort-by="sortBy" :items="filteredItems" - :headers="headers" + :headers="computedHeaders" > - + - {{ item?.[1].origin }} - + {{ item[1].origin }} - + - + - + {{ item[1].minItemPower * item[1].owned }} - + {{ item[1].maxItemPower * item[1].owned }} - + {{ ((item[1].minItemPower + item[1].maxItemPower) / 2) * item[1].owned }} diff --git a/src/components/StandardItemsCard.vue b/src/components/StandardItemsCard.vue index 3a4382b..a36ae0d 100644 --- a/src/components/StandardItemsCard.vue +++ b/src/components/StandardItemsCard.vue @@ -1,7 +1,14 @@ - + Standard Items Items that exist all the time @@ -77,7 +92,7 @@ const getColor = computed(() => (rarity: number): string => { :items="[...items.entries()]" :headers="headers" > - + (rarity: number): string => { - + (rarity: number): string => { {{ item[1].itemName }} - + (rarity: number): string => { @update:model-value="usePowerItems().updateOwned(item[0], item[1].owned)" > - + {{ item[1].minItemPower * item[1].owned }} diff --git a/src/components/SummaryCard.vue b/src/components/SummaryCard.vue index 48e4f0d..69a681b 100644 --- a/src/components/SummaryCard.vue +++ b/src/components/SummaryCard.vue @@ -1,11 +1,12 @@ - + Blessing Power @@ -34,6 +44,7 @@ const { /> { + if (standardFellowItems.value.keys().next().done) { + usePowerItems().fetchFellowItems() + } + if (specialFellowItems.value.keys().next().done) { + usePowerItems().fetchFellowItems() + } +}) - + Fellow Power @@ -33,6 +43,7 @@ const { :average-total="specialFellowItemsAveTotal" /> { + if (standardIntimacyItems.value.keys().next().done) { + usePowerItems().fetchIntimacyItems() + } + if (specialIntimacyItems.value.keys().next().done) { + usePowerItems().fetchIntimacyItems() + } +}) - + Intimacy Power @@ -33,6 +43,7 @@ const { :average-total="specialIntimacyItemsAveTotal" /> + + + This is a login-protected page + + The following profile data is extended by information from ZITADELs userinfo endpoint. + + + + + {{ c.key }}: {{ c.value }} + + + + + Sign Out + + + + + + diff --git a/src/views/NoAccess.vue b/src/views/NoAccess.vue new file mode 100644 index 0000000..d1c9e80 --- /dev/null +++ b/src/views/NoAccess.vue @@ -0,0 +1,22 @@ + + + + + Access denied + + + You don't have the role "admin" in your ZITADEL project. + + + + + + \ No newline at end of file diff --git a/src/views/PostLoginView.vue b/src/views/PostLoginView.vue new file mode 100644 index 0000000..3f9cbf3 --- /dev/null +++ b/src/views/PostLoginView.vue @@ -0,0 +1,10 @@ + + + + Hi mom + diff --git a/src/views/Test.vue b/src/views/Test.vue deleted file mode 100644 index 02e58f4..0000000 --- a/src/views/Test.vue +++ /dev/null @@ -1,52 +0,0 @@ - - - - - Intimacy Power - - - - - - - - - - - diff --git a/src/views/TestView.vue b/src/views/TestView.vue new file mode 100644 index 0000000..b5b51fd --- /dev/null +++ b/src/views/TestView.vue @@ -0,0 +1,12 @@ + + + + + + + + + diff --git a/vite.config.ts b/vite.config.ts index 5c45e1d..24a6d02 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -2,11 +2,13 @@ import { fileURLToPath, URL } from 'node:url' import { defineConfig } from 'vite' import vue from '@vitejs/plugin-vue' +import vuetify from 'vite-plugin-vuetify' // https://vitejs.dev/config/ export default defineConfig({ plugins: [ vue(), + vuetify(), ], resolve: { alias: {
+