Skip to content
Open
Show file tree
Hide file tree
Changes from 63 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
f31bf13
[feat] Add websockets for realtime upgrade progress tracking
youhaveme9 May 27, 2025
b450418
[merge] Merge master to this branch
youhaveme9 May 27, 2025
49aab20
[change] Added Batch Upgrade Consumer and publisher
youhaveme9 Jun 2, 2025
c6beca3
[feat] Add websockets for realtime upgrade progress tracking
youhaveme9 May 27, 2025
0798a7f
[change] Added Batch Upgrade Consumer and publisher
youhaveme9 Jun 2, 2025
38d70d6
[rebase] Rebase master
youhaveme9 Jun 2, 2025
c0e59d5
[tests] Added tests for batch upgarde progress consumers
youhaveme9 Jun 3, 2025
613c160
[chores] Formated test code with black
youhaveme9 Jun 3, 2025
734fe14
[change] Changed Mass upgrade device list to table
youhaveme9 Jun 11, 2025
feb12b3
[change] Integrated progress bar UI in single device upgrade
youhaveme9 Jun 17, 2025
3f51f1b
[change] Added Status and org filter for device upgrades in mass upgrade
youhaveme9 Jun 17, 2025
9360ca8
[debug] Debugged progress bar stuck at 5%
youhaveme9 Jun 21, 2025
bc83046
[change] Added realtime progress bar for device upgrade
youhaveme9 Jun 21, 2025
0e2db1f
[remove] Removed debugging files
youhaveme9 Jun 21, 2025
1567cf9
[remove] Removed redis dumps
youhaveme9 Jun 21, 2025
26d340b
[change] Changed InMemoryChannelLayer to RedisChannelLayer
youhaveme9 Jun 25, 2025
0f55c0e
[fix] Changed generic exception handling to specific exceptions
youhaveme9 Jul 2, 2025
622af91
[fix] Move WebSocket publishing logic to Django signals
youhaveme9 Jul 2, 2025
7f5df68
[chores] Removed redundant comments
youhaveme9 Jul 2, 2025
960e945
[chores] Fixed css sapcing issue and formatting
youhaveme9 Jul 2, 2025
f84f2f4
[fix] Reverted openwrt settings
youhaveme9 Jul 2, 2025
8e6c713
[fix] Removed spinner after upgrade logs
youhaveme9 Jul 6, 2025
e13be8c
[tests] Added tests for websockets consumer and publishers
youhaveme9 Jul 6, 2025
eae9aa1
[fix] Moved receiver functions to receiver.py
youhaveme9 Jul 9, 2025
1021d74
[chores] Formatted batch upgrade template
youhaveme9 Jul 9, 2025
a3dae4e
[change] Moved progress count logic from log lines to upgrade steps
youhaveme9 Jul 9, 2025
8ea0cb5
[fix] Fixed Device link color in batch upgrade page
youhaveme9 Jul 9, 2025
0c60e67
[fix] Remove progress bar from send command page
youhaveme9 Jul 9, 2025
bd18e4d
[tests] Added selenium tests for progress bar
youhaveme9 Jul 11, 2025
90e9f54
[change] Added lazy translation to websocket publishers
youhaveme9 Jul 16, 2025
baedecd
[test] Moved progress bar tests to test_selenium.py
youhaveme9 Jul 16, 2025
fd35f72
[test] Added tests for in-progress, aborting and multiple devices
youhaveme9 Jul 16, 2025
ad9798a
[fix] Removed fallback for progress calculation
youhaveme9 Jul 16, 2025
13881a4
[fix] Fixed spacing issue in progress bar
youhaveme9 Jul 16, 2025
25e3a4c
[fix] Fixed selenium tests and progress bar color
youhaveme9 Jul 22, 2025
1d62bef
[fix] Fixed reload issue when no upgrade found
youhaveme9 Jul 22, 2025
907f43c
[ci] Enabled ci on gsoc25 branch
youhaveme9 Jul 24, 2025
8462c1a
[fix] Added migrations for progress fields
youhaveme9 Jul 24, 2025
b1e5fd7
[test] Fixed sample app tests
youhaveme9 Jul 24, 2025
701bbc8
[fix] Fixed batch upgrade page css issue
youhaveme9 Jul 28, 2025
ab36ea6
[tests] Added tests for batch upgrade filters
youhaveme9 Jul 28, 2025
0266e0b
[fix] Fixed flashing issue in upgrade page refresh
youhaveme9 Jul 28, 2025
a945597
[test] Added selenium tests for websockets
youhaveme9 Aug 7, 2025
29176f2
[tests] Fixed selenium websockets tests
youhaveme9 Aug 17, 2025
1534e50
[tests] Merged progress bar UI tests with websocket tests
youhaveme9 Aug 17, 2025
5169fcc
[deps] Added pytest in test dependency
youhaveme9 Aug 17, 2025
5dca5a4
[tests] Optimizations for non-parallel tests
youhaveme9 Aug 17, 2025
d81be9e
[test] Fixed selenium websocket tests
youhaveme9 Aug 18, 2025
7012008
[ci] Enhanced ci for selenium tests
youhaveme9 Aug 18, 2025
f5e80b3
[test] Fixed selenium websocket tests
youhaveme9 Aug 18, 2025
8323d9a
[chores] Fixed QA errors
youhaveme9 Aug 18, 2025
d796430
[fix] Moved imports to top of the file
Aug 19, 2025
2969d52
[change] Changed progress bar behaviour for aborted and failed
youhaveme9 Aug 22, 2025
f8588bb
[docs] Added log update signal to docs
youhaveme9 Aug 22, 2025
eefa091
[chores] Fixed qa errors
youhaveme9 Aug 22, 2025
471497c
[change] Moved receiver function to UpgradeProgressPublisher class
youhaveme9 Aug 26, 2025
03edea2
[fix] Removed unnecessary timeouts in upgrade-progress.js
youhaveme9 Aug 26, 2025
eeb94b8
[merge] Merged gsoc25 to this branch
youhaveme9 Aug 26, 2025
49481ed
[change] Squashed migration 0013
youhaveme9 Aug 26, 2025
486cbb7
[change] Added progress bar UI for mass upgrade
youhaveme9 Aug 31, 2025
bbf6628
[feat] Added progress bar UI for mass upgrade
youhaveme9 Aug 31, 2025
643a4dd
[merge] Merge branch 'gsoc25' of https://github.com/openwisp/openwisp…
youhaveme9 Aug 31, 2025
d3101a0
[revert] Reverted unnecessary changes
youhaveme9 Aug 31, 2025
adf2b65
Merge branch 'gsoc25' of https://github.com/openwisp/openwisp-firmwar…
youhaveme9 Sep 12, 2025
78afd62
[fix] Fixed progress bar behaviour on failed and cancelled
youhaveme9 Sep 12, 2025
6ee7e46
[tests] Added selenium tests for mass upgrade
youhaveme9 Sep 12, 2025
7a2d3f6
[chores] Fixed QA errors
youhaveme9 Sep 12, 2025
9e4aa23
[test] Fixed selenium websocket tests
youhaveme9 Sep 12, 2025
f4bc9c3
[chores] Refactored code
youhaveme9 Sep 16, 2025
6367ba3
[merge] Merged gsoc25 to this branch
youhaveme9 Sep 16, 2025
df2271f
[fix] Fixed progress bar cancellation state
youhaveme9 Sep 16, 2025
b980273
[change] Added upgrade options and cancel button to upgrade details m…
youhaveme9 Sep 19, 2025
7e0b1fb
[chores] Refactored batch upgrade js code
Oct 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions openwisp_firmware_upgrader/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,7 @@ class UpgradeOperationAdmin(ReadOnlyAdmin, BaseAdmin):
readonly_fields = ["device", "image", "status", "log", "modified"]
ordering = ["-modified"]
fields = ["device", "image", "status", "log", "modified"]
change_form_template = "admin/firmware_upgrader/upgrade_operation_change_form.html"

