Full Syncthing tray wrapper with: - System tray with 5 icon states (idle/syncing/paused/error/disconnected) - Syncthing REST API client with auto-discovered API key - Long-polling event listener for real-time status - Transfer rate monitoring, folder tracking, recent files, conflict counting - Full context menu with folders, recent files, settings toggles - Embedded admin panel binary (webview, requires CGO) - OS notifications via beeep (per-event configurable) - Syncthing process management with auto-restart - Cross-platform installer with autostart - CI pipeline for Linux (.deb + .tar.gz) and Windows (.zip) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
35
internal/monitor/conflicts.go
Normal file
35
internal/monitor/conflicts.go
Normal file
@@ -0,0 +1,35 @@
|
||||
package monitor
|
||||
|
||||
import "sync"
|
||||
|
||||
// ConflictTracker counts sync conflicts across all folders.
|
||||
type ConflictTracker struct {
|
||||
mu sync.Mutex
|
||||
count int
|
||||
}
|
||||
|
||||
// NewConflictTracker creates a new conflict tracker.
|
||||
func NewConflictTracker() *ConflictTracker {
|
||||
return &ConflictTracker{}
|
||||
}
|
||||
|
||||
// SetCount updates the total conflict count.
|
||||
func (ct *ConflictTracker) SetCount(n int) {
|
||||
ct.mu.Lock()
|
||||
defer ct.mu.Unlock()
|
||||
ct.count = n
|
||||
}
|
||||
|
||||
// Increment adds to the conflict count.
|
||||
func (ct *ConflictTracker) Increment() {
|
||||
ct.mu.Lock()
|
||||
defer ct.mu.Unlock()
|
||||
ct.count++
|
||||
}
|
||||
|
||||
// Count returns the current conflict count.
|
||||
func (ct *ConflictTracker) Count() int {
|
||||
ct.mu.Lock()
|
||||
defer ct.mu.Unlock()
|
||||
return ct.count
|
||||
}
|
||||
Reference in New Issue
Block a user