Use Label when it exists

This commit is contained in:
nemunaire 2020-06-08 14:33:12 +02:00
parent 74f8a1c7b9
commit 29409dc607
5 changed files with 30 additions and 14 deletions

View File

@ -36,7 +36,7 @@
<b-tabs v-if="services[type] && services[type].tabs" content-class="mt-3" fill>
<b-tab v-for="(spec, index) in service_specs.fields" :key="index" :active="index === 0">
<template v-slot:title>
{{ spec.id }}
{{ spec | hLabel }}
<b-badge v-if="spec.type.substr(0,2) === '[]'" variant="light" pill>
{{ value[spec.id].length }}
</b-badge>

View File

@ -103,11 +103,20 @@ export default {
var ret = []
if (this.service_specs && this.service_specs.fields) {
this.service_specs.fields.forEach(function (sspec, idx) {
ret.push({
key: sspec.id,
sortable: true,
index: idx
})
if (sspec.label) {
ret.push({
key: sspec.id,
sortable: true,
index: idx,
label: sspec.label
})
} else {
ret.push({
key: sspec.id,
sortable: true,
index: idx
})
}
})
} else if (this.specs.label) {
ret.push({ key: 'value', label: this.specs.label })

View File

@ -137,6 +137,13 @@ Vue.prototype.escapeHTML = function (str) {
})
}
Vue.filter('hLabel', function (input) {
if (input.label) {
return input.label
} else {
return input.id
}
})
Vue.filter('nsclass', function (input) {
switch (input) {
case 1:

View File

@ -105,12 +105,12 @@ func (t *TLS_RPT) String() string {
}
type EMail struct {
MX []MX `json:"mx,omitempty"`
SPF *SPF `json:"spf,omitempty"`
DKIM map[string]*DKIM `json:"dkim,omitempty"`
DMARC *DMARC `json:"dmarc,omitempty"`
MTA_STS *MTA_STS `json:"mta_sts,omitempty"`
TLS_RPT *TLS_RPT `json:"tls_rpt,omitempty"`
MX []MX `json:"mx,omitempty" happydns:"label=EMail Servers"`
SPF *SPF `json:"spf,omitempty" happydns:"label=Sender Policy Framework"`
DKIM map[string]*DKIM `json:"dkim,omitempty" happydns:"label=Domain Keys"`
DMARC *DMARC `json:"dmarc,omitempty" happydns:"label=DMARC"`
MTA_STS *MTA_STS `json:"mta_sts,omitempty" happydns:"label=Strict Transport Security"`
TLS_RPT *TLS_RPT `json:"tls_rpt,omitempty" happydns:"label=TLS Reporting"`
}
func (s *EMail) GetNbResources() int {

View File

@ -44,8 +44,8 @@ import (
)
type TLSA struct {
Port uint16 `json:"port"`
Proto string `json:"proto"`
Proto string `json:"proto" happydns:"label=Protocol,description=Protocol used to establish the connection.,choices=tcp;udp"`
Port uint16 `json:"port" happydns:"label=Service Port,description=Port number where people will establish the connection."`
CertUsage uint8 `json:"certusage"`
Selector uint8 `json:"selector"`
MatchingType uint8 `json:"matchingtype"`