feat: add firmware versioning and device_type support (NebuleAir/ModuleAir)
- Add VERSION file (1.0.0) and changelog.json for firmware tracking - Add device_type config param (nebuleair_pro default, backward compatible via INSERT OR IGNORE) - Add device_type select in admin.html Protected Settings - Add version badge and changelog modal in Updates section - Add get_firmware_version and get_changelog PHP endpoints - Display firmware version in update_firmware.sh after git pull Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1515,6 +1515,47 @@ if ($type == "detect_envea_device") {
|
||||
|___/
|
||||
*/
|
||||
|
||||
// Get firmware version from VERSION file
|
||||
if ($type == "get_firmware_version") {
|
||||
$versionFile = '/var/www/nebuleair_pro_4g/VERSION';
|
||||
if (file_exists($versionFile)) {
|
||||
$version = trim(file_get_contents($versionFile));
|
||||
echo json_encode([
|
||||
'success' => true,
|
||||
'version' => $version
|
||||
]);
|
||||
} else {
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'version' => 'unknown'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// Get changelog from changelog.json
|
||||
if ($type == "get_changelog") {
|
||||
$changelogFile = '/var/www/nebuleair_pro_4g/changelog.json';
|
||||
if (file_exists($changelogFile)) {
|
||||
$changelog = json_decode(file_get_contents($changelogFile), true);
|
||||
if ($changelog !== null) {
|
||||
echo json_encode([
|
||||
'success' => true,
|
||||
'changelog' => $changelog
|
||||
]);
|
||||
} else {
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'error' => 'Invalid changelog format'
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
echo json_encode([
|
||||
'success' => false,
|
||||
'error' => 'Changelog file not found'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
// Get current CPU power mode
|
||||
if ($type == "get_cpu_power_mode") {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user