Implement tags since adding tags can crash the app on the netbox side

This commit is contained in:
Jeff Leung 2022-12-10 20:08:00 -08:00
parent f4be250595
commit 6b51a91685
2 changed files with 17 additions and 1 deletions

View File

@ -12,7 +12,7 @@
public string Name { get; set; }
public string Tenant { get; set; }
public string Description { get; set; }
public IList<string> Tags { get; set; }
public IList<Tag> Tags { get; set; }
public CustomFields CustomFields { get; set; }
public DateTime Created { get; set; }
public DateTime LastUpdated { get; set; }
@ -25,4 +25,14 @@
public object Previous { get; set; }
public IList<Result> Results { get; set; }
}
public class Tag
{
public int id { get; set; }
public string url { get; set; }
public string display { get; set; }
public string name { get; set; }
public string slug { get; set; }
public string color { get; set; }
}
}

View File

@ -13,12 +13,18 @@
<tr>
<th>Community Tag</th>
<th>Description</th>
<th>Community Type</th>
</tr>
</thead>
@foreach (var item in Model) {
<tr>
<td>@item.Name</td>
<td>@item.Description</td>
<td>
@foreach (var tags in item.Tags) {
<div class="d-inline-flex p-2 text-white" style="background-color:#@tags.color">@tags.display</div>
}
</td>
</tr>
}
</table>