Verified Commit 6886b93f authored by Jakob Moser's avatar Jakob Moser
Browse files

Automatically detect internal services

parent 0f5fa4cc
Loading
Loading
Loading
Loading
+4 −1
Changes for js/components/pieces/ServiceLink.mjs: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -7,7 +7,10 @@ export const ServiceLink = {
    view(vnode) {
        return [
            m("div.service", [
                m(BoxedButton, vnode.attrs),
                m(BoxedButton, {
                    ...vnode.attrs,
                    sameTab: !vnode.attrs.external,
                }),
                vnode.attrs.account &&
                    m(AccountRequired, { accountType: vnode.attrs.account }),
                vnode.attrs.unlockRequired && m(UnlockRequired),
+8 −0
Changes for js/model/Service.mjs: 8 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -14,4 +14,12 @@ export class Service {
        this.unlockRequired = unlockRequired
        this.passwordInVault = passwordInVault
    }

    /**
     * Return if the service is an external one, i.e., not a part of the portal web application.
     * This will be the case for almost all services.
     */
    get external() {
        return !!this.href.match(/^(https?:)?\/\/.*/)
    }
}