change some titles and make ui a bit more pretty i guess
This commit is contained in:
parent
61be452201
commit
910b439a77
|
@ -1,4 +1,5 @@
|
||||||
export type UserType = {
|
export type UserType = {
|
||||||
|
username?: string;
|
||||||
password?: string;
|
password?: string;
|
||||||
token_bound_cidrs: string[];
|
token_bound_cidrs: string[];
|
||||||
token_explicit_max_ttl: number;
|
token_explicit_max_ttl: number;
|
||||||
|
|
2
src/translations/en.js
vendored
2
src/translations/en.js
vendored
|
@ -12,6 +12,7 @@ module.exports = {
|
||||||
|
|
||||||
// Common buttons / placeholders
|
// Common buttons / placeholders
|
||||||
common_new: "New",
|
common_new: "New",
|
||||||
|
common_view: "View",
|
||||||
common_edit: "Edit",
|
common_edit: "Edit",
|
||||||
common_create: "Create",
|
common_create: "Create",
|
||||||
common_delete: "Delete",
|
common_delete: "Delete",
|
||||||
|
@ -265,6 +266,7 @@ module.exports = {
|
||||||
auth_common_token_peroid: "Period (seconds)",
|
auth_common_token_peroid: "Period (seconds)",
|
||||||
auth_common_policies: "Policies",
|
auth_common_policies: "Policies",
|
||||||
auth_common_type: "Token Type",
|
auth_common_type: "Token Type",
|
||||||
|
auth_common_token_config: "Token Config",
|
||||||
|
|
||||||
// userpass Users List
|
// userpass Users List
|
||||||
userpass_users_list_title: "Users List",
|
userpass_users_list_title: "Users List",
|
||||||
|
|
|
@ -14,9 +14,9 @@ export type AuthListElementProps = {
|
||||||
};
|
};
|
||||||
|
|
||||||
export function AuthListElement(props: AuthListElementProps): JSX.Element {
|
export function AuthListElement(props: AuthListElementProps): JSX.Element {
|
||||||
const isClickable = props.method.type != "token";
|
const isViewable = ["userpass"].includes(props.method.type);
|
||||||
|
|
||||||
const onHeaderLinkClick = async (props: AuthListElementProps) => {
|
const onViewClick = (props: AuthListElementProps) => {
|
||||||
if (props.method.type == "userpass") {
|
if (props.method.type == "userpass") {
|
||||||
route(userPassUserListURL(props.path));
|
route(userPassUserListURL(props.path));
|
||||||
}
|
}
|
||||||
|
@ -24,15 +24,14 @@ export function AuthListElement(props: AuthListElementProps): JSX.Element {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div class="uk-padding-small uk-background-secondary">
|
<div class="uk-padding-small uk-background-secondary">
|
||||||
{isClickable ? (
|
<span class="uk-h4 uk-margin-bottom">{props.path}</span>
|
||||||
<a class="uk-h4 uk-margin-bottom" onClick={() => onHeaderLinkClick(props)}>
|
|
||||||
{props.path}
|
|
||||||
</a>
|
|
||||||
) : (
|
|
||||||
<span class="uk-h4 uk-margin-bottom">{props.path}</span>
|
|
||||||
)}
|
|
||||||
<span class="uk-text-muted">{` (${props.method.accessor})`}</span>
|
<span class="uk-text-muted">{` (${props.method.accessor})`}</span>
|
||||||
<div class="uk-margin-top">
|
<div class="uk-margin-top">
|
||||||
|
{isViewable && (
|
||||||
|
<button class="uk-button uk-button-small uk-button-primary" onClick={() => {onViewClick(props)}}>
|
||||||
|
{i18next.t("common_view")}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
<button
|
<button
|
||||||
class="uk-button uk-button-small uk-button-primary"
|
class="uk-button uk-button-small uk-button-primary"
|
||||||
onClick={async () => {
|
onClick={async () => {
|
||||||
|
|
|
@ -31,19 +31,19 @@ export class UserPassUserEdit extends Component<DefaultPageProps, { user_data: U
|
||||||
<>
|
<>
|
||||||
<PageTitle title={i18next.t("userpass_user_edit_title")} />
|
<PageTitle title={i18next.t("userpass_user_edit_title")} />
|
||||||
<Form onSubmit={(data) => this.onSubmit(data)}>
|
<Form onSubmit={(data) => this.onSubmit(data)}>
|
||||||
<input
|
<InputWithTitle title={i18next.t("common_password")}>
|
||||||
class="uk-input uk-form-width-large"
|
<input
|
||||||
name="password"
|
class="uk-input uk-form-width-large"
|
||||||
type="password"
|
name="password"
|
||||||
placeholder={i18next.t("common_password")}
|
type="password"
|
||||||
/>
|
placeholder={i18next.t("common_password")}
|
||||||
|
/>
|
||||||
|
</InputWithTitle>
|
||||||
|
|
||||||
|
<br />
|
||||||
|
|
||||||
<Margin>
|
<Margin>
|
||||||
<p>{i18next.t("auth_common_zero_default")}</p>
|
<h4>{i18next.t("auth_common_token_config")}</h4>
|
||||||
</Margin>
|
|
||||||
|
|
||||||
<Margin>
|
|
||||||
<p>{i18next.t("auth_common_generated_tokens")}</p>
|
|
||||||
</Margin>
|
</Margin>
|
||||||
|
|
||||||
<InputWithTitle title={i18next.t("common_cidrs")}>
|
<InputWithTitle title={i18next.t("common_cidrs")}>
|
||||||
|
@ -139,6 +139,7 @@ export class UserPassUserEdit extends Component<DefaultPageProps, { user_data: U
|
||||||
if (password.length > 0) {
|
if (password.length > 0) {
|
||||||
apiData.password = password;
|
apiData.password = password;
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.props.api.createOrUpdateUserPassUser(baseMount, user, apiData);
|
await this.props.api.createOrUpdateUserPassUser(baseMount, user, apiData);
|
||||||
route(userPassUserViewURL(baseMount, user));
|
route(userPassUserViewURL(baseMount, user));
|
||||||
|
|
|
@ -49,11 +49,7 @@ export class UserPassUserView extends Component<DefaultPageProps, { user_data: U
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<Margin>
|
<Margin>
|
||||||
<p>{i18next.t("auth_common_zero_default")}</p>
|
<h4>{i18next.t("auth_common_token_config")}</h4>
|
||||||
</Margin>
|
|
||||||
|
|
||||||
<Margin>
|
|
||||||
<p>{i18next.t("auth_common_generated_tokens")}</p>
|
|
||||||
</Margin>
|
</Margin>
|
||||||
|
|
||||||
<table class="uk-table">
|
<table class="uk-table">
|
||||||
|
|
Loading…
Reference in a new issue