Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/ldap #107

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/components/DeleteModal/reset.less
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
.queryLogo {
svg {
fill: #f4ce5d;

path {
fill: #faad14;
}
}
}
46 changes: 46 additions & 0 deletions src/components/LabelWithHelp/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import React from 'react';

import CommonIcon from '../CommonIcon';
import { ReactComponent as IconHelp } from '../../images/icon/icon_label_query.svg';
import styled from 'styled-components';

const LabelWrap = styled.div`
display: flex;
align-items: center;
position: relative;

.help {
position: absolute;
display: flex;
align-items: center;
top: 50%;
left: 100%;
transform: translate(12px, -50%);

svg {
&:hover {
path {
fill: #36435c;
}
}
}
}
`;

interface IProp {
label: string;
tip: string;
}

const LabelWithHelp = ({ label, tip }: IProp) => {
return (
<LabelWrap>
<div className="label">{label}</div>
<div className="help">
<CommonIcon NormalIcon={IconHelp} title={tip} style={{ fontSize: 20 }}></CommonIcon>
</div>
</LabelWrap>
);
};

export default LabelWithHelp;
11 changes: 11 additions & 0 deletions src/components/MainHeader/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ import { ReactComponent as IconUser } from '../../images/icon/icon_user.svg';
import { ReactComponent as IconTip } from '../../images/icon/icon_label_tips.svg';
import { ReactComponent as IconClose } from '../../images/icon/icon_close.svg';
import { ReactComponent as IconLink } from '../../images/icon/icon_external_link.svg';
import { ReactComponent as IconSetNormal } from '../../images/icon/icon_set_normal.svg';
import { ReactComponent as IconSetActive } from '../../images/icon/icon_set_elected.svg';

import ImageVersionInfo from '../../images/icon_logoWords.svg';
import AddCluster from '../../components/AddCluster';
Expand Down Expand Up @@ -285,6 +287,15 @@ function MainHeader() {
style={{ fontSize: '24px' }}
></CommonIcon>
</a>
<div className="setting" onClick={() => history.push('/dashboard/setting')}>
<CommonIcon
title={t('settings.settingCenter')}
HoverIcon={IconSetActive}
NormalIcon={IconSetNormal}
placement="bottom"
style={{ fontSize: '24px' }}
></CommonIcon>
</div>
<Popover
trigger="click"
placement="bottomRight"
Expand Down
4 changes: 4 additions & 0 deletions src/components/MainHeader/style-components.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,10 @@ export const HeaderSection = styled.div`
align-items: center;
padding-left: 20px;
margin-left: 20px;

.setting {
margin-right: 20px;
}
`;

export const Tran = styled.div`
Expand Down
46 changes: 45 additions & 1 deletion src/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,8 @@
"copy": "Copy successfully",
"upgrade": "Nocalhost Server Dashboard version {{latest}} has been released. Your current version is {{current}}.",
"link": "Click to view updated guidelines",
"release": "Version {{version}} has been released,"
"release": "Version {{version}} has been released,",
"success": "Operation success"
},
"bt": {
"delete": "Delete",
Expand Down Expand Up @@ -575,5 +576,48 @@
"user": "User"
}
}
},
"settings": {
"settingCenter": "Configuration Center",
"thirdAccount": "Third party account config",
"configService": "Configuration Services",
"unallocated": "unallocated",
"configured": "configured",
"thirdAccountDesc": "After configuring LDAP, you can import LDAP member directories to achieve single sign-on to Nocalhost for LDAP accounts. see the",
"helpDocs": "help documentation",
"configLdap": "Configuring LDAP",
"configDesc": "The following configuration will be applied to synchronize LDAP directories, and directory members will be authorized to use LDAP accounts to log in to the Nocalhost Server Dashboard. for LDAP server configuration information, please contact your server administrator.",
"serverConfig": "Server Configuration",
"serverConfigTip": "Configure the link LDAP server address.",
"ruleConfig": "User rule configuration",
"ruleConfigTip": "Import LDAP users and verify user identity.",
"serverAddr": "Server Address",
"adminAccount": "Admin account",
"adminPwd": "Admin password",
"securitySet": "Security Settings",
"serverAddrPh": "Please enter the server address corp.com,127.0.0.1",
"adminAccountPh": "Please enter the administrator account ",
"adminPwdPh": "Please enter the administrator password ",
"finishAndSync": "Finish and sync",
"emailAttr": "Mail attr",
"emailAttrPh": "Please enter the property name of the mail ",
"usernameAttr": "Username attr",
"usernameAttrPh": "Please enter the attribute name of the user name, e.g. OpenLdap Fill in the uid ",
"memberRule": "Membership Rules",
"baseDn": "Base DN",
"baseDnPh": "Search for users from the root directory, e.g. cn=users,dc=example.com,de= ",
"selector": "Filters",
"advanceSetting": "Advanced Configuration",
"advanceSettingTip": "Users who meet this base DN and filter will be imported as an administrator user group.",
"adminRule": "Admin Rules",
"syncData": "Synchronize data",
"editConfig": "Edit Config",
"modifyConfig": "Modify",
"deleteConfig": "Delete",
"emailAttrTip": "If the email provided is not an email, Nocalhost will automatically splice it as ${attr}@nocalhost.dev, the domain part must meet the LDH rules, otherwise the single entry will not be synchronized, if the database already has this email, the mapping relationship will be established directly, if the email provided is duplicated, the data may be misplaced",
"usernameAttrTip": "If it is not filled in or not obtained, the domain part of the email will be taken as the username when importing, and the part of the email that exceeds 20 characters will be truncated; if the user already exists and is not filled in or not obtained, the original username will not be updated.",
"exampleTip": "(Fill out at least the base DN+Attr to get one in real time)",
"deleteConfirm": "Is it confirmed that you want to delete the configuration",
"filterTip": "Default value is (objectClass=*) "
}
}
46 changes: 45 additions & 1 deletion src/i18n/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
"copy": "复制成功",
"upgrade": "Nocalhost Server Dashboard 版本 {{latest}} 已发布,你现在的版本是 {{current}}。",
"link": "点击查看更新指引",
"release": "Version {{version}} 已发布,"
"release": "Version {{version}} 已发布,",
"success": "操作成功"
},
"bt": {
"delete": "删除",
Expand Down Expand Up @@ -576,5 +577,48 @@
"user": "普通用户"
}
}
},
"settings": {
"settingCenter": "配置中心",
"thirdAccount": "第三方账号配置",
"configService": "配置服务",
"unallocated": "未配置",
"configured": "已配置",
"thirdAccountDesc": "配置 LDAP 后,可导入 LDAP 成员目录,实现 LDAP 账号单点登录 Nocalhost。查阅 ",
"helpDocs": "帮助文档",
"configLdap": "配置 LDAP",
"configDesc": "以下配置将应用于同步 LDAP 目录,目录成员授权后可以使用 LDAP 账户来登录 Nocalhost Server Dashboard。获取 LDAP 服务器配置信息,请与服务器管理员联系。",
"serverConfig": "服务器配置",
"serverConfigTip": "配置链接 LDAP 服务器地址。",
"ruleConfig": "用户规则配置",
"ruleConfigTip": "用于导入 LDAP 用户,验证用户身份。",
"serverAddr": "服务器地址",
"adminAccount": "管理员账号",
"adminPwd": "管理员密码",
"securitySet": "安全设置",
"serverAddrPh": "请输入服务器地址 corp.com,127.0.0.1 ",
"adminAccountPh": "请输入管理员账号 ",
"adminPwdPh": "请输入管理员密码 ",
"finishAndSync": "完成并同步",
"emailAttr": "邮箱属性",
"emailAttrPh": "请输入邮箱的属性名 ",
"usernameAttr": "用户名属性",
"usernameAttrPh": "请输入用户名称的属性名,如 OpenLdap 填写 uid ",
"memberRule": "成员规则",
"baseDn": "基础 DN",
"baseDnPh": "从根目录搜索用户,如 cn=users,dc=example.com,de= ",
"selector": "筛选器",
"advanceSetting": "高级配置",
"advanceSettingTip": "满足此 基础 DN 和 筛选器 的用户将会被导入为 管理员用户组。",
"adminRule": "管理员规则",
"syncData": "同步数据",
"editConfig": "编辑配置",
"modifyConfig": "修改配置",
"deleteConfig": "删除配置",
"emailAttrTip": "如果提供的不是一个 email,则 Nocalhost 将自动为其拼接为 ${attr}@nocalhost.dev,域名部分必须满足 LDH 规则,否则单个条目将无法同步,如果数据库已有此 email,则会直接建立映射关系,如果提供的 email 有重复,则可能出现数据错乱",
"usernameAttrTip": "如果不填或没有获取到,在导入时则会取 email 的域名部分作为用户名,其中超过 20 字符部分将被截断;如果已经存在此用户,且不填或没有获取到,则不会更新原有用户名。",
"exampleTip": "(填完至少基础 DN+Attr 实时获取一个)",
"deleteConfirm": "是否确认要删除配置",
"filterTip": "缺省值为(objectClass=*) "
}
}
1 change: 1 addition & 0 deletions src/images/bg_left_select.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/images/bg_left_unselect.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/images/bg_right_select.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/images/bg_right_unselect.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/images/icon/icon_arrow_right.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/images/icon/icon_ldap.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/images/icon/icon_set_elected.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/images/icon/icon_set_normal.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading