1
0
Fork 0

remove test code

This commit is contained in:
ChaotiCryptidz 2022-01-10 15:03:59 +00:00
parent 18c034a104
commit a894623402
2 changed files with 0 additions and 58 deletions

View file

@ -42,7 +42,6 @@ import { UserPassUserEdit } from "./ui/pages/Access/Auth/userpass/UserPassUserEd
import { UserPassUserNew } from "./ui/pages/Access/Auth/userpass/UserPassUserNew";
import { UserPassUserView } from "./ui/pages/Access/Auth/userpass/UserPassUserView";
import { UserPassUsersList } from "./ui/pages/Access/Auth/userpass/UserPassUsersList";
import { SSH_List } from "./ui/pages/Secrets/SSH/SSH_List";
export const Main = () => (
<Router>
@ -107,9 +106,6 @@ export const Main = () => (
api={api}
/>
<SSH_List path="/secrets/ssh/list/:baseMount" settings={settings} api={api} />
<PoliciesHome path="/policies" settings={settings} api={api} />
<PolicyNew path="/policies/new" settings={settings} api={api} />
<PolicyView path="/policies/view/:policyName" settings={settings} api={api} />

View file

@ -1,54 +0,0 @@
import { CapabilitiesType } from "../../../../api/types/capabilities";
import { Component, JSX } from "preact";
import { DefaultPageProps } from "../../../../types/DefaultPageProps";
import { SecretTitleElement } from "../SecretTitleElement";
import { delSecretsEngineURL, transitNewSecretURL, transitViewSecretURL } from "../../pageLinks";
import { route } from "preact-router";
import i18next from "i18next";
export class SSH_List extends Component<DefaultPageProps, { caps: CapabilitiesType }> {
async componentDidMount() {
const baseMount = this.props.matches["baseMount"];
const mountsPath = "/sys/mounts/" + baseMount;
const caps = await this.props.api.getCapabilitiesPath([mountsPath, baseMount]);
this.setState({ caps });
}
render() {
if (!this.state.caps) return;
const baseMount = this.props.matches["baseMount"];
const mountsPath = "/sys/mounts/" + baseMount;
const mountCaps = this.state.caps[mountsPath];
const sshCaps = this.state.caps[baseMount];
return (
<>
<SecretTitleElement type="ssh" baseMount={baseMount} />
<p>
{sshCaps.includes("create") && (
<button
class="uk-button uk-button-primary"
onClick={async () => {
route(transitNewSecretURL(baseMount));
}}
>
{i18next.t("transit_view_new_btn")}
</button>
)}
{mountCaps.includes("delete") && (
<button
class="uk-button uk-button-danger"
onClick={async () => {
route(delSecretsEngineURL(baseMount));
}}
>
{i18next.t("transit_view_delete_btn")}
</button>
)}
</p>
</>
);
}
}