diff --git a/ui/src/App.vue b/ui/src/App.vue index 178e2e0..7418f66 100644 --- a/ui/src/App.vue +++ b/ui/src/App.vue @@ -17,7 +17,7 @@ import ManageApplications from './pages/ManageApplications.vue'; - + diff --git a/ui/src/api/application.ts b/ui/src/api/application.ts index 617818a..f1cf09f 100644 --- a/ui/src/api/application.ts +++ b/ui/src/api/application.ts @@ -50,7 +50,7 @@ export async function postApplication(val: any) { } export async function postChatMessage(val: any) { - + let output = { message: val, sender: 1, @@ -62,4 +62,30 @@ export async function postChatMessage(val: any) { headers: { 'Content-Type': 'application/json' }, body: JSON.stringify(output), }) +} + +export async function getAllApplications() { + const res = await fetch(`http://${addr}/application/all`) + + if (res.ok) { + return await res.json(); + } else { + console.error("Something went wrong approving the application") + } +} + +export async function approveApplication(id: Number) { + const res = await fetch(`http://${addr}/application/approve/${id}`, { method: 'POST' }) + + if (!res.ok) { + console.error("Something went wrong approving the application") + } +} + +export async function denyApplication(id: Number) { + const res = await fetch(`http://${addr}/application/deny/${id}`, { method: 'POST' }) + + if (!res.ok) { + console.error("Something went wrong approving the application") + } } \ No newline at end of file diff --git a/ui/src/assets/base.css b/ui/src/assets/base.css index 4ce345d..f17bed7 100644 --- a/ui/src/assets/base.css +++ b/ui/src/assets/base.css @@ -20,6 +20,8 @@ --accent-foreground: oklch(0.9243 0.1151 95.7459); --destructive: oklch(0.6368 0.2078 25.3313); --destructive-foreground: oklch(1.0000 0 0); + --success: oklch(66.104% 0.16937 144.153); + --success-foreground: oklch(1.0000 0 0); --border: oklch(0.3715 0 0); --input: oklch(0.3715 0 0); --ring: oklch(0.7686 0.1647 70.0804); @@ -67,6 +69,8 @@ --accent-foreground: oklch(0.9243 0.1151 95.7459); --destructive: oklch(0.6368 0.2078 25.3313); --destructive-foreground: oklch(1.0000 0 0); + --success: oklch(66.104% 0.16937 144.153); + --success-foreground: oklch(1.0000 0 0); --border: oklch(0.3715 0 0); --input: oklch(0.3715 0 0); --ring: oklch(0.7686 0.1647 70.0804); @@ -115,6 +119,8 @@ --color-accent-foreground: var(--accent-foreground); --color-destructive: var(--destructive); --color-destructive-foreground: var(--destructive-foreground); + --color-success: var(--success); + --color-success-foreground: var(--success-foreground); --color-border: var(--border); --color-input: var(--input); --color-ring: var(--ring); @@ -155,6 +161,7 @@ * { @apply border-border outline-ring/50; } + body { @apply bg-background text-foreground; } diff --git a/ui/src/components/ui/button/index.js b/ui/src/components/ui/button/index.js index 42138de..8e62be2 100644 --- a/ui/src/components/ui/button/index.js +++ b/ui/src/components/ui/button/index.js @@ -17,6 +17,8 @@ export const buttonVariants = cva( "bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80", ghost: "hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50", + success: + "bg-success text-success-foreground shadow-xs hover:bg-success/90", link: "text-primary underline-offset-4 hover:underline", }, size: { diff --git a/ui/src/pages/ManageApplications.vue b/ui/src/pages/ManageApplications.vue index 4616f92..a700dc0 100644 --- a/ui/src/pages/ManageApplications.vue +++ b/ui/src/pages/ManageApplications.vue @@ -1,4 +1,5 @@