mirror of
https://github.com/eduardogsilva/wireguard_webadmin.git
synced 2026-01-01 14:16:18 +00:00
Add active_peers and wireguard_status fields to WorkerStatus model
This commit is contained in:
18
cluster/migrations/0002_workerstatus_active_peers.py
Normal file
18
cluster/migrations/0002_workerstatus_active_peers.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.2.5 on 2025-08-15 00:54
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cluster', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='workerstatus',
|
||||
name='active_peers',
|
||||
field=models.PositiveIntegerField(default=0),
|
||||
),
|
||||
]
|
||||
18
cluster/migrations/0003_workerstatus_wireguard_status.py
Normal file
18
cluster/migrations/0003_workerstatus_wireguard_status.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.2.5 on 2025-08-15 00:55
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('cluster', '0002_workerstatus_active_peers'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='workerstatus',
|
||||
name='wireguard_status',
|
||||
field=models.JSONField(default=dict),
|
||||
),
|
||||
]
|
||||
@@ -41,7 +41,6 @@ class Worker(models.Model):
|
||||
city = models.CharField(max_length=100, blank=True, null=True)
|
||||
hostname = models.CharField(max_length=100, blank=True, null=True)
|
||||
|
||||
|
||||
updated = models.DateTimeField(auto_now=True)
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
uuid = models.UUIDField(default=uuid.uuid4, editable=False, unique=True)
|
||||
@@ -54,6 +53,8 @@ class WorkerStatus(models.Model):
|
||||
last_restart = models.DateTimeField(blank=True, null=True)
|
||||
config_version = models.PositiveIntegerField(default=0)
|
||||
config_pending = models.BooleanField(default=False)
|
||||
active_peers = models.PositiveIntegerField(default=0)
|
||||
wireguard_status = models.JSONField(default=dict)
|
||||
|
||||
updated = models.DateTimeField(auto_now=True)
|
||||
created = models.DateTimeField(auto_now_add=True)
|
||||
|
||||
Reference in New Issue
Block a user