def has_add_permission(self, request):
return False
Expand Down
12 changes: 11 additions & 1 deletion openwisp_firmware_upgrader/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,11 @@

from . import settings as app_settings
from .signals import firmware_upgrader_log_updated
from .websockets import DeviceUpgradeProgressPublisher, UpgradeProgressPublisher
from .websockets import (
BatchUpgradeProgressPublisher,
DeviceUpgradeProgressPublisher,
UpgradeProgressPublisher,
)


class FirmwareUpdaterConfig(ApiAppConfig):
Expand Down Expand Up @@ -78,12 +82,18 @@ def connect_device_signals(self):

def connect_upgrade_signals(self):
UpgradeOperation = load_model("firmware_upgrader", "UpgradeOperation")
BatchUpgradeOperation = load_model("firmware_upgrader", "BatchUpgradeOperation")

post_save.connect(
DeviceUpgradeProgressPublisher.handle_upgrade_operation_post_save,
sender=UpgradeOperation,
dispatch_uid="upgrade_operation.websocket_publish",
)
post_save.connect(
BatchUpgradeProgressPublisher.handle_batch_upgrade_operation_saved,
sender=BatchUpgradeOperation,
dispatch_uid="batch_upgrade_operation.websocket_publish",
)
firmware_upgrader_log_updated.connect(
UpgradeProgressPublisher.handle_upgrade_operation_log_updated,
dispatch_uid="firmware_upgrader.log_websocket_publish",
Expand Down
6 changes: 5 additions & 1 deletion openwisp_firmware_upgrader/base/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -577,9 +577,13 @@ def upgrade_operations(self):
def total_operations(self):
return self.upgrade_operations.count()

@property
def completed_operations(self):
return self.upgrade_operations.exclude(status="in-progress").count()

@property
def progress_report(self):
completed = self.upgrade_operations.exclude(status="in-progress").count()
completed = self.completed_operations
return _(f"{completed} out of {self.total_operations}")

@property
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,196 @@
border-bottom: 1px solid #e9ecef;
margin: 0;
}

