diff --git a/web/src/elements/table/TablePage.ts b/web/src/elements/table/TablePage.ts index 8ef5462cc..bb7fb39b8 100644 --- a/web/src/elements/table/TablePage.ts +++ b/web/src/elements/table/TablePage.ts @@ -1,3 +1,5 @@ +import { t } from "@lingui/macro"; + import { CSSResult } from "lit"; import { TemplateResult, html } from "lit"; import { ifDefined } from "lit/directives/if-defined.js"; @@ -26,6 +28,24 @@ export abstract class TablePage extends Table { return html``; } + renderEmpty(inner?: TemplateResult): TemplateResult { + return super.renderEmpty(html` + ${inner + ? inner + : html` +
${this.renderObjectCreate()}
+
`} + `); + } + + renderObjectCreate(): TemplateResult { + return html``; + } + + renderToolbar(): TemplateResult { + return html`${this.renderObjectCreate()}${super.renderToolbar()}`; + } + render(): TemplateResult { return html` { ]; } - renderToolbar(): TemplateResult { + renderObjectCreate(): TemplateResult { return html` ${t`Create`} @@ -167,7 +167,6 @@ export class ApplicationListPage extends TablePage { - ${super.renderToolbar()} `; } } diff --git a/web/src/pages/crypto/CertificateKeyPairListPage.ts b/web/src/pages/crypto/CertificateKeyPairListPage.ts index 27f147903..6a2dc4101 100644 --- a/web/src/pages/crypto/CertificateKeyPairListPage.ts +++ b/web/src/pages/crypto/CertificateKeyPairListPage.ts @@ -186,7 +186,7 @@ export class CertificateKeyPairListPage extends TablePage { `; } - renderToolbar(): TemplateResult { + renderObjectCreate(): TemplateResult { return html` ${t`Create`} @@ -201,7 +201,6 @@ export class CertificateKeyPairListPage extends TablePage { - ${super.renderToolbar()} `; } } diff --git a/web/src/pages/events/RuleListPage.ts b/web/src/pages/events/RuleListPage.ts index 0422fcaa6..b514c74c6 100644 --- a/web/src/pages/events/RuleListPage.ts +++ b/web/src/pages/events/RuleListPage.ts @@ -93,7 +93,7 @@ export class RuleListPage extends TablePage { ]; } - renderToolbar(): TemplateResult { + renderObjectCreate(): TemplateResult { return html` ${t`Create`} @@ -101,7 +101,6 @@ export class RuleListPage extends TablePage { - ${super.renderToolbar()} `; } diff --git a/web/src/pages/events/TransportListPage.ts b/web/src/pages/events/TransportListPage.ts index f868c0f8f..3390a06fa 100644 --- a/web/src/pages/events/TransportListPage.ts +++ b/web/src/pages/events/TransportListPage.ts @@ -101,7 +101,7 @@ export class TransportListPage extends TablePage { ]; } - renderToolbar(): TemplateResult { + renderObjectCreate(): TemplateResult { return html` ${t`Create`} @@ -109,7 +109,6 @@ export class TransportListPage extends TablePage { - ${super.renderToolbar()} `; } } diff --git a/web/src/pages/flows/FlowListPage.ts b/web/src/pages/flows/FlowListPage.ts index c0b7e3921..9358e4b27 100644 --- a/web/src/pages/flows/FlowListPage.ts +++ b/web/src/pages/flows/FlowListPage.ts @@ -127,8 +127,9 @@ export class FlowListPage extends TablePage { ]; } - renderToolbar(): TemplateResult { - return html` + renderObjectCreate(): TemplateResult { + return html` + ${t`Create`} ${t`Create Flow`} @@ -140,6 +141,11 @@ export class FlowListPage extends TablePage { + `; + } + + renderToolbar(): TemplateResult { + return html` ${super.renderToolbar()} { ${t`Clear cache`}
-
`; + + `; } } diff --git a/web/src/pages/groups/GroupListPage.ts b/web/src/pages/groups/GroupListPage.ts index 91c097a98..682c8cc81 100644 --- a/web/src/pages/groups/GroupListPage.ts +++ b/web/src/pages/groups/GroupListPage.ts @@ -95,7 +95,7 @@ export class GroupListPage extends TablePage { ]; } - renderToolbar(): TemplateResult { + renderObjectCreate(): TemplateResult { return html` ${t`Create`} @@ -103,7 +103,6 @@ export class GroupListPage extends TablePage { - ${super.renderToolbar()} `; } } diff --git a/web/src/pages/groups/RelatedGroupList.ts b/web/src/pages/groups/RelatedGroupList.ts index 9f29a9209..8006cdc86 100644 --- a/web/src/pages/groups/RelatedGroupList.ts +++ b/web/src/pages/groups/RelatedGroupList.ts @@ -86,8 +86,4 @@ export class RelatedGroupList extends Table {
`, ]; } - - renderToolbar(): TemplateResult { - return html` ${super.renderToolbar()} `; - } } diff --git a/web/src/pages/outposts/OutpostListPage.ts b/web/src/pages/outposts/OutpostListPage.ts index 024185a5b..fd22796f9 100644 --- a/web/src/pages/outposts/OutpostListPage.ts +++ b/web/src/pages/outposts/OutpostListPage.ts @@ -178,7 +178,7 @@ export class OutpostListPage extends TablePage { `; } - renderToolbar(): TemplateResult { + renderObjectCreate(): TemplateResult { return html` ${t`Create`} @@ -186,7 +186,6 @@ export class OutpostListPage extends TablePage { - ${super.renderToolbar()} `; } } diff --git a/web/src/pages/outposts/ServiceConnectionListPage.ts b/web/src/pages/outposts/ServiceConnectionListPage.ts index 03f854fd6..c9c1fb784 100644 --- a/web/src/pages/outposts/ServiceConnectionListPage.ts +++ b/web/src/pages/outposts/ServiceConnectionListPage.ts @@ -123,8 +123,7 @@ export class OutpostServiceConnectionListPage extends TablePage`; } - renderToolbar(): TemplateResult { - return html` - ${super.renderToolbar()}`; + renderObjectCreate(): TemplateResult { + return html` `; } } diff --git a/web/src/pages/policies/BoundPoliciesList.ts b/web/src/pages/policies/BoundPoliciesList.ts index 83f1019c1..92656bfcb 100644 --- a/web/src/pages/policies/BoundPoliciesList.ts +++ b/web/src/pages/policies/BoundPoliciesList.ts @@ -196,7 +196,6 @@ export class BoundPoliciesList extends Table { ${t`Create Binding`} - - ${super.renderToolbar()}`; + `; } } diff --git a/web/src/pages/policies/PolicyListPage.ts b/web/src/pages/policies/PolicyListPage.ts index 05c44b7a1..cdd4dbfee 100644 --- a/web/src/pages/policies/PolicyListPage.ts +++ b/web/src/pages/policies/PolicyListPage.ts @@ -126,9 +126,12 @@ export class PolicyListPage extends TablePage { `; } + renderObjectCreate(): TemplateResult { + return html` `; + } + renderToolbar(): TemplateResult { - return html` - ${super.renderToolbar()} + return html` ${super.renderToolbar()} { ]; } - renderToolbar(): TemplateResult { - return html` - ${super.renderToolbar()}`; + renderObjectCreate(): TemplateResult { + return html` `; } renderToolbarAfter(): TemplateResult { diff --git a/web/src/pages/providers/ProviderListPage.ts b/web/src/pages/providers/ProviderListPage.ts index 0d2ea987b..655a83436 100644 --- a/web/src/pages/providers/ProviderListPage.ts +++ b/web/src/pages/providers/ProviderListPage.ts @@ -110,7 +110,7 @@ export class ProviderListPage extends TablePage { ]; } - renderToolbar(): TemplateResult { - return html` ${super.renderToolbar()}`; + renderObjectCreate(): TemplateResult { + return html` `; } } diff --git a/web/src/pages/sources/SourceListPage.ts b/web/src/pages/sources/SourceListPage.ts index 9d75ec4c7..88bc23e3f 100644 --- a/web/src/pages/sources/SourceListPage.ts +++ b/web/src/pages/sources/SourceListPage.ts @@ -114,7 +114,7 @@ export class SourceListPage extends TablePage { ]; } - renderToolbar(): TemplateResult { - return html` ${super.renderToolbar()}`; + renderObjectCreate(): TemplateResult { + return html` `; } } diff --git a/web/src/pages/stages/StageListPage.ts b/web/src/pages/stages/StageListPage.ts index f26cf02f9..55b8fb437 100644 --- a/web/src/pages/stages/StageListPage.ts +++ b/web/src/pages/stages/StageListPage.ts @@ -132,7 +132,7 @@ export class StageListPage extends TablePage { ]; } - renderToolbar(): TemplateResult { - return html` ${super.renderToolbar()}`; + renderObjectCreate(): TemplateResult { + return html` `; } } diff --git a/web/src/pages/stages/invitation/InvitationListPage.ts b/web/src/pages/stages/invitation/InvitationListPage.ts index 5c0d132c0..53c2d2504 100644 --- a/web/src/pages/stages/invitation/InvitationListPage.ts +++ b/web/src/pages/stages/invitation/InvitationListPage.ts @@ -123,7 +123,7 @@ export class InvitationListPage extends TablePage { `; } - renderToolbar(): TemplateResult { + renderObjectCreate(): TemplateResult { return html` ${t`Create`} @@ -131,7 +131,6 @@ export class InvitationListPage extends TablePage { - ${super.renderToolbar()} `; } diff --git a/web/src/pages/stages/prompt/PromptListPage.ts b/web/src/pages/stages/prompt/PromptListPage.ts index dfa4d652e..7b2cc47d6 100644 --- a/web/src/pages/stages/prompt/PromptListPage.ts +++ b/web/src/pages/stages/prompt/PromptListPage.ts @@ -99,7 +99,7 @@ export class PromptListPage extends TablePage { ]; } - renderToolbar(): TemplateResult { + renderObjectCreate(): TemplateResult { return html` ${t`Create`} @@ -107,7 +107,6 @@ export class PromptListPage extends TablePage { - ${super.renderToolbar()} `; } } diff --git a/web/src/pages/tenants/TenantListPage.ts b/web/src/pages/tenants/TenantListPage.ts index 6bc9e6705..89e4c2bdb 100644 --- a/web/src/pages/tenants/TenantListPage.ts +++ b/web/src/pages/tenants/TenantListPage.ts @@ -95,7 +95,7 @@ export class TenantListPage extends TablePage { ]; } - renderToolbar(): TemplateResult { + renderObjectCreate(): TemplateResult { return html` ${t`Create`} @@ -103,7 +103,6 @@ export class TenantListPage extends TablePage { - ${super.renderToolbar()} `; } } diff --git a/web/src/pages/tokens/TokenListPage.ts b/web/src/pages/tokens/TokenListPage.ts index b6950249d..69cb90981 100644 --- a/web/src/pages/tokens/TokenListPage.ts +++ b/web/src/pages/tokens/TokenListPage.ts @@ -92,7 +92,7 @@ export class TokenListPage extends TablePage { `; } - renderToolbar(): TemplateResult { + renderObjectCreate(): TemplateResult { return html` ${t`Create`} @@ -100,7 +100,6 @@ export class TokenListPage extends TablePage { - ${super.renderToolbar()} `; } diff --git a/web/src/pages/users/UserListPage.ts b/web/src/pages/users/UserListPage.ts index 43b4eae2f..12717eafa 100644 --- a/web/src/pages/users/UserListPage.ts +++ b/web/src/pages/users/UserListPage.ts @@ -300,7 +300,7 @@ export class UserListPage extends TablePage { `; } - renderToolbar(): TemplateResult { + renderObjectCreate(): TemplateResult { return html` ${t`Create`} @@ -316,7 +316,6 @@ export class UserListPage extends TablePage { ${t`Create Service account`} - ${super.renderToolbar()} `; }