diff --git a/api/tacticalrmm/agents/migrations/0054_alter_agent_goarch.py b/api/tacticalrmm/agents/migrations/0054_alter_agent_goarch.py new file mode 100644 index 00000000..d2f26e1c --- /dev/null +++ b/api/tacticalrmm/agents/migrations/0054_alter_agent_goarch.py @@ -0,0 +1,18 @@ +# Generated by Django 4.0.4 on 2022-06-06 04:03 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('agents', '0053_remove_agenthistory_status'), + ] + + operations = [ + migrations.AlterField( + model_name='agent', + name='goarch', + field=models.CharField(blank=True, choices=[('amd64', 'amd64'), ('386', '386'), ('arm64', 'arm64'), ('arm', 'arm')], max_length=255, null=True), + ), + ] diff --git a/api/tacticalrmm/agents/models.py b/api/tacticalrmm/agents/models.py index a791ff09..892fc11c 100644 --- a/api/tacticalrmm/agents/models.py +++ b/api/tacticalrmm/agents/models.py @@ -32,6 +32,7 @@ from tacticalrmm.constants import ( CheckType, CustomFieldType, DebugLogType, + GoArch, ) from tacticalrmm.models import PermissionQuerySet @@ -60,7 +61,9 @@ class Agent(BaseAuditModel): plat = models.CharField( max_length=255, choices=AgentPlat.choices, default=AgentPlat.WINDOWS ) - goarch = models.CharField(max_length=255, null=True, blank=True) + goarch = models.CharField( + max_length=255, choices=GoArch.choices, null=True, blank=True + ) hostname = models.CharField(max_length=255) agent_id = models.CharField(max_length=200, unique=True) last_seen = models.DateTimeField(null=True, blank=True) diff --git a/api/tacticalrmm/tacticalrmm/constants.py b/api/tacticalrmm/tacticalrmm/constants.py index e15b73c0..b9db0508 100644 --- a/api/tacticalrmm/tacticalrmm/constants.py +++ b/api/tacticalrmm/tacticalrmm/constants.py @@ -23,6 +23,13 @@ AGENT_STATUS_OFFLINE = "offline" AGENT_STATUS_OVERDUE = "overdue" +class GoArch(models.TextChoices): + AMD64 = "amd64", "amd64" + i386 = "386", "386" + ARM64 = "arm64", "arm64" + ARM32 = "arm", "arm" + + class CustomFieldModel(models.TextChoices): CLIENT = "client", "Client" SITE = "site", "Site"