mirror of
https://github.com/unraid/webgui.git
synced 2026-05-06 20:30:50 -05:00
OS update: add checkbox to confirm reading release notes before upgrading
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<?PHP
|
||||
/* Copyright 2005-2022, Lime Technology
|
||||
* Copyright 2012-2022, Bergware International.
|
||||
/* Copyright 2005-2023, Lime Technology
|
||||
* Copyright 2012-2023, Bergware International.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License version 2,
|
||||
@@ -36,6 +36,10 @@ function make_link($method, $arg, $extra='') {
|
||||
$id = str_replace(['.',' ','_'],'',$plg);
|
||||
$check = $method=='remove' ? "<input type='checkbox' data='$arg' class='remove' onClick='document.getElementById(\"$id\").disabled=!this.checked;multiRemove()'>" : "";
|
||||
$disabled = $check ? ' disabled' : '';
|
||||
if ($method == 'update' && $extra) {
|
||||
$disabled = 'disabled';
|
||||
$id = $extra;
|
||||
}
|
||||
if ($method == 'delete') {
|
||||
$cmd = "plugin_rm $arg";
|
||||
$func = "refresh";
|
||||
|
||||
@@ -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++;
|
||||
|
||||
Reference in New Issue
Block a user