2020-12-01 16:41:27 +00:00
|
|
|
import { html } from "lit-html";
|
2021-02-04 20:28:01 +00:00
|
|
|
import { Route, SLUG_REGEX, ID_REGEX, UUID_REGEX } from "./elements/router/Route";
|
2020-12-01 16:41:27 +00:00
|
|
|
|
2020-12-02 14:44:40 +00:00
|
|
|
import "./pages/admin-overview/AdminOverviewPage";
|
|
|
|
import "./pages/applications/ApplicationListPage";
|
|
|
|
import "./pages/applications/ApplicationViewPage";
|
2021-02-19 16:05:02 +00:00
|
|
|
import "./pages/crypto/CertificateKeyPairListPage";
|
2021-02-04 20:28:01 +00:00
|
|
|
import "./pages/events/EventInfoPage";
|
2021-02-19 16:05:02 +00:00
|
|
|
import "./pages/events/EventListPage";
|
2021-01-15 15:23:27 +00:00
|
|
|
import "./pages/events/RuleListPage";
|
2021-02-19 16:05:02 +00:00
|
|
|
import "./pages/events/TransportListPage";
|
|
|
|
import "./pages/flows/FlowListPage";
|
|
|
|
import "./pages/flows/FlowViewPage";
|
2021-02-19 18:29:17 +00:00
|
|
|
import "./pages/groups/GroupListPage";
|
2021-02-19 16:05:02 +00:00
|
|
|
import "./pages/LibraryPage";
|
|
|
|
import "./pages/outposts/OutpostListPage";
|
2021-03-31 20:40:48 +00:00
|
|
|
import "./pages/outposts/ServiceConnectionListPage";
|
2021-02-19 16:05:02 +00:00
|
|
|
import "./pages/policies/PolicyListPage";
|
|
|
|
import "./pages/property-mappings/PropertyMappingListPage";
|
2021-02-04 08:54:00 +00:00
|
|
|
import "./pages/providers/ProviderListPage";
|
|
|
|
import "./pages/providers/ProviderViewPage";
|
2021-02-19 16:05:02 +00:00
|
|
|
import "./pages/sources/SourcesListPage";
|
|
|
|
import "./pages/sources/SourceViewPage";
|
2021-04-02 22:32:33 +00:00
|
|
|
import "./pages/stages/invitation/InvitationListPage";
|
|
|
|
import "./pages/stages/prompt/PromptListPage";
|
2021-03-20 15:37:31 +00:00
|
|
|
import "./pages/stages/StageListPage";
|
2021-02-19 17:12:23 +00:00
|
|
|
import "./pages/system-tasks/SystemTaskListPage";
|
2021-05-29 16:47:00 +00:00
|
|
|
import "./pages/tenants/TenantListPage";
|
2021-02-19 18:29:17 +00:00
|
|
|
import "./pages/tokens/TokenListPage";
|
2021-05-29 16:47:00 +00:00
|
|
|
import "./pages/user-settings/UserSettingsPage";
|
2021-02-19 18:29:17 +00:00
|
|
|
import "./pages/users/UserListPage";
|
2021-03-20 15:37:31 +00:00
|
|
|
import "./pages/users/UserViewPage";
|
2020-12-02 14:44:40 +00:00
|
|
|
|
2020-12-01 16:41:27 +00:00
|
|
|
export const ROUTES: Route[] = [
|
|
|
|
// Prevent infinite Shell loops
|
2020-12-27 21:38:04 +00:00
|
|
|
new Route(new RegExp("^/$")).redirect("/library"),
|
|
|
|
new Route(new RegExp("^#.*")).redirect("/library"),
|
|
|
|
new Route(new RegExp("^/library$"), html`<ak-library></ak-library>`),
|
|
|
|
new Route(new RegExp("^/administration/overview$"), html`<ak-admin-overview></ak-admin-overview>`),
|
2021-02-19 17:12:23 +00:00
|
|
|
new Route(new RegExp("^/administration/system-tasks$"), html`<ak-system-task-list></ak-system-task-list>`),
|
2021-02-19 18:29:17 +00:00
|
|
|
new Route(new RegExp("^/core/providers$"), html`<ak-provider-list></ak-provider-list>`),
|
|
|
|
new Route(new RegExp(`^/core/providers/(?<id>${ID_REGEX})$`)).then((args) => {
|
2021-02-16 19:00:34 +00:00
|
|
|
return html`<ak-provider-view .providerID=${parseInt(args.id, 10)}></ak-provider-view>`;
|
2021-02-04 08:54:00 +00:00
|
|
|
}),
|
2021-02-19 18:29:17 +00:00
|
|
|
new Route(new RegExp("^/core/applications$"), html`<ak-application-list></ak-application-list>`),
|
|
|
|
new Route(new RegExp(`^/core/applications/(?<slug>${SLUG_REGEX})$`)).then((args) => {
|
2021-03-28 14:10:00 +00:00
|
|
|
return html`<ak-application-view .applicationSlug=${args.slug}></ak-application-view>`;
|
2020-12-01 16:41:27 +00:00
|
|
|
}),
|
2021-02-19 18:29:17 +00:00
|
|
|
new Route(new RegExp("^/core/sources$"), html`<ak-source-list></ak-source-list>`),
|
|
|
|
new Route(new RegExp(`^/core/sources/(?<slug>${SLUG_REGEX})$`)).then((args) => {
|
2021-03-28 14:10:00 +00:00
|
|
|
return html`<ak-source-view .sourceSlug=${args.slug}></ak-source-view>`;
|
2020-12-12 18:39:09 +00:00
|
|
|
}),
|
2021-03-20 15:37:31 +00:00
|
|
|
new Route(new RegExp("^/core/property-mappings$"), html`<ak-property-mapping-list></ak-property-mapping-list>`),
|
|
|
|
new Route(new RegExp("^/core/tokens$"), html`<ak-token-list></ak-token-list>`),
|
2021-05-29 16:47:00 +00:00
|
|
|
new Route(new RegExp("^/core/tenants$"), html`<ak-tenant-list></ak-tenant-list>`),
|
2021-02-19 18:29:17 +00:00
|
|
|
new Route(new RegExp("^/policy/policies$"), html`<ak-policy-list></ak-policy-list>`),
|
|
|
|
new Route(new RegExp("^/identity/groups$"), html`<ak-group-list></ak-group-list>`),
|
|
|
|
new Route(new RegExp("^/identity/users$"), html`<ak-user-list></ak-user-list>`),
|
2021-03-20 15:37:31 +00:00
|
|
|
new Route(new RegExp(`^/identity/users/(?<id>${ID_REGEX})$`)).then((args) => {
|
|
|
|
return html`<ak-user-view .userId=${parseInt(args.id, 10)}></ak-user-view>`;
|
|
|
|
}),
|
2021-02-19 23:09:53 +00:00
|
|
|
new Route(new RegExp("^/flow/stages/invitations$"), html`<ak-stage-invitation-list></ak-stage-invitation-list>`),
|
|
|
|
new Route(new RegExp("^/flow/stages/prompts$"), html`<ak-stage-prompt-list></ak-stage-prompt-list>`),
|
2021-02-19 18:29:17 +00:00
|
|
|
new Route(new RegExp("^/flow/stages$"), html`<ak-stage-list></ak-stage-list>`),
|
|
|
|
new Route(new RegExp("^/flow/flows$"), html`<ak-flow-list></ak-flow-list>`),
|
|
|
|
new Route(new RegExp(`^/flow/flows/(?<slug>${SLUG_REGEX})$`)).then((args) => {
|
2021-02-16 19:34:15 +00:00
|
|
|
return html`<ak-flow-view .flowSlug=${args.slug}></ak-flow-view>`;
|
2020-12-12 18:39:09 +00:00
|
|
|
}),
|
2021-01-12 21:03:50 +00:00
|
|
|
new Route(new RegExp("^/events/log$"), html`<ak-event-list></ak-event-list>`),
|
2021-02-04 20:28:01 +00:00
|
|
|
new Route(new RegExp(`^/events/log/(?<id>${UUID_REGEX})$`)).then((args) => {
|
2021-03-28 14:10:00 +00:00
|
|
|
return html`<ak-event-info-page .eventID=${args.id}></ak-event-info-page>`;
|
2021-02-04 20:28:01 +00:00
|
|
|
}),
|
2021-01-12 21:03:50 +00:00
|
|
|
new Route(new RegExp("^/events/transports$"), html`<ak-event-transport-list></ak-event-transport-list>`),
|
2021-01-15 15:23:27 +00:00
|
|
|
new Route(new RegExp("^/events/rules$"), html`<ak-event-rule-list></ak-event-rule-list>`),
|
2021-02-19 18:29:17 +00:00
|
|
|
new Route(new RegExp("^/outpost/outposts$"), html`<ak-outpost-list></ak-outpost-list>`),
|
|
|
|
new Route(new RegExp("^/outpost/service-connections$"), html`<ak-outpost-service-connection-list></ak-outpost-service-connection-list>`),
|
2021-03-28 14:10:00 +00:00
|
|
|
new Route(new RegExp("^/crypto/certificates$"), html`<ak-crypto-certificate-list></ak-crypto-certificate-list>`),
|
2021-03-17 23:58:50 +00:00
|
|
|
new Route(new RegExp("^/user$"), html`<ak-user-settings></ak-user-settings>`),
|
2020-12-01 16:41:27 +00:00
|
|
|
];
|