2021-03-27 21:06:42 +00:00
|
|
|
import "../elements/messages/MessageContainer";
|
2021-05-05 17:14:37 +00:00
|
|
|
import { customElement, html, TemplateResult } from "lit-element";
|
2021-03-08 10:14:00 +00:00
|
|
|
import { me } from "../api/Users";
|
2021-03-01 09:32:25 +00:00
|
|
|
import { ID_REGEX, SLUG_REGEX, UUID_REGEX } from "../elements/router/Route";
|
2020-12-02 12:56:26 +00:00
|
|
|
import { Interface } from "./Interface";
|
2021-04-03 17:07:11 +00:00
|
|
|
import "./locale";
|
2021-05-05 17:14:37 +00:00
|
|
|
import "../elements/sidebar/SidebarItem";
|
2021-04-03 17:59:22 +00:00
|
|
|
import { t } from "@lingui/macro";
|
2020-12-02 12:56:26 +00:00
|
|
|
|
2020-12-05 21:08:42 +00:00
|
|
|
@customElement("ak-interface-admin")
|
2020-12-02 12:56:26 +00:00
|
|
|
export class AdminInterface extends Interface {
|
|
|
|
|
2021-05-05 17:14:37 +00:00
|
|
|
renderSidebarItems(): TemplateResult {
|
|
|
|
const superUserCondition = () => {
|
|
|
|
return me().then(u => u.user.isSuperuser || false);
|
|
|
|
};
|
|
|
|
return html`
|
|
|
|
<ak-sidebar-item path="/library">
|
|
|
|
<span slot="label">${t`Library`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item
|
|
|
|
.condition=${superUserCondition}>
|
|
|
|
<span slot="label">${t`Monitor`}</span>
|
|
|
|
<ak-sidebar-item path="/administration/overview">
|
|
|
|
<span slot="label">${t`Overview`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item path="/administration/system-tasks">
|
|
|
|
<span slot="label">${t`System Tasks`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item
|
|
|
|
.condition=${superUserCondition}>
|
|
|
|
<span slot="label">${t`Resources`}</span>
|
|
|
|
<ak-sidebar-item path="/core/applications" .activeWhen=${[`^/core/applications/(?<slug>${SLUG_REGEX})$`]}>
|
|
|
|
<span slot="label">${t`Applications`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item path="/core/sources" .activeWhen=${[`^/core/sources/(?<slug>${SLUG_REGEX})$`]}>
|
|
|
|
<span slot="label">${t`Sources`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item path="/core/providers" .activeWhen=${[`^/core/providers/(?<id>${ID_REGEX})$`]}>
|
|
|
|
<span slot="label">${t`Providers`}</span>
|
|
|
|
</ak-sidebar-item>
|
2021-05-29 16:47:00 +00:00
|
|
|
<ak-sidebar-item path="/core/tenants">
|
|
|
|
<span slot="label">${t`Tenants`}</span>
|
|
|
|
</ak-sidebar-item>
|
2021-05-05 17:14:37 +00:00
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item
|
|
|
|
.condition=${superUserCondition}>
|
|
|
|
<span slot="label">${t`Outposts`}</span>
|
|
|
|
<ak-sidebar-item path="/outpost/outposts">
|
|
|
|
<span slot="label">${t`Outposts`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item path="/outpost/service-connections">
|
|
|
|
<span slot="label">${t`Service Connections`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item
|
|
|
|
.condition=${superUserCondition}>
|
|
|
|
<span slot="label">${t`Events`}</span>
|
|
|
|
<ak-sidebar-item path="/events/log" .activeWhen=${[`^/events/log/(?<id>${UUID_REGEX})$`]}>
|
|
|
|
<span slot="label">${t`Logs`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item path="/events/rules">
|
|
|
|
<span slot="label">${t`Notification Rules`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item path="/events/transports">
|
|
|
|
<span slot="label">${t`Notification Transports`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item
|
|
|
|
.condition=${superUserCondition}>
|
|
|
|
<span slot="label">${t`Customisation`}</span>
|
|
|
|
<ak-sidebar-item path="/policy/policies">
|
|
|
|
<span slot="label">${t`Policies`}</span>
|
|
|
|
</ak-sidebar-item>
|
2021-05-29 21:01:45 +00:00
|
|
|
<ak-sidebar-item path="/policy/reputation/ip">
|
|
|
|
<span slot="label">${t`Reputation policy - IPs`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item path="/policy/reputation/user">
|
|
|
|
<span slot="label">${t`Reputation policy - Users`}</span>
|
|
|
|
</ak-sidebar-item>
|
2021-05-05 17:14:37 +00:00
|
|
|
<ak-sidebar-item path="/core/property-mappings">
|
|
|
|
<span slot="label">${t`Property Mappings`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item
|
|
|
|
.condition=${superUserCondition}>
|
|
|
|
<span slot="label">${t`Flows`}</span>
|
|
|
|
<ak-sidebar-item path="/flow/flows" .activeWhen=${[`^/flow/flows/(?<slug>${SLUG_REGEX})$`]}>
|
|
|
|
<span slot="label">${t`Flows`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item path="/flow/stages">
|
|
|
|
<span slot="label">${t`Stages`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item path="/flow/stages/prompts">
|
|
|
|
<span slot="label">${t`Prompts`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item path="/flow/stages/invitations">
|
|
|
|
<span slot="label">${t`Invitations`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item
|
|
|
|
.condition=${superUserCondition}>
|
|
|
|
<span slot="label">${t`Identity & Cryptography`}</span>
|
|
|
|
<ak-sidebar-item path="/identity/users" .activeWhen=${[`^/identity/users/(?<id>${ID_REGEX})$`]}>
|
|
|
|
<span slot="label">${t`Users`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item path="/identity/groups">
|
|
|
|
<span slot="label">${t`Groups`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item path="/crypto/certificates">
|
|
|
|
<span slot="label">${t`Certificates`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
<ak-sidebar-item path="/core/tokens">
|
|
|
|
<span slot="label">${t`Tokens`}</span>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
</ak-sidebar-item>
|
|
|
|
`;
|
2020-12-02 12:56:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
}
|