-
Notifications
You must be signed in to change notification settings - Fork 12
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 #101 from Native-Planet/nallux_dev
v1.0.1-edge
- Loading branch information
Showing
11 changed files
with
302 additions
and
7 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
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,38 @@ | ||
<script> | ||
import { afterUpdate } from 'svelte' | ||
import { page } from '$app/stores' | ||
import Fa from 'svelte-fa' | ||
import { faBug } from '@fortawesome/free-solid-svg-icons' | ||
let hide = false, blur = false | ||
afterUpdate(()=> { | ||
hide = ($page.routeId == 'login') | ||
blur = ($page.routeId == 'report-issue') | ||
}) | ||
</script> | ||
|
||
<a href='/report-issue' class:hide={hide} class:blur={blur}> | ||
<div class="img"> | ||
<Fa icon={faBug} size="1.2x" /> | ||
</div> | ||
</a> | ||
|
||
<style> | ||
.blur { | ||
opacity: .3; | ||
pointer-events: none; | ||
} | ||
.hide { | ||
opacity: 0; | ||
pointer-events: none; | ||
} | ||
a { | ||
position:absolute; | ||
right: 0px; | ||
top: 3px; | ||
} | ||
.img {height: 24px; margin: 20px; color: white} | ||
</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
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,24 @@ | ||
/** @type {import('./$types').PageServerLoad} */ | ||
import { env } from '$env/dynamic/private' | ||
|
||
export const prerender = false; | ||
|
||
export function load({ cookies }) { | ||
const sessionid = cookies.get('sessionid'); | ||
|
||
let url = "http://" + env.HOST_HOSTNAME + ".local:27016" | ||
let query = 'http://127.0.0.1:27016/cookies?sessionid=' + sessionid | ||
|
||
let d = fetch(query, {credentials:"include"}) | ||
.then(j => j.json()) | ||
.then(r => {return {api:url,status:r}}) | ||
.catch(err => { | ||
console.log(err) | ||
if ((typeof err) == 'object') { | ||
err = 'noconn' | ||
} | ||
return {status:err} | ||
}) | ||
|
||
return d | ||
} |
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,129 @@ | ||
<script> | ||
import { onMount } from 'svelte' | ||
import Logo from '$lib/Logo.svelte' | ||
import Card from '$lib/Card.svelte' | ||
import PrimaryButton from '$lib/PrimaryButton.svelte' | ||
import { updateState, api } from '$lib/api' | ||
export let data | ||
updateState(data) | ||
let description = '', buttonStatus = 'standard', person = '' | ||
onMount(()=> { | ||
if (data['status'] == 404) { | ||
window.location.href = "/login" | ||
} | ||
}) | ||
const submitReport = () => { | ||
buttonStatus = 'loading' | ||
fetch($api + '/bug', { | ||
method: 'POST', | ||
credentials: "include", | ||
headers: {'Content-Type': 'application/json'}, | ||
body: JSON.stringify({'person':person,'message':description.trim()}) | ||
}) | ||
.then(raw => raw.json()) | ||
.then(res => { | ||
if (res == 200) { | ||
buttonStatus = 'success' | ||
setTimeout(()=> person = '', 3000) | ||
setTimeout(()=> description = '', 3000) | ||
} else { | ||
buttonStatus = 'failure' | ||
} | ||
setTimeout(()=> buttonStatus = 'standard', 3000) | ||
}) | ||
.catch(err => { | ||
console.log(err) | ||
buttonStatus = 'failure' | ||
setTimeout(()=> buttonStatus = 'standard', 3000) | ||
}) | ||
} | ||
</script> | ||
|
||
<Card width="540px"> | ||
<Logo t="Report an issue to Native Planet"/> | ||
<div class="disclaimer"> | ||
<div class="title">Information sent to Native Planet:</div> | ||
<ul> | ||
<li>GroundSeg logs</li> | ||
<li>StarTram information (if available)</li> | ||
<li>List of docker containers on your device</li> | ||
</ul> | ||
</div> | ||
<div class="input-title">How should we contact you?</div> | ||
<input type="text" bind:value={person} placeholder="~sampel-palnet or [email protected]" /> | ||
<div class="input-title">Describe your issue. Include as much information as you can:</div> | ||
<textarea bind:value={description} placeholder="eg. ~zod doesn't turn on when I try to toggle the switch.."/> | ||
<div class="submit"> | ||
<PrimaryButton | ||
on:click={submitReport} | ||
noMargin={true} | ||
status={(person.length > 0) && (description.length > 0) ? buttonStatus : "disabled"} | ||
standard="Submit Report" | ||
loading="Submitting your but report..." | ||
success="Bug report sent!" | ||
failure="Something went wrong" | ||
/> | ||
</div> | ||
</Card> | ||
|
||
<style> | ||
.title { | ||
font-size: 14px; | ||
} | ||
ul { | ||
font-size: 12px; | ||
margin: none; | ||
} | ||
.disclaimer { | ||
margin: 20px; | ||
} | ||
.input-title { | ||
font-size: 14px; | ||
} | ||
input { | ||
margin-top: 12px; | ||
margin-bottom: 24px; | ||
width: calc(100% - 40px); | ||
color: inherit; | ||
font-family: inherit; | ||
resize: none; | ||
background: #ffffff4d; | ||
border: none; | ||
border-radius: 8px; | ||
padding: 8px 20px 8px 20px; | ||
} | ||
input:focus { | ||
outline: none; | ||
} | ||
input::placeholder { | ||
color: inherit; | ||
} | ||
textarea { | ||
margin-top: 12px; | ||
width: calc(100% - 40px); | ||
color: inherit; | ||
font-family: inherit; | ||
height: 240px; | ||
resize: none; | ||
background: #ffffff4d; | ||
border: none; | ||
border-radius: 16px; | ||
padding: 20px; | ||
} | ||
textarea:focus { | ||
outline: none; | ||
} | ||
textarea::placeholder { | ||
color: inherit; | ||
} | ||
.submit { | ||
margin-top: 24px; | ||
text-align: center; | ||
} | ||
</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