-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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 refresh in widget settings #12127
Add refresh in widget settings #12127
Conversation
and need db correction:
but I don't know how do this in patch. and I understand that perhaps the solution is not the most beautiful... |
in: That's if i understand correctly. :) I just checked other PR's for the same / similar. |
@@ -45,7 +45,10 @@ public function update(Request $request, $widget_settings) | |||
]); | |||
} | |||
|
|||
$refresh=(!is_numeric($widget_settings["refresh"]) || (int)$widget_settings["refresh"] < 0 || (int)$widget_settings["refresh"] > 32767 ? 60 : $widget_settings["refresh"]); |
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.
This should be done in a validation rule above.
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.
'settings.refresh' => 'int|min:1|max:86400',
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.
ok, thanks. but I can't understand - I set not int value and after pressing save button I see empty red alert in upper right corner. what I haven't do yet?
@@ -45,7 +45,10 @@ public function update(Request $request, $widget_settings) | |||
]); | |||
} | |||
|
|||
$refresh=(!is_numeric($widget_settings["refresh"]) || (int)$widget_settings["refresh"] < 0 || (int)$widget_settings["refresh"] > 32767 ? 60 : $widget_settings["refresh"]); | |||
unset($widget_settings["refresh"]); |
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.
might as well unset _token
too
I suggest not using the "refresh" field, just put it in the settings json. Maybe even remove that field. |
You won't have an empty refresh issue if you call parent::getSettings() |
sorry, but I do not quite understand where to do it |
Update refresh at runtime (doesn't interrupt previous timeout)
@murrant thanks |
This pull request has been mentioned on LibreNMS Community. There might be relevant details there: https://community.librenms.org/t/v1-69-release-changelog-october-2020/13837/1 |
Please give a short description what your pull request is for
DO NOT DELETE THE UNDERLYING TEXT
Please note
Testers
If you would like to test this pull request then please run:
./scripts/github-apply <pr_id>
, i.e./scripts/github-apply 5926
After you are done testing, you can remove the changes with
./scripts/github-remove
. If there are schema changes, you can ask on discord how to revert.