Skip to content
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

Open
wants to merge 12 commits into
base: master
Choose a base branch
from

Conversation

jorys-paulin
Copy link
Contributor

@jorys-paulin jorys-paulin commented Jun 25, 2021

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 and html. 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.

@jorys-paulin
Copy link
Contributor Author

A first version for the PIN page makes the PIN input larger and removes the separate alerts in favour of in-form validation. This version also disables the button while the request is being made, and unlocks when that request succeeds or fails.

localhost_47990_pin

Copy link
Contributor

@TheElixZammuto TheElixZammuto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@jorys-paulin
Copy link
Contributor Author

A first version of the password page tweaks layout, rename the name of the page from password to credentials and disables the submit button while loading
localhost_47990_password

@jorys-paulin
Copy link
Contributor Author

The index page and unused clients page have been updated to the new layout style

Copy link
Contributor

@TheElixZammuto TheElixZammuto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM so far

@jorys-paulin
Copy link
Contributor Author

A first version of the config page updates the layout, adds a loading spinner and disables the button disables while loading

@jorys-paulin
Copy link
Contributor Author

A first partial version of the applications pages features a new list of applications and adds loading behavior to the create and save buttons. The actual form still needs tweaking and adding some form validation would also be nice to avoid creating apps without names.
localhost_47990_apps

@jorys-paulin jorys-paulin marked this pull request as ready for review July 29, 2021 10:02
<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"
Copy link
Contributor

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
Copy link
Contributor

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 })
Copy link
Contributor

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>
Copy link
Contributor

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

Copy link
Contributor

@TheElixZammuto TheElixZammuto left a 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants