-
Notifications
You must be signed in to change notification settings - Fork 152
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tweaks to the Web interface #108
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
The index page and unused clients page have been updated to the new layout style |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM so far
A first version of the config page updates the layout, adds a loading spinner and disables the button disables while loading |
<form action="#" id="form"> | ||
<div class="mb-3"> | ||
<label for="input" class="form-label">PIN code</label> | ||
<input type="text" class="form-control form-control-lg" id="input" name="pin" placeholder="1234" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Making this a type="number" can help on mobile keyboard, since it will show only the numbers on smartphones
formElement.addEventListener("submit", (e) => { | ||
e.preventDefault(); | ||
submit.disabled = true; | ||
// TODO: Check for empty or null values |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required on PIN should be enough IIRC
submit.disabled = true; | ||
// TODO: Check for empty or null values | ||
const body = JSON.stringify({ pin: input.value }); | ||
fetch("/api/pin", { method: "POST", body }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we remove both is-valid and is-invalid before fetching? This way the feedback does not stay on screen while making multiple calls
</div> | ||
<div class="d-flex justify-content-between"> | ||
<input type="text" class="form-control monospace" v-model="detachedCmd"> | ||
<button class="btn btn-success mx-2" @click="editForm.detached.push(detachedCmd);detachedCmd = '';">+</button> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a :disabled="detatchedCmd.length == 0" in the button would avoid adding empty detatched commands
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks very good, only a few tweaks can be added that would improve the validation, but they are very minor. Thank you!
This pull request makes changes and tweaks to the Sunshine Web interface added in #89.
The first set of commits make technical changes, like updating Bootstrap and outputting valid HTML by adding missing tags for
body
andhtml
. A possible future commit would be to de-duplicate the imports of static files, allowing to import them once instead.The second set of changes will update the individual pages, both visually and logically, to make it easier for the user to navigate through the interface. This includes new headers with explicit titles and descriptions, put forward the actions the user probably wants to do, like adding an application and indicate to the users when things are loading by disabling buttons and showing spinners.
This pull request is still under active development, some pages are still being worked on like the Applications and Configuration pages.