Updates application version and status display
Increments the application's version number. Adds a display to the settings page to show the application version, number of users, and the connection status to qBittorrent. Improves connection status error handling, providing a better user experience.
This commit is contained in:
11
app.py
11
app.py
@@ -1,7 +1,7 @@
|
||||
# app.py
|
||||
|
||||
|
||||
local_version = "1.0.21"
|
||||
local_version = "1.0.22"
|
||||
|
||||
|
||||
|
||||
@@ -181,7 +181,7 @@ login_manager = LoginManager()
|
||||
login_manager.login_view = 'login'
|
||||
login_manager.init_app(app)
|
||||
logger = Logger(log_dir="instance/logs/", level="VERBOSE")
|
||||
|
||||
qb_connected = False
|
||||
|
||||
# ─── MODELS ────────────────────────────────────────────────────────────────────
|
||||
class User(db.Model, UserMixin):
|
||||
@@ -239,10 +239,11 @@ def version_check_loop():
|
||||
|
||||
# ─── QBITTORRENT POLLING ─────────────────────────────────────────────────────────
|
||||
def poll_torrents():
|
||||
global torrent_data, torrent_news, torrent_stats, bandwidth_history
|
||||
global torrent_data, torrent_news, torrent_stats, bandwidth_history, qb_connected
|
||||
prev_states = {}
|
||||
while True:
|
||||
try:
|
||||
qb_connected=True
|
||||
torrents = qb.torrents_info()
|
||||
updated, state_counter, new_events = [], Counter(), []
|
||||
total_progress = total_speed_down = total_speed_up = 0
|
||||
@@ -302,6 +303,7 @@ def poll_torrents():
|
||||
if len(torrent_news) > 100:
|
||||
torrent_news.pop()
|
||||
except Exception as e:
|
||||
qb_connected = False
|
||||
logger.error("qBittorrent Error:", e)
|
||||
|
||||
time.sleep(1)
|
||||
@@ -537,7 +539,8 @@ def settings():
|
||||
config=config,
|
||||
users=users,
|
||||
setting=setting,
|
||||
logs = logger.logs
|
||||
logs=logger.logs,
|
||||
qb_connected=qb_connected
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -130,6 +130,24 @@
|
||||
font-size: 0.9rem;
|
||||
margin-top: 0.5rem;
|
||||
}
|
||||
|
||||
.info-box {
|
||||
position: fixed;
|
||||
bottom: 1rem;
|
||||
right: 1rem;
|
||||
background: #1f1f1f;
|
||||
color: #ccc;
|
||||
font-size: 0.9rem;
|
||||
padding: 0.8rem 1.2rem;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0 0 10px rgba(0,0,0,0.4);
|
||||
z-index: 1000;
|
||||
line-height: 1.4;
|
||||
font-family: monospace;
|
||||
}
|
||||
|
||||
|
||||
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
@@ -244,5 +262,11 @@
|
||||
URL.revokeObjectURL(url);
|
||||
});
|
||||
</script>
|
||||
<div class="info-box">
|
||||
<strong>Version:</strong> {{ current_version }}<br>
|
||||
<strong>Users:</strong> {{ users | length }}<br>
|
||||
<strong>qBittorrent:</strong> {{ 'Connected' if qb_connected else 'Disconnected' }}
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -1 +1 @@
|
||||
1.0.21
|
||||
1.0.22
|
||||
Reference in New Issue
Block a user