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

Add auto-reload functionality #140

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

rolando-valdivia
Copy link

This may address #98

Add dropdown menu at the top right of Index and Dashboard pages to provide simple auto-reload functionality.

Dropdown options are:

  • Don't Reload
  • 10 Sec
  • 30 Sec
  • 1 Min
  • 5 Min
  • 10 Min
  • 30 Min

Settings will persist in Local Storage

Screenshots

Screen Shot 2022-06-22 at 5 20 44 PM
Screen Shot 2022-06-22 at 5 20 13 PM
Screen Shot 2022-06-22 at 5 20 26 PM
.

@jemand771 jemand771 added the New Feature A New Feature label Jun 23, 2022
@jemand771
Copy link
Member

From just taking a quick glance at this, it looks really good, thanks :D

This PR has a lot of formatting changes to existing files, making the actual change a bit hard to see.
(Just as a small note; I don't really mind)
One place looks especially wonky, I'll add a review comment thingy there.

Also I didn't test this yet and it might take a bit for me to get around to do so ;c

Comment on lines +59 to +62
localStorage.setItem(
"settings",
JSON.stringify({ interval: this.interval })
);
Copy link
Member

Choose a reason for hiding this comment

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

how expandable is this? If this entry is just for autoupdate, maybe the name settings isn't ideal?
If we ever have any other settings in the future, this would overwrite them

}
},
updateSettings() {
localStorage.setItem(
Copy link
Member

Choose a reason for hiding this comment

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

also, what happens if the user has somehow blocked localstorage?
imo it would be fine if saving just silently failed to persist the settings but autoreload still worked

Comment on lines +22 to +38
<div
v-for="service in services_no_group"
v-bind:key="service.id"
class="list-group online_list mb-4"
>
<div class="list-group-item list-group-item-action">
<router-link class="no-decoration font-3" :to="serviceLink(service)"
>{{ service.name }}</router-link
>
<span
class="badge float-right"
:class="{
'bg-success': service.online,
'bg-danger': !service.online,
}"
>{{ service.online ? "ONLINE" : "OFFLINE" }}</span
>
Copy link
Member

Choose a reason for hiding this comment

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

this part has some wonky formatting

@adamboutcher
Copy link
Collaborator

Warning, I've not reviewed the code (I'm lazy I know...)

What happens for upgrades and the settings isn't yet set, does it default to "Dont Reload"?
Also should the reload icon have alt text? Does this need translations? Does "Dont reload" need translations or could this be someething we already have translated?

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

Successfully merging this pull request may close these issues.

None yet

3 participants