Skip to content

Commit

Permalink
fix(*) fix wrong dp type (#175)
Browse files Browse the repository at this point in the history
Signed-off-by: Tomasz Wylężek <tomwylezek@gmail.com>
  • Loading branch information
tomaszwylezek authored Jul 9, 2021
1 parent ed6d25b commit a87347d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 38 deletions.
3 changes: 0 additions & 3 deletions src/views/Entities/GatewayDataplanes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ export default {
gateway: true,
},
emptyStateMsg: 'There are no Gateway data plane proxies present.',
getDataplaneType () {
return 'Gateway'
},
}
},
}
Expand Down
6 changes: 0 additions & 6 deletions src/views/Entities/StandardDataplanes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
<div class="standard-dataplanes">
<Dataplanes
:dataplane-api-params="{ gateway: false, ingress: false }"
:get-dataplane-type="getDataplaneType"
empty-state-msg="There are no Standard data plane proxies present."
/>
</div>
Expand All @@ -19,10 +18,5 @@ export default {
components: {
Dataplanes,
},
methods: {
getDataplaneType () {
return 'Standard'
}
},
}
</script>
46 changes: 17 additions & 29 deletions src/views/Entities/partial/Dataplanes.vue
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ import {
checkKumaDpAndZoneVersionsMismatch, checkVersionsCompatibility,
dpTags,
getDataplane,
getDataplaneInsight, getDataplaneType,
getDataplaneInsight,
getDataplaneType,
getStatus,
parseMTLSData,
COMPATIBLE,
INCOMPATIBLE_UNSUPPORTED_ENVOY,
INCOMPATIBLE_UNSUPPORTED_KUMA_DP, INCOMPATIBLE_ZONE_CP_AND_KUMA_DP_VERSIONS, INCOMPATIBLE_WRONG_FORMAT,
Expand Down Expand Up @@ -245,10 +245,6 @@ export default {
return {}
},
},
getDataplaneType: {
type: Function,
default: getDataplaneType,
},
tableHeaders: {
type: Array,
default () {
Expand Down Expand Up @@ -291,22 +287,6 @@ export default {
]
},
},
buildEntity: {
type: Function,
default (basicData, tags, dataplaneInsight) {
const mtls = dataplaneInsight.mTLS
? parseMTLSData(dataplaneInsight.mTLS)
: null
return { basicData, tags, mtls }
}
},
addDataFields: {
type: Function,
default () {
return {}
}
},
showMtls: {
type: Boolean,
default: true,
Expand Down Expand Up @@ -392,6 +372,13 @@ export default {
},
methods: {
...mapActions(['fetchSupportedVersions']),
buildEntity (basicData, tags, dataplaneInsight) {
const mtls = dataplaneInsight.mTLS
? parseMTLSData(dataplaneInsight.mTLS)
: null
return { basicData, tags, mtls }
},
init () {
this.loadData()
},
Expand Down Expand Up @@ -567,8 +554,7 @@ export default {
unsupportedEnvoyVersion: false,
unsupportedKumaDPVersion: false,
kumaDpAndKumaCpMismatch: false,
type: this.getDataplaneType(),
...this.addDataFields(dataplane),
type: getDataplaneType(dataplane),
}
const { kind } = this.checkVersionsCompatibility(dpVersion, envoyVersion)
Expand Down Expand Up @@ -618,7 +604,7 @@ export default {
try {
const response = await endpoint()
const items = () => {
const getItems = () => {
const r = response
if ('total' in r) {
Expand All @@ -632,7 +618,9 @@ export default {
return r
}
if (items()) {
const items = getItems()
if (items) {
// check to see if the `next` url is present
if (response.next) {
this.next = getOffset(response.next)
Expand All @@ -643,8 +631,8 @@ export default {
const final = []
const itemSelect = query
? items()
: items()[0]
? items
: items[0]
// set the first item as the default for initial load
this.firstEntity = itemSelect.name
Expand All @@ -658,7 +646,7 @@ export default {
if ((query && query.length) && (mesh && mesh.length)) {
await dpFetcher(mesh, query, final)
} else {
const promises = items().map(item => dpFetcher(item.mesh, item.name, final))
const promises = items.map(item => dpFetcher(item.mesh, item.name, final))
await Promise.all(promises)
}
Expand Down

0 comments on commit a87347d

Please sign in to comment.