-
Notifications
You must be signed in to change notification settings - Fork 24
feat(dataplanes): adds service links to outbound traffic cards #4256
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(dataplanes): adds service links to outbound traffic cards #4256
Conversation
✅ Deploy Preview for kuma-gui ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
ced6b4e
to
fb55a80
Compare
We could also do with this happening for this to be usable across all KRI linking (so not restricted to meshservice types) |
Couple of upstream issues that are relevant here that we wanted to link to: |
aa93bb5
to
4f31fd8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Notes:
packages/kuma-gui/src/app/connections/components/connection-traffic/ConnectionCard.vue
Show resolved
Hide resolved
Signed-off-by: John Cowen <[email protected]>
Signed-off-by: John Cowen <[email protected]>
Signed-off-by: John Cowen <[email protected]>
Signed-off-by: John Cowen <[email protected]>
Signed-off-by: John Cowen <[email protected]>
4f31fd8
to
9f9b190
Compare
Signed-off-by: John Cowen <[email protected]>
What
I think, but not totally sure that this closes #2848edit: It doesn't close it yet.At a high level this PR adds work to allow us to eventually addI removed where I was using this, but kept everything as I'm sure we will use this in the future and for other features.[Mesh*Service]:name
badges/links to the top-right of outbound traffic cards in the new KRI enabled Traffic view only.Note: this PR doesn't currently include the new badge/link above as we are awaiting kumahq/kuma#13882
At a lower level I had to/wanted to do a few things to make this generalized and easier to do at an application level (i.e. as an application engineer). This means making it easy to make a link from a KRI, by just writing:
and having things Just Work(tm)
Implementation
Browsers have a feature called
registerProtocolHandler
https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler, but it only works in a secure context i.e. HTTPS, something we can't guarantee ourselves. The implementation is loosely modelled on this idea.kri://blah_blah_blah_etc
into/mesh/name/mesh-services/name
ie. handle akri://
protocol and convert it into a normalhttp://
one. This leaves us with a<a/>
with a correct http URL, but this does not automatically get handled by vue's router.data-*
tagged links, i.e. its opt in, and we only currently use it for very specific links. The click handler prevents the default browser link that would not use the History API and instead passes it through to Vue's router, which does use the History API.msvc
should always go tomesh-service-detail-view
(we might need to be able to have multiple potential route names at some point in the future, but I have a plan to deal with that if we ever need to)Apart from this I made a few other changes to our Kri parser while I was here:
I rolled this back, we figure we should stick to the wordshortName
feels like something to do with the name of the thing, whereas its really the kind (a short name for the kind, but in the context of the KRI we don't have thelongKind
so I called it justkind
)shortName
as thats what the backend uses.I addedI moved this into the protocolHandler insteadid
which isname.namespace
(if namespace exists). We should always use this for linking like we do with our nonKRI'd resources.@/app/kuma
. If we want to turn all these things into proper packages, we should try and treat them as packages now, then there will be less to do when we move them out.Oh lastly, I put most of this into the
service-mesh
module just for ease and less plumbing, I would guess I will probably move this around a little at a later date and make it so you can add multiple protocolHandlers (i.e. compose them)P.S. I noticed reviewing will be a tiny bit easier if you "Hide Whitespace" in GH