From 37d8360b771880ca11562edb5dbdf97a9c914f44 Mon Sep 17 00:00:00 2001 From: wh1te909 Date: Fri, 26 Mar 2021 06:58:36 +0000 Subject: [PATCH] add creation date to deployment closes #340 --- .../migrations/0012_deployment_created.py | 18 ++++++++++++++++++ api/tacticalrmm/clients/models.py | 1 + api/tacticalrmm/clients/serializers.py | 1 + web/src/components/Deployment.vue | 5 +++-- 4 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 api/tacticalrmm/clients/migrations/0012_deployment_created.py diff --git a/api/tacticalrmm/clients/migrations/0012_deployment_created.py b/api/tacticalrmm/clients/migrations/0012_deployment_created.py new file mode 100644 index 00000000..68fdffc8 --- /dev/null +++ b/api/tacticalrmm/clients/migrations/0012_deployment_created.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.7 on 2021-03-26 06:52 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('clients', '0011_auto_20210321_1511'), + ] + + operations = [ + migrations.AddField( + model_name='deployment', + name='created', + field=models.DateTimeField(auto_now_add=True, null=True), + ), + ] diff --git a/api/tacticalrmm/clients/models.py b/api/tacticalrmm/clients/models.py index 40bf43d6..7b2c2a84 100644 --- a/api/tacticalrmm/clients/models.py +++ b/api/tacticalrmm/clients/models.py @@ -226,6 +226,7 @@ class Deployment(models.Model): ) arch = models.CharField(max_length=255, choices=ARCH_CHOICES, default="64") expiry = models.DateTimeField(null=True, blank=True) + created = models.DateTimeField(auto_now_add=True, null=True, blank=True) auth_token = models.ForeignKey( "knox.AuthToken", related_name="deploytokens", on_delete=models.CASCADE ) diff --git a/api/tacticalrmm/clients/serializers.py b/api/tacticalrmm/clients/serializers.py index 2733e8f6..d1eb88a8 100644 --- a/api/tacticalrmm/clients/serializers.py +++ b/api/tacticalrmm/clients/serializers.py @@ -100,4 +100,5 @@ class DeploymentSerializer(ModelSerializer): "arch", "expiry", "install_flags", + "created", ] diff --git a/web/src/components/Deployment.vue b/web/src/components/Deployment.vue index 3e78ffd6..695602de 100644 --- a/web/src/components/Deployment.vue +++ b/web/src/components/Deployment.vue @@ -37,6 +37,7 @@ >64 bit32 bit {{ props.row.expiry }} + {{ props.row.created }} {{ props.row.install_flags }} @@ -58,7 +59,6 @@