Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 100 additions & 0 deletions client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"format:check": "prettier --check src/"
},
"dependencies": {
"axios": "^1.7.7",
"pinia": "^2.2.6",
"vue": "^3.5.12",
"vue-router": "^4.4.5"
Expand Down
112 changes: 42 additions & 70 deletions client/src/App.vue
Original file line number Diff line number Diff line change
@@ -1,85 +1,57 @@
<script setup lang="ts">
import { RouterLink, RouterView } from 'vue-router'

Check failure on line 2 in client/src/App.vue

View workflow job for this annotation

GitHub Actions / Run ESLint

'RouterLink' is defined but never used

Check failure on line 2 in client/src/App.vue

View workflow job for this annotation

GitHub Actions / Run ESLint

'RouterView' is defined but never used
import HelloWorld from './components/HelloWorld.vue'

Check failure on line 3 in client/src/App.vue

View workflow job for this annotation

GitHub Actions / Run ESLint

'HelloWorld' is defined but never used
import { ref } from 'vue'
import server from './utils/server.ts'

const isLoading = ref(false)
const healthcheckMessage = ref('')

const handlePing = async () => {
isLoading.value = true
healthcheckMessage.value = '' // Clear previous messages

try {
const response = await server.get('/healthcheck/ping/')
healthcheckMessage.value = response.data
} catch (error) {

Check failure on line 17 in client/src/App.vue

View workflow job for this annotation

GitHub Actions / Run ESLint

'error' is defined but never used
healthcheckMessage.value = 'Failed to ping server'
} finally {
isLoading.value = false
}
}
</script>

<template>
<header>
<img alt="Vue logo" class="logo" src="@/assets/logo.svg" width="125" height="125" />

<div class="wrapper">
<HelloWorld msg="You did it!" />

<nav>
<RouterLink to="/">Home</RouterLink>
<RouterLink to="/about">About</RouterLink>
</nav>
</div>
</header>

<RouterView />
<div id="healthcheck">
<h1>Test Title</h1>
<button id="ping" @click="handlePing" :disabled="isLoading">
{{ isLoading ? 'Loading' : 'Ping' }}
</button>
<p>
Response from server: <span>{{ healthcheckMessage }}</span>
</p>
</div>
</template>

<style scoped>
header {
line-height: 1.5;
max-height: 100vh;
}

.logo {
display: block;
margin: 0 auto 2rem;
}

nav {
width: 100%;
font-size: 12px;
text-align: center;
margin-top: 2rem;
#healthcheck {
display: flex;
flex-direction: column;
place-items: center;
height: 80vh;
}

nav a.router-link-exact-active {
color: var(--color-text);
#ping {
background-color: var(--color-text);
color: var(--color-background);
border: none;
border-radius: 2px;
padding: 8px 16px;
margin: 8px;
}

nav a.router-link-exact-active:hover {
background-color: transparent;
}

nav a {
display: inline-block;
padding: 0 1rem;
border-left: 1px solid var(--color-border);
}

nav a:first-of-type {
border: 0;
}

@media (min-width: 1024px) {
header {
display: flex;
place-items: center;
padding-right: calc(var(--section-gap) / 2);
}

.logo {
margin: 0 2rem 0 0;
}

header .wrapper {
display: flex;
place-items: flex-start;
flex-wrap: wrap;
}

nav {
text-align: left;
margin-left: -1rem;
font-size: 1rem;

padding: 1rem 0;
margin-top: 1rem;
}
#ping:hover {
filter: brightness(80%);
}
</style>
2 changes: 1 addition & 1 deletion client/src/assets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ a,

#app {
display: grid;
grid-template-columns: 1fr 1fr;
/* grid-template-columns: 1fr 1fr; */
padding: 0 2rem;
}
}
4 changes: 4 additions & 0 deletions client/src/utils/server.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import axios from 'axios'

const server = axios.create({ baseURL: import.meta.env.VITE_BACKEND_URL })
export default server
Loading