Compare commits
4 Commits
9d64bd5756
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3ea91d9058 | ||
|
|
60a6342814 | ||
|
|
a1c71a967a | ||
|
|
662be26cc8 |
@@ -5,7 +5,7 @@
|
|||||||
# This project by default uses pnpm.
|
# This project by default uses pnpm.
|
||||||
# If you wish to use npm, delete "pnpm-lock.yaml" first.
|
# If you wish to use npm, delete "pnpm-lock.yaml" first.
|
||||||
|
|
||||||
# 1. pnpm (or npm) i # If you get gnu problems, use --force
|
# 1. pnpm (or npm) i # If you get GNU problems, use pnpm (or npm) i --force
|
||||||
# 2. pnpm (or npm) run build # Sit back while it compiles
|
# 2. pnpm (or npm) run build # Sit back while it compiles
|
||||||
# 3. sudo docker build . -t myapp:latest (replace 'myapp' to whatever tag you wanna give your image)
|
# 3. sudo docker build . -t myapp:latest (replace 'myapp' to whatever tag you wanna give your image)
|
||||||
|
|
||||||
@@ -13,7 +13,7 @@
|
|||||||
# Now you just need to create the container
|
# Now you just need to create the container
|
||||||
|
|
||||||
# Here is an example command for creating a container
|
# Here is an example command for creating a container
|
||||||
# sudo docker run -d --name myappcontainer --network host -e PORT=3001 myapp:latest
|
# sudo docker run -d --name myappcontainer --network host -e PORT=3000 myapp:latest
|
||||||
|
|
||||||
FROM node:22-alpine
|
FROM node:22-alpine
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|||||||
54
README.md
54
README.md
@@ -7,69 +7,37 @@ Look at the [Nuxt documentation](https://nuxt.com/docs/getting-started/introduct
|
|||||||
Make sure to install dependencies:
|
Make sure to install dependencies:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# npm
|
npm i -g pnpm # (updates your pnpm :D)
|
||||||
npm install
|
|
||||||
|
|
||||||
# pnpm
|
|
||||||
pnpm install
|
pnpm install
|
||||||
|
|
||||||
# yarn
|
|
||||||
yarn install
|
|
||||||
|
|
||||||
# bun
|
|
||||||
bun install
|
|
||||||
```
|
```
|
||||||
|
(this project uses PNPM)
|
||||||
|
|
||||||
## Development Server
|
## Development Server
|
||||||
|
|
||||||
Start the development server on `http://localhost:3000`:
|
Start the development server on `http://localhost:3000`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# npm
|
|
||||||
npm run dev
|
|
||||||
|
|
||||||
# pnpm
|
|
||||||
pnpm dev
|
pnpm dev
|
||||||
|
|
||||||
# yarn
|
|
||||||
yarn dev
|
|
||||||
|
|
||||||
# bun
|
|
||||||
bun run dev
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## Production
|
## Deployment
|
||||||
|
|
||||||
Build the application for production:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# npm
|
|
||||||
npm run build
|
|
||||||
|
|
||||||
# pnpm
|
|
||||||
pnpm build
|
pnpm build
|
||||||
|
|
||||||
# yarn
|
|
||||||
yarn build
|
|
||||||
|
|
||||||
# bun
|
|
||||||
bun run build
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Locally preview production build:
|
Locally preview production build:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# npm
|
|
||||||
npm run preview
|
|
||||||
|
|
||||||
# pnpm
|
|
||||||
pnpm preview
|
pnpm preview
|
||||||
|
|
||||||
# yarn
|
|
||||||
yarn preview
|
|
||||||
|
|
||||||
# bun
|
|
||||||
bun run preview
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Start the production server
|
||||||
|
```bash
|
||||||
|
node .output/server/index.mjs
|
||||||
|
```
|
||||||
|
|
||||||
|
### Check out the docker file to turn your app into a container for easy deployment!
|
||||||
|
|
||||||
|
|
||||||
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
|
Check out the [deployment documentation](https://nuxt.com/docs/getting-started/deployment) for more information.
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
|
import type { TableColumn } from "@nuxt/ui"
|
||||||
|
import { h } from 'vue'
|
||||||
|
|
||||||
definePageMeta({
|
definePageMeta({
|
||||||
layout: "dashboard"
|
layout: "dashboard"
|
||||||
});
|
});
|
||||||
@@ -23,7 +26,16 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
];
|
];
|
||||||
const table_demo = ref([
|
// create the object itself
|
||||||
|
type Payment = {
|
||||||
|
id: string,
|
||||||
|
date: string,
|
||||||
|
status: string,
|
||||||
|
email: string,
|
||||||
|
amount: number
|
||||||
|
|
||||||
|
}
|
||||||
|
const table_demo = ref<Payment[]>([
|
||||||
{
|
{
|
||||||
id: '4600',
|
id: '4600',
|
||||||
date: '2024-03-11T15:30:00',
|
date: '2024-03-11T15:30:00',
|
||||||
@@ -61,6 +73,51 @@
|
|||||||
}
|
}
|
||||||
])
|
])
|
||||||
|
|
||||||
|
const table_headers: TableColumn<Payment>[] = [
|
||||||
|
{
|
||||||
|
accessorKey: 'id',
|
||||||
|
header: "ID",
|
||||||
|
cell: ({ row }) => `#${row.getValue('id')}`
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: 'date',
|
||||||
|
header: "Date",
|
||||||
|
cell: ({ row }) => {
|
||||||
|
return new Date(row.getValue('date')).toLocaleString("pt-PT",{
|
||||||
|
day: "numeric",
|
||||||
|
month: "short",
|
||||||
|
hour: "2-digit",
|
||||||
|
minute: "2-digit",
|
||||||
|
hour12: false
|
||||||
|
})
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: 'status',
|
||||||
|
header: "Status",
|
||||||
|
cell: ({row}) => {
|
||||||
|
let color: string;
|
||||||
|
switch(row.getValue('status')){
|
||||||
|
case "paid":
|
||||||
|
color = "success"; break;
|
||||||
|
case "failed":
|
||||||
|
color = "error"; break;
|
||||||
|
case "refunded":
|
||||||
|
color = "warning"; break;
|
||||||
|
default:
|
||||||
|
color = "neutral";
|
||||||
|
}
|
||||||
|
return h(UBadge, { class: "capitalize", variant: "subtle", color },
|
||||||
|
() => row.getValue("status"))
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: 'amount',
|
||||||
|
header: "Ammount",
|
||||||
|
cell: ({ row }) => { return "€" + row.getValue('amount') }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
@@ -87,7 +144,7 @@
|
|||||||
</UPageGrid>
|
</UPageGrid>
|
||||||
|
|
||||||
|
|
||||||
<UTable :data="table_demo"/>
|
<UTable :data="table_demo" :columns="table_headers"/>
|
||||||
</UContainer>
|
</UContainer>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user