OS update: add checkbox to confirm reading release notes before upgrading

This commit is contained in:
bergware
2023-06-22 21:14:56 +02:00
parent 1f0e326f81
commit 2e8ffa7dad
2 changed files with 13 additions and 5 deletions
@@ -163,12 +163,16 @@ foreach (glob($plugins,GLOB_NOSORT) as $plugin_link) {
} else {
$latest = plugin('version',$filename);
if ($os ? version_compare($latest,$version,'>') : strcmp($latest,$version) > 0) {
$version .= "<br><span class='red-text'>$latest</span>";
if ($os) {
$version = "<small>"._('I have read the release notes')."</small><input type='checkbox' onclick=\"$('#cmdUpdate').prop('disabled',!this.checked)\"><br><span class='red-text'>$latest</span>";
} else {
$version .= "<br><span class='red-text'>$latest</span>";
}
$error = null;
if ( ! $os && (version_compare(plugin("min",$filename,$error) ?: "1.0",$Unraid['version'],">") || version_compare(plugin("max",$filename,$error) ?: "999.9.9",$Unraid['version'],"<") ) ) {
if (!$os && (version_compare(plugin("min",$filename,$error) ?: "1.0",$Unraid['version'],">") || version_compare(plugin("max",$filename,$error) ?: "999.9.9",$Unraid['version'],"<"))) {
$status = "<span class='warning'><i class='fa fa-exclamation-triangle' aria-hidden='true'></i> "._("Update Incompatible")."</span>";
} else {
$status = make_link("update",basename($plugin_file));
$status = make_link("update",basename($plugin_file),$os?'cmdUpdate':'');
}
$changes_file = $filename;
if (!$os) $updates++;