Refactor software version update logic into a reusable function; enhance UI for file uploads and table responsiveness

This commit is contained in:
“VeLiTi”
2025-12-16 16:18:24 +01:00
parent a9f623cf22
commit 3693b52886
7 changed files with 243 additions and 72 deletions

View File

@@ -44,7 +44,7 @@ $filter_version_id = $_GET['from_version_id'] ?? $_GET['to_version_id'] ?? $_GET
if (isset($_GET['id']) && $_GET['id'] != '') {
$api_url = '/v2/products_software_upgrade_paths/rowID=' . $_GET['id'];
$response = ioServer($api_url, '');
var_dump($response);
if (!empty($response)) {
$existing = json_decode($response);
if (!empty($existing)) {
@@ -145,7 +145,7 @@ if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$api_url = '/v2/products_software_upgrade_paths/';
$result = ioServer($api_url, json_encode($data));
if ($result) {
if ($result !== 'NOK') {
$success = isset($_POST['delete']) ? 3 : (isset($_POST['rowID']) && $_POST['rowID'] != '' ? 2 : 1);
header('Location: ' . $url . '&success_msg=' . $success);
exit;