.batch-progress-container {
background: #f8f9fa;
border: 1px solid #e9ecef;
border-radius: 8px;
padding: 20px;
margin: 20px 0;
}

.batch-progress-info {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}

.batch-status {
font-weight: 600;
font-size: 16px;
color: #333;
text-transform: capitalize;
}

.batch-progress-text {
font-size: 14px;
color: #666;
}

.batch-progress-bar {
height: 8px;
background-color: #e9ecef;
border-radius: 4px;
overflow: hidden;
position: relative;
}

.batch-progress-fill {
height: 100%;
transition: width 0.3s ease;
border-radius: 4px;
}

.batch-progress-fill.idle {
background-color: #6c757d;
}

.batch-progress-fill.in-progress {
background: linear-gradient(90deg, #007bff, #0056b3);
animation: progress-animation 2s infinite;
}

.batch-progress-fill.success,
.batch-progress-fill.completed-successfully {
background-color: #70bf2b;
}

.batch-progress-fill.failed {
background-color: #dc3545;
}

.status-cell {
width: 200px;
min-width: 200px;
}

.upgrade-status-container {
display: flex;
flex-direction: column;
gap: 4px;
align-items: flex-start;
}

.upgrade-status-container .upgrade-progress-bar {
width: 100%;
height: 10px;
background-color: #e9ecef;
border-radius: 3px;
overflow: hidden;
position: relative;
}

.upgrade-status-container .upgrade-progress-fill {
height: 100%;
transition: width 0.3s ease;
border-radius: 3px;
}

.upgrade-status-container .upgrade-progress-fill.in-progress {
background-color: #70bf2b;
}

.upgrade-status-container .upgrade-progress-fill.success,
.upgrade-status-container .upgrade-progress-fill.completed-successfully {
background-color: #70bf2b;
}

.upgrade-status-container .upgrade-progress-fill.failed {
background-color: #dc3545;
}

.upgrade-status-container .upgrade-progress-fill.aborted {
background-color: #6c757d;
}

.upgrade-status-container span {
font-size: 12px;
font-weight: 500;
}

.upgrade-status-container .upgrade-progress-text {
color: #666;
margin-top: 2px;
}

.upgrade-status-in-progress {
color: #70bf2b;
}

.upgrade-status-success,
.upgrade-status-completed-successfully {
color: #70bf2b;
}

.upgrade-status-failed {
color: #dc3545;
}

.upgrade-status-aborted {
color: #6c757d;
}

.upgrade-status-idle {
color: #6c757d;
}

.batch-main-progress {
display: flex;
align-items: center;
gap: 20px;
margin-left: 20px;
}

.batch-main-progress .upgrade-progress-bar {
width: 300px;
height: 12px;
background-color: #d9d9d9;
border-radius: 4px;
overflow: hidden;
border: 1px solid #ccc;
}

.batch-main-progress .upgrade-progress-fill {
height: 100%;
border-radius: 2px;
transition: width 0.5s ease;
}

.batch-main-progress .upgrade-progress-fill.idle {
background-color: #6c757d;
}

.batch-main-progress .upgrade-progress-fill.in-progress {
background-color: #70bf2b;
}

.batch-main-progress .upgrade-progress-fill.success,
.batch-main-progress .upgrade-progress-fill.completed-successfully {
background-color: #70bf2b;
}

.batch-main-progress .upgrade-progress-fill.failed {
background-color: #dc3545;
}

.batch-main-progress .upgrade-progress-text {
color: #000;
font-weight: bold;
font-size: 14px;
white-space: nowrap;
}

/* Progress Animation */
@keyframes progress-animation {
0% {
background-position: 0% 50%;
}
50% {
background-position: 100% 50%;
}
100% {
background-position: 0% 50%;
}
}
Loading
Loading