Add check now button
This commit is contained in:
parent
266558bb15
commit
24b343d3f8
27
aocsync.py
27
aocsync.py
@ -2564,6 +2564,14 @@ class WebServer:
|
|||||||
thread.start()
|
thread.start()
|
||||||
return jsonify({'status': 'started', 'message': 'Refresh started for all repositories'})
|
return jsonify({'status': 'started', 'message': 'Refresh started for all repositories'})
|
||||||
|
|
||||||
|
@self.app.route('/api/sync/normal', methods=['POST'])
|
||||||
|
def sync_normal():
|
||||||
|
"""Trigger normal sync loop (without force)"""
|
||||||
|
thread = threading.Thread(target=self.sync.sync_all, kwargs={'force': False})
|
||||||
|
thread.daemon = True
|
||||||
|
thread.start()
|
||||||
|
return jsonify({'status': 'started', 'message': 'Normal sync started (will skip unchanged repositories)'})
|
||||||
|
|
||||||
@self.app.route('/api/refresh/repo/<repo_name>', methods=['POST'])
|
@self.app.route('/api/refresh/repo/<repo_name>', methods=['POST'])
|
||||||
def refresh_repo(repo_name):
|
def refresh_repo(repo_name):
|
||||||
"""Trigger refresh for a specific repository"""
|
"""Trigger refresh for a specific repository"""
|
||||||
@ -2731,8 +2739,9 @@ class WebServer:
|
|||||||
<h2>Refresh Controls</h2>
|
<h2>Refresh Controls</h2>
|
||||||
|
|
||||||
<div style="margin-bottom: 20px;">
|
<div style="margin-bottom: 20px;">
|
||||||
<h3 style="margin-bottom: 10px; color: #555;">Refresh All</h3>
|
<h3 style="margin-bottom: 10px; color: #555;">Sync All</h3>
|
||||||
<button onclick="refreshAll()" id="btn-refresh-all">🔄 Refresh All Repositories</button>
|
<button onclick="syncNormal()" id="btn-sync-normal" style="background: #28a745; margin-right: 10px;">▶️ Normal Sync (Skip Unchanged)</button>
|
||||||
|
<button onclick="refreshAll()" id="btn-refresh-all">🔄 Force Refresh All Repositories</button>
|
||||||
<div class="status" id="status-all"></div>
|
<div class="status" id="status-all"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -2780,6 +2789,20 @@ class WebServer:
|
|||||||
}, 5000);
|
}, 5000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async function syncNormal() {
|
||||||
|
const btn = document.getElementById('btn-sync-normal');
|
||||||
|
btn.disabled = true;
|
||||||
|
try {
|
||||||
|
const response = await fetch('/api/sync/normal', { method: 'POST' });
|
||||||
|
const data = await response.json();
|
||||||
|
showStatus('status-all', data.message || 'Normal sync started', false);
|
||||||
|
} catch (error) {
|
||||||
|
showStatus('status-all', 'Error: ' + error.message, true);
|
||||||
|
} finally {
|
||||||
|
btn.disabled = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function refreshAll() {
|
async function refreshAll() {
|
||||||
const btn = document.getElementById('btn-refresh-all');
|
const btn = document.getElementById('btn-refresh-all');
|
||||||
btn.disabled = true;
|
btn.disabled = true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user