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/LibraryPage";
|
|
|
|
import "./pages/admin-overview/AdminOverviewPage";
|
|
|
|
import "./pages/applications/ApplicationListPage";
|
|
|
|
import "./pages/applications/ApplicationViewPage";
|
2020-12-12 18:39:09 +00:00
|
|
|
import "./pages/sources/SourceViewPage";
|
|
|
|
import "./pages/flows/FlowViewPage";
|
2020-12-28 13:26:41 +00:00
|
|
|
import "./pages/events/EventListPage";
|
2021-02-04 20:28:01 +00:00
|
|
|
import "./pages/events/EventInfoPage";
|
2021-01-12 21:03:50 +00:00
|
|
|
import "./pages/events/TransportListPage";
|
2021-01-15 15:23:27 +00:00
|
|
|
import "./pages/events/RuleListPage";
|
2021-02-04 08:54:00 +00:00
|
|
|
import "./pages/providers/ProviderListPage";
|
|
|
|
import "./pages/providers/ProviderViewPage";
|
2021-02-03 20:18:31 +00:00
|
|
|
import "./pages/property-mappings/PropertyMappingListPage";
|
2021-02-08 18:04:19 +00:00
|
|
|
import "./pages/outposts/OutpostListPage";
|
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-04 08:54:00 +00:00
|
|
|
new Route(new RegExp("^/providers$"), html`<ak-provider-list></ak-provider-list>`),
|
|
|
|
new Route(new RegExp(`^/providers/(?<id>${ID_REGEX})$`)).then((args) => {
|
|
|
|
return html`<ak-provider-view .args=${args}></ak-provider-view>`;
|
|
|
|
}),
|
2020-12-27 21:38:04 +00:00
|
|
|
new Route(new RegExp("^/applications$"), html`<ak-application-list></ak-application-list>`),
|
|
|
|
new Route(new RegExp(`^/applications/(?<slug>${SLUG_REGEX})$`)).then((args) => {
|
2020-12-05 21:08:42 +00:00
|
|
|
return html`<ak-application-view .args=${args}></ak-application-view>`;
|
2020-12-01 16:41:27 +00:00
|
|
|
}),
|
2020-12-27 21:38:04 +00:00
|
|
|
new Route(new RegExp(`^/sources/(?<slug>${SLUG_REGEX})$`)).then((args) => {
|
2020-12-12 18:39:09 +00:00
|
|
|
return html`<ak-source-view .args=${args}></ak-source-view>`;
|
|
|
|
}),
|
2020-12-27 21:38:04 +00:00
|
|
|
new Route(new RegExp(`^/flows/(?<slug>${SLUG_REGEX})$`)).then((args) => {
|
2020-12-12 18:39:09 +00:00
|
|
|
return html`<ak-flow-view .args=${args}></ak-flow-view>`;
|
|
|
|
}),
|
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) => {
|
|
|
|
return html`<ak-event-info-page .args=${args}></ak-event-info-page>`;
|
|
|
|
}),
|
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-03 20:18:31 +00:00
|
|
|
new Route(new RegExp("^/property-mappings$"), html`<ak-property-mapping-list></ak-property-mapping-list>`),
|
2021-02-08 18:04:19 +00:00
|
|
|
new Route(new RegExp("^/outposts$"), html`<ak-outpost-list></ak-outpost-list>`),
|
2020-12-01 16:41:27 +00:00
|
|
|
];
|