-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from codersforcauses/issue-1-Add_healthcheck_pa…
…ge_to_replace_defailt_Vue_page_huxley_modifications Issue 1 add healthcheck page to replace defailt vue page huxley modifications
- Loading branch information
Showing
10 changed files
with
167 additions
and
113 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
APP_ENV=DEVELOPMENT | ||
VITE_BACKEND_URL="http://localhost:8000/api" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,9 @@ | ||
<script setup lang="ts"> | ||
import { RouterLink, RouterView } from 'vue-router' | ||
import HelloWorld from './components/HelloWorld.vue' | ||
import { RouterView } from 'vue-router' | ||
</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 /> | ||
</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; | ||
} | ||
nav a.router-link-exact-active { | ||
color: var(--color-text); | ||
} | ||
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; | ||
} | ||
} | ||
</style> | ||
<style></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, timeout: 8000 }) | ||
export default server |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,55 @@ | ||
<script setup lang="ts"> | ||
import TheWelcome from '../components/TheWelcome.vue' | ||
import { ref } from 'vue' | ||
import server from '@/utils/server' | ||
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 { | ||
healthcheckMessage.value = 'Failed to ping server' | ||
} finally { | ||
isLoading.value = false | ||
} | ||
} | ||
</script> | ||
|
||
<template> | ||
<main> | ||
<TheWelcome /> | ||
</main> | ||
<div id="healthcheck"> | ||
<h1>Healthcheck</h1> | ||
<button id="ping" @click="handlePing" :disabled="isLoading"> | ||
{{ isLoading ? 'Loading' : 'Ping' }} | ||
</button> | ||
<p> | ||
Response from server: <span>{{ healthcheckMessage }}</span> | ||
</p> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
#healthcheck { | ||
display: flex; | ||
flex-direction: column; | ||
place-items: center; | ||
height: 80vh; | ||
} | ||
#ping { | ||
background-color: var(--color-text); | ||
color: var(--color-background); | ||
border: none; | ||
border-radius: 2px; | ||
padding: 8px 16px; | ||
margin: 8px; | ||
} | ||
#ping:hover { | ||
filter: brightness(80%); | ||
} | ||
</style> |