add creation date to deployment closes #340

This commit is contained in:
wh1te909 2021-03-26 06:58:36 +00:00
parent 82d9ca3317
commit 37d8360b77
4 changed files with 23 additions and 2 deletions

View File

@ -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),
),
]

View File

@ -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
)

View File

@ -100,4 +100,5 @@ class DeploymentSerializer(ModelSerializer):
"arch",
"expiry",
"install_flags",
"created",
]

View File

@ -37,6 +37,7 @@
><span v-if="props.row.arch === '64'">64 bit</span><span v-else>32 bit</span></q-td
>
<q-td key="expiry" :props="props">{{ props.row.expiry }}</q-td>
<q-td key="created" :props="props">{{ props.row.created }}</q-td>
<q-td key="flags" :props="props"
><q-badge color="grey-8" label="View Flags" />
<q-tooltip content-style="font-size: 12px">{{ props.row.install_flags }}</q-tooltip>
@ -58,7 +59,6 @@
</template>
<script>
import axios from "axios";
import mixins from "@/mixins/mixins";
import NewDeployment from "@/components/modals/clients/NewDeployment";
import { copyToClipboard } from "quasar";
@ -82,11 +82,12 @@ export default {
{ name: "mon_type", label: "Type", field: "mon_type", align: "left", sortable: true },
{ name: "arch", label: "Arch", field: "arch", align: "left", sortable: true },
{ name: "expiry", label: "Expiry", field: "expiry", align: "left", sortable: true },
{ name: "created", label: "Created", field: "created", align: "left", sortable: true },
{ name: "flags", label: "Flags", field: "install_flags", align: "left" },
{ name: "link", label: "Download Link", align: "left" },
{ name: "delete", label: "Delete", align: "left" },
],
visibleColumns: ["client", "site", "mon_type", "arch", "expiry", "flags", "link", "delete"],
visibleColumns: ["client", "site", "mon_type", "arch", "expiry", "created", "flags", "link", "delete"],
pagination: {
rowsPerPage: 50,