mirror of
https://github.com/eyebluecn/tank-front
synced 2024-04-21 12:31:55 +00:00
Finish the I18N work for install module.
This commit is contained in:
@@ -16,6 +16,7 @@ import {
|
||||
} from '@ant-design/icons';
|
||||
import {LoginOutlined} from "@ant-design/icons/lib";
|
||||
import Preference from "../model/preference/Preference";
|
||||
import Lang from "../model/global/Lang";
|
||||
|
||||
|
||||
export default class MenuManager {
|
||||
@@ -70,22 +71,22 @@ export default class MenuManager {
|
||||
|
||||
if (!preference.installed) {
|
||||
menuItems = [
|
||||
new MenuItem('安装网站', '/install/index', <SettingOutlined/>),
|
||||
new MenuItem(Lang.t("layout.install"), '/install/index', <SettingOutlined/>),
|
||||
];
|
||||
} else if (user.role === UserRole.GUEST) {
|
||||
menuItems = [
|
||||
new MenuItem('登录', '/user/login', <LoginOutlined/>),
|
||||
new MenuItem(Lang.t("user.login"), '/user/login', <LoginOutlined/>),
|
||||
];
|
||||
} else {
|
||||
menuItems.push(new MenuItem('所有文件', '/matter/list', <AppstoreOutlined/>))
|
||||
menuItems.push(new MenuItem('我的分享', '/share/list', <ShareAltOutlined/>))
|
||||
menuItems.push(new MenuItem(Lang.t("layout.allFiles"), '/matter/list', <AppstoreOutlined/>))
|
||||
menuItems.push(new MenuItem(Lang.t("layout.myShare"), '/share/list', <ShareAltOutlined/>))
|
||||
|
||||
if (user.role === UserRole.ADMINISTRATOR) {
|
||||
menuItems.push(new MenuItem('网站偏好', '/preference/index', <SettingOutlined/>))
|
||||
menuItems.push(new MenuItem('监控统计', '/dashboard/index', <DashboardOutlined/>))
|
||||
menuItems.push(new MenuItem('用户列表', '/user/list', <TeamOutlined/>))
|
||||
menuItems.push(new MenuItem(Lang.t("layout.setting"), '/preference/index', <SettingOutlined/>))
|
||||
menuItems.push(new MenuItem(Lang.t("layout.dashboard"), '/dashboard/index', <DashboardOutlined/>))
|
||||
menuItems.push(new MenuItem(Lang.t("layout.users"), '/user/list', <TeamOutlined/>))
|
||||
}
|
||||
menuItems.push(new MenuItem('退出登录', '/user/logout', <PoweroffOutlined/>))
|
||||
menuItems.push(new MenuItem(Lang.t("layout.logout"), '/user/logout', <PoweroffOutlined/>))
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -23,6 +23,9 @@ let LangEn = {
|
||||
configMysql: "Config MySQL",
|
||||
port: "Port",
|
||||
schema: "Schema",
|
||||
username: "Username",
|
||||
password: "Password",
|
||||
charset: "Charset",
|
||||
mysqlConnectionPass: "Connect MySQL Ok",
|
||||
testMysqlConnection: "Tes MySQL Connection",
|
||||
notice: "Notice",
|
||||
@@ -59,8 +62,9 @@ let LangEn = {
|
||||
configAdminFirst: "Please config administrator first.",
|
||||
createAdminSuccess: "Create administrator successfully!",
|
||||
validateAdminSuccess: "Validate administrator successfully!",
|
||||
enterHome: "Click to enter home",
|
||||
charset: "Charset",
|
||||
pressToHome: "Click the button below to enter home。",
|
||||
enterHome: "Finish And Enter Home",
|
||||
finish: "Finish",
|
||||
},
|
||||
layout: {
|
||||
allFiles: "Files",
|
||||
@@ -203,7 +207,7 @@ let LangEn = {
|
||||
newPassword: "New Password",
|
||||
confirmNewPassword: "Confirm New Password",
|
||||
cannotBeNull: "Cannot be null!",
|
||||
passwordNotSame: "Old and new password not same!",
|
||||
passwordNotSame: "passwords above not same!",
|
||||
role: "Role",
|
||||
singleFileSizeLimit: "Single File Limit",
|
||||
totalFileSizeLimit: "Total Space Limit",
|
||||
|
||||
@@ -23,6 +23,9 @@ let LangZh = {
|
||||
configMysql: "配置MySQL",
|
||||
port: "端口",
|
||||
schema: "库名",
|
||||
username: "用户名",
|
||||
password: "密码",
|
||||
charset: "编码",
|
||||
mysqlConnectionPass: "MySQL连接测试通过",
|
||||
testMysqlConnection: "测试MySQL连接",
|
||||
notice: "注意",
|
||||
@@ -51,7 +54,7 @@ let LangZh = {
|
||||
useOrCreateAdministrator: "你可以使用其中一位管理员的用户名和密码进行验证,或者创建一位新的管理员账户",
|
||||
validateAdministrator: "验证管理员账户",
|
||||
createAdministrator: "创建管理员账户",
|
||||
administratorUsername: "创建管理员账户",
|
||||
administratorUsername: "管理员用户名",
|
||||
administratorPassword: "管理员密码",
|
||||
administratorRePassword: "再次输入密码",
|
||||
usernameRule: "由于用户名将作为文件上传的目录,因此只允许字母数字以及\"_\"。",
|
||||
@@ -59,8 +62,10 @@ let LangZh = {
|
||||
configAdminFirst: "请首先配置管理员信息!",
|
||||
createAdminSuccess: "创建管理员成功!",
|
||||
validateAdminSuccess: "验证管理员成功!",
|
||||
enterHome: "点击进入首页",
|
||||
charset: "编码",
|
||||
pressToHome: "点击下方按钮来完成安装过程并进入首页。",
|
||||
enterHome: "完成,并进入首页",
|
||||
|
||||
finish: "完成",
|
||||
},
|
||||
layout: {
|
||||
allFiles: "所有文件",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import ColorSelectionOption from '../base/option/ColorSelectionOption';
|
||||
import Color from "../base/option/Color";
|
||||
import Lang from "../global/Lang";
|
||||
|
||||
|
||||
enum UserStatus {
|
||||
@@ -11,12 +12,12 @@ let UserStatuss: UserStatus[] = Object.keys(UserStatus).map(k => k as UserStatus
|
||||
|
||||
let UserStatusMap: { [key in keyof typeof UserStatus]: ColorSelectionOption } = {
|
||||
OK: {
|
||||
'name': '正常',
|
||||
'name': Lang.t("user.statusActive"),
|
||||
'value': 'OK',
|
||||
'color': Color.SUCCESS,
|
||||
},
|
||||
DISABLED: {
|
||||
'name': '禁用',
|
||||
'name': Lang.t("user.statusDisabled"),
|
||||
'value': 'DISABLED',
|
||||
'color': Color.DANGER,
|
||||
},
|
||||
|
||||
@@ -12,6 +12,7 @@ import MysqlPanel from "./widget/MysqlPanel";
|
||||
import CreateTablePanel from "./widget/CreateTablePanel";
|
||||
import SetAdminPanel from "./widget/SetAdminPanel";
|
||||
import FinishPanel from "./widget/FinishPanel";
|
||||
import Lang from "../../common/model/global/Lang";
|
||||
|
||||
const {TabPane} = Tabs;
|
||||
|
||||
@@ -56,7 +57,7 @@ export default class Index extends TankComponent<IProps, IState> {
|
||||
return (
|
||||
<div className="page-install-index">
|
||||
|
||||
<TankTitle name={'安装网站'}>
|
||||
<TankTitle name={Lang.t("layout.install")}>
|
||||
|
||||
</TankTitle>
|
||||
|
||||
@@ -66,13 +67,13 @@ export default class Index extends TankComponent<IProps, IState> {
|
||||
this.activeName = activeKey
|
||||
this.updateUI()
|
||||
}}>
|
||||
<TabPane tab="配置MySQL" key="first">
|
||||
<TabPane tab={Lang.t("install.configMysql")} key="first">
|
||||
<MysqlPanel install={install} onNextStep={() => {
|
||||
this.activeName = "second"
|
||||
this.updateUI()
|
||||
}}/>
|
||||
</TabPane>
|
||||
<TabPane tab="创建表" disabled={!install.verified} key="second">
|
||||
<TabPane tab={Lang.t("install.createTable")} disabled={!install.verified} key="second">
|
||||
<CreateTablePanel install={install} onPreStep={() => {
|
||||
this.activeName = "first"
|
||||
this.updateUI()
|
||||
@@ -81,7 +82,7 @@ export default class Index extends TankComponent<IProps, IState> {
|
||||
this.updateUI()
|
||||
}}/>
|
||||
</TabPane>
|
||||
<TabPane tab="设置管理员" disabled={!install.tableCreated()} key="third">
|
||||
<TabPane tab={Lang.t("install.setAdministrator")} disabled={!install.tableCreated()} key="third">
|
||||
<SetAdminPanel install={install} onPreStep={() => {
|
||||
this.activeName = "second"
|
||||
this.updateUI()
|
||||
@@ -90,7 +91,7 @@ export default class Index extends TankComponent<IProps, IState> {
|
||||
this.updateUI()
|
||||
}}/>
|
||||
</TabPane>
|
||||
<TabPane tab="完成" disabled={!install.adminConfigured} key="forth">
|
||||
<TabPane tab={Lang.t("install.finish")} disabled={!install.adminConfigured} key="forth">
|
||||
<FinishPanel install={install}/>
|
||||
</TabPane>
|
||||
</Tabs>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import React from 'react';
|
||||
import './CreateTablePanel.less';
|
||||
import {Button, Spin, Tag} from 'antd';
|
||||
import {Alert, Button, Spin, Tag} from 'antd';
|
||||
import Install from "../../../common/model/install/Install";
|
||||
import TankComponent from "../../../common/component/TankComponent";
|
||||
import Color from "../../../common/model/base/option/Color";
|
||||
@@ -9,9 +9,11 @@ import {
|
||||
ArrowRightOutlined,
|
||||
CheckOutlined,
|
||||
FormatPainterOutlined,
|
||||
SoundOutlined,
|
||||
SyncOutlined
|
||||
} from "@ant-design/icons/lib";
|
||||
import MessageBoxUtil from "../../../common/util/MessageBoxUtil";
|
||||
import Lang from "../../../common/model/global/Lang";
|
||||
|
||||
interface IProps {
|
||||
|
||||
@@ -67,7 +69,7 @@ export default class CreateTablePanel extends TankComponent<IProps, IState> {
|
||||
that.updateUI()
|
||||
|
||||
install.httpCreateTable(function () {
|
||||
MessageBoxUtil.success("建表成功!")
|
||||
MessageBoxUtil.success(Lang.t("install.createTableSuccess"))
|
||||
}, null, function () {
|
||||
|
||||
that.createTableLoading = false
|
||||
@@ -91,7 +93,7 @@ export default class CreateTablePanel extends TankComponent<IProps, IState> {
|
||||
this.props.onNextStep()
|
||||
|
||||
} else {
|
||||
MessageBoxUtil.error("请首先完成建表")
|
||||
MessageBoxUtil.error(Lang.t("install.crateTableFirst"))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -118,25 +120,25 @@ export default class CreateTablePanel extends TankComponent<IProps, IState> {
|
||||
|
||||
{
|
||||
(tableInfo.tableExist && tableInfo.missingFields.length === 0) && (
|
||||
<Tag className="mh5" color={Color.SUCCESS}>已安装</Tag>
|
||||
<Tag className="mh5" color={Color.SUCCESS}>{Lang.t("install.installed")}</Tag>
|
||||
)
|
||||
}
|
||||
|
||||
{
|
||||
(tableInfo.tableExist && tableInfo.missingFields.length > 0) && (
|
||||
<Tag className="mh5" color={Color.DANGER}>已安装,字段缺失</Tag>
|
||||
<Tag className="mh5" color={Color.DANGER}>{Lang.t("install.installedButMissing")}</Tag>
|
||||
)
|
||||
}
|
||||
|
||||
{
|
||||
!tableInfo.tableExist && (
|
||||
<Tag className="mh5" color={Color.WARNING}>待安装</Tag>
|
||||
<Tag className="mh5" color={Color.WARNING}>{Lang.t("install.toBeInstalled")}</Tag>
|
||||
)
|
||||
}
|
||||
</div>
|
||||
|
||||
<div className="mt10">
|
||||
所有字段:
|
||||
{Lang.t("install.allFields")}:
|
||||
{
|
||||
tableInfo.allFields.map(function (field: any, j: number) {
|
||||
|
||||
@@ -153,7 +155,7 @@ export default class CreateTablePanel extends TankComponent<IProps, IState> {
|
||||
{
|
||||
(tableInfo.tableExist && tableInfo.missingFields.length > 0) && (
|
||||
<div className="mt10">
|
||||
缺失字段:
|
||||
{Lang.t("install.missingFields")}:
|
||||
{
|
||||
tableInfo.missingFields.map(function (field: any, j: number) {
|
||||
|
||||
@@ -174,12 +176,31 @@ export default class CreateTablePanel extends TankComponent<IProps, IState> {
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
<div>
|
||||
<Alert
|
||||
message={<div>
|
||||
<div><SoundOutlined/> {Lang.t("install.tableNotice")}</div>
|
||||
<div>
|
||||
<ol>
|
||||
<li> {Lang.t("install.tableNotice1")}</li>
|
||||
<li>{Lang.t("install.tableNotice2")}</li>
|
||||
<li>{Lang.t("install.tableNotice3")}</li>
|
||||
<li>{Lang.t("install.tableNotice4")}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>}
|
||||
type="info"
|
||||
/>
|
||||
</div>
|
||||
|
||||
|
||||
<div className="text-right mt15">
|
||||
<Button className={'ml10'} type={"default"}
|
||||
icon={<SyncOutlined/>}
|
||||
onClick={this.fetchTableInfoList.bind(this)}
|
||||
>
|
||||
刷新
|
||||
{Lang.t("refresh")}
|
||||
</Button>
|
||||
|
||||
<Button className={'ml10'} type={tableCreated ? "primary" : "default"}
|
||||
@@ -188,16 +209,16 @@ export default class CreateTablePanel extends TankComponent<IProps, IState> {
|
||||
disabled={tableCreated}
|
||||
loading={this.createTableLoading}
|
||||
>
|
||||
{tableCreated ? '已完成建表' : '一键建表'}
|
||||
{tableCreated ? Lang.t("install.createFinish") : Lang.t("install.oneKeyCreate")}
|
||||
</Button>
|
||||
|
||||
<Button className={'ml10'} ghost={true} type="primary" icon={<ArrowLeftOutlined/>}
|
||||
onClick={this.goToPrevious.bind(this)}>
|
||||
上一步
|
||||
{Lang.t("install.preStep")}
|
||||
</Button>
|
||||
<Button className={'ml10'} ghost={true} type="primary" icon={<ArrowRightOutlined/>}
|
||||
onClick={this.goToNext.bind(this)}>
|
||||
下一步
|
||||
{Lang.t("install.nextStep")}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -4,6 +4,7 @@ import Install from "../../../common/model/install/Install";
|
||||
import TankComponent from "../../../common/component/TankComponent";
|
||||
import {Button, Result} from "antd";
|
||||
import {HomeOutlined} from "@ant-design/icons/lib";
|
||||
import Lang from "../../../common/model/global/Lang";
|
||||
|
||||
interface IProps {
|
||||
|
||||
@@ -63,12 +64,12 @@ export default class FinishPanel extends TankComponent<IProps, IState> {
|
||||
<div className="widget-finish-panel">
|
||||
<Result
|
||||
status="success"
|
||||
title="安装信息配置完毕!"
|
||||
subTitle="点击下方按钮来完成安装过程并进入首页。"
|
||||
title={Lang.t("install.congratulationInstall")}
|
||||
subTitle={Lang.t("install.pressToHome")}
|
||||
extra={[
|
||||
<Button icon={<HomeOutlined/>} type="primary" key="home" loading={that.loading}
|
||||
onClick={this.finish.bind(this)}>
|
||||
完成,并进入首页
|
||||
{Lang.t("install.enterHome")}
|
||||
</Button>
|
||||
]}
|
||||
/>
|
||||
|
||||
@@ -6,6 +6,7 @@ import TankComponent from "../../../common/component/TankComponent";
|
||||
import {FormInstance} from "antd/lib/form";
|
||||
import {ArrowRightOutlined, DisconnectOutlined, LinkOutlined, SoundOutlined} from "@ant-design/icons/lib";
|
||||
import MessageBoxUtil from "../../../common/util/MessageBoxUtil";
|
||||
import Lang from "../../../common/model/global/Lang";
|
||||
|
||||
interface IProps {
|
||||
install: Install
|
||||
@@ -48,7 +49,7 @@ export default class MysqlPanel extends TankComponent<IProps, IState> {
|
||||
install.httpVerify(function () {
|
||||
|
||||
install.verified = true
|
||||
MessageBoxUtil.success("MySQL连接测试通过!")
|
||||
MessageBoxUtil.success(Lang.t("install.mysqlConnectionPass"))
|
||||
that.updateUI()
|
||||
|
||||
}, function (msg: any) {
|
||||
@@ -73,7 +74,7 @@ export default class MysqlPanel extends TankComponent<IProps, IState> {
|
||||
this.props.onNextStep()
|
||||
|
||||
} else {
|
||||
MessageBoxUtil.error("请首先验证数据库连接")
|
||||
MessageBoxUtil.error(Lang.t("install.validateMysqlFirst"))
|
||||
|
||||
}
|
||||
|
||||
@@ -108,55 +109,55 @@ export default class MysqlPanel extends TankComponent<IProps, IState> {
|
||||
label="MySQL host"
|
||||
name="mysqlHost"
|
||||
initialValue={install.mysqlHost}
|
||||
rules={[{required: true, message: '请输入MySQL host!'}]}
|
||||
rules={[{required: true, message: Lang.t("inputRequired")}]}
|
||||
>
|
||||
<Input/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="MySQL 端口"
|
||||
label={Lang.t("install.port")}
|
||||
name="mysqlPort"
|
||||
initialValue={install.mysqlPort}
|
||||
rules={[{required: true, message: '请输入MySQL 端口!'}]}
|
||||
rules={[{required: true, message: Lang.t("inputRequired")}]}
|
||||
>
|
||||
<Input/>
|
||||
</Form.Item>
|
||||
|
||||
|
||||
<Form.Item
|
||||
label="MySQL 库名"
|
||||
label={Lang.t("install.schema")}
|
||||
name="mysqlSchema"
|
||||
initialValue={install.mysqlSchema}
|
||||
rules={[{required: true, message: '请输入MySQL 库名!'}]}
|
||||
rules={[{required: true, message: Lang.t("inputRequired")}]}
|
||||
>
|
||||
<Input/>
|
||||
</Form.Item>
|
||||
|
||||
|
||||
<Form.Item
|
||||
label="MySQL 用户名"
|
||||
label={Lang.t("install.username")}
|
||||
name="mysqlUsername"
|
||||
initialValue={install.mysqlUsername}
|
||||
rules={[{required: true, message: '请输入MySQL 用户名!'}]}
|
||||
rules={[{required: true, message: Lang.t("inputRequired")}]}
|
||||
>
|
||||
<Input/>
|
||||
</Form.Item>
|
||||
|
||||
|
||||
<Form.Item
|
||||
label="MySQL 密码"
|
||||
label={Lang.t("install.password")}
|
||||
name="mysqlPassword"
|
||||
initialValue={install.mysqlPassword}
|
||||
rules={[{required: true, message: '请输入MySQL 密码!'}]}
|
||||
rules={[{required: true, message: Lang.t("inputRequired")}]}
|
||||
>
|
||||
<Input.Password/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="MySQL 编码"
|
||||
label={Lang.t("install.charset")}
|
||||
name="mysqlCharset"
|
||||
initialValue={install.mysqlCharset}
|
||||
rules={[{required: true, message: '请输入MySQL 编码!'}]}
|
||||
rules={[{required: true, message: Lang.t("inputRequired")}]}
|
||||
>
|
||||
<Select>
|
||||
<Select.Option value="utf8">utf8</Select.Option>
|
||||
@@ -168,11 +169,11 @@ export default class MysqlPanel extends TankComponent<IProps, IState> {
|
||||
<div>
|
||||
<Alert
|
||||
message={<div>
|
||||
<div><SoundOutlined/> 提示:</div>
|
||||
<div><SoundOutlined/> {Lang.t("install.notice")}</div>
|
||||
<div>
|
||||
<ol>
|
||||
<li>如果数据库和蓝眼云盘安装在同一台服务器,Host可以直接填写 127.0.0.1。</li>
|
||||
<li>数据库账户的权限要求要能够创建表,否则第二步"创建表"操作会出错。</li>
|
||||
<li> {Lang.t("install.mysqlNotice1")}</li>
|
||||
<li>{Lang.t("install.mysqlNotice2")}</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>}
|
||||
@@ -183,11 +184,11 @@ export default class MysqlPanel extends TankComponent<IProps, IState> {
|
||||
<div className="text-right mt15">
|
||||
<Button type={install.verified ? "primary" : "default"} htmlType="submit"
|
||||
icon={install.verified ? <LinkOutlined/> : <DisconnectOutlined/>}>
|
||||
{install.verified ? 'MySQL测试通过' : '测试MySQL连接性'}
|
||||
{install.verified ? Lang.t("install.mysqlConnectionPass") : Lang.t("install.testMysqlConnection")}
|
||||
</Button>
|
||||
<Button className={'ml10'} ghost={true} type="primary" icon={<ArrowRightOutlined/>}
|
||||
onClick={this.goToNext.bind(this)}>
|
||||
下一步
|
||||
{Lang.t("install.nextStep")}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -6,6 +6,7 @@ import MessageBoxUtil from "../../../common/util/MessageBoxUtil";
|
||||
import PhaseSelectingPanel from "./inner/PhaseSelectingPanel";
|
||||
import PhaseVerifyPanel from "./inner/PhaseVerifyPanel";
|
||||
import PhaseCreatePanel from "./inner/PhaseCreatePanel";
|
||||
import Lang from "../../../common/model/global/Lang";
|
||||
|
||||
enum Phase {
|
||||
//选择界面
|
||||
@@ -61,7 +62,7 @@ export default class SetAdminPanel extends TankComponent<IProps, IState> {
|
||||
this.props.onNextStep()
|
||||
|
||||
} else {
|
||||
MessageBoxUtil.error("请首先完成管理员设置")
|
||||
MessageBoxUtil.error(Lang.t("install.configAdminFirst"))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@ import Install from "../../../../common/model/install/Install";
|
||||
import MessageBoxUtil from "../../../../common/util/MessageBoxUtil";
|
||||
import {Button, Form, Input} from "antd";
|
||||
import {ArrowLeftOutlined, SendOutlined} from "@ant-design/icons/lib";
|
||||
import Lang from "../../../../common/model/global/Lang";
|
||||
|
||||
interface IProps {
|
||||
|
||||
@@ -45,7 +46,7 @@ export default class PhaseCreatePanel extends TankComponent<IProps, IState> {
|
||||
install.adminRepassword = values["adminRepassword"]
|
||||
|
||||
install.httpCreateAdmin(function () {
|
||||
MessageBoxUtil.success("管理员创建成功!")
|
||||
MessageBoxUtil.success(Lang.t("install.createAdminSuccess"))
|
||||
that.props.onSuccess()
|
||||
})
|
||||
};
|
||||
@@ -69,7 +70,7 @@ export default class PhaseCreatePanel extends TankComponent<IProps, IState> {
|
||||
<div className="widget-phase-verify-panel">
|
||||
|
||||
<div className="text-center">
|
||||
<h2>创建新管理员账户</h2>
|
||||
<h2>{Lang.t("install.createAdministrator")}</h2>
|
||||
</div>
|
||||
|
||||
<Form
|
||||
@@ -82,17 +83,17 @@ export default class PhaseCreatePanel extends TankComponent<IProps, IState> {
|
||||
}}
|
||||
>
|
||||
<Form.Item
|
||||
label="管理员用户名"
|
||||
label={Lang.t("install.administratorUsername")}
|
||||
name="adminUsername"
|
||||
rules={[{required: true, message: '请输入管理员用户名!'}]}
|
||||
rules={[{required: true, message: Lang.t("inputRequired")}]}
|
||||
>
|
||||
<Input/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="管理员密码"
|
||||
label={Lang.t("install.administratorPassword")}
|
||||
name="adminPassword"
|
||||
rules={[{required: true, message: '请输入管理员密码!'}]}
|
||||
rules={[{required: true, message: Lang.t("inputRequired")}]}
|
||||
>
|
||||
<Input.Password/>
|
||||
</Form.Item>
|
||||
@@ -100,20 +101,20 @@ export default class PhaseCreatePanel extends TankComponent<IProps, IState> {
|
||||
|
||||
<Form.Item
|
||||
name="adminRepassword"
|
||||
label="确认密码"
|
||||
label={Lang.t("install.administratorRePassword")}
|
||||
dependencies={['adminPassword']}
|
||||
hasFeedback
|
||||
rules={[
|
||||
{
|
||||
required: true,
|
||||
message: '请输入确认密码!',
|
||||
message: Lang.t("inputRequired"),
|
||||
},
|
||||
({getFieldValue}) => ({
|
||||
validator(rule, value) {
|
||||
if (!value || getFieldValue('adminPassword') === value) {
|
||||
return Promise.resolve();
|
||||
}
|
||||
return Promise.reject('两次输入密码不匹配!');
|
||||
return Promise.reject(Lang.t("user.passwordNotSame"));
|
||||
},
|
||||
}),
|
||||
]}
|
||||
@@ -125,14 +126,14 @@ export default class PhaseCreatePanel extends TankComponent<IProps, IState> {
|
||||
|
||||
<Button className={'ml10'} ghost={true} type="primary" icon={<ArrowLeftOutlined/>}
|
||||
onClick={this.props.onPreStep.bind(this)}>
|
||||
上一步
|
||||
{Lang.t("install.preStep")}
|
||||
</Button>
|
||||
|
||||
<Button className={'ml10'} type={"primary"}
|
||||
icon={<SendOutlined/>}
|
||||
htmlType="submit"
|
||||
>
|
||||
提交
|
||||
{Lang.t("submit")}
|
||||
</Button>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -11,6 +11,7 @@ import {
|
||||
SyncOutlined,
|
||||
UserAddOutlined
|
||||
} from "@ant-design/icons/lib";
|
||||
import Lang from "../../../../common/model/global/Lang";
|
||||
|
||||
interface IProps {
|
||||
install: Install
|
||||
@@ -70,7 +71,7 @@ export default class PhaseSelectingPanel extends TankComponent<IProps, IState> {
|
||||
<div className="widget-phase-selecting-panel">
|
||||
|
||||
<div>
|
||||
检测到系统中已经存在有以下管理员:
|
||||
{Lang.t("install.detectAdministrator")}:
|
||||
</div>
|
||||
{
|
||||
install.adminList.map(function (admin: User, index: number) {
|
||||
@@ -83,7 +84,7 @@ export default class PhaseSelectingPanel extends TankComponent<IProps, IState> {
|
||||
}
|
||||
|
||||
<div>
|
||||
你可以使用其中一位管理员的用户名和密码进行验证,或者创建一位新的管理员账户
|
||||
{Lang.t("install.useOrCreateAdministrator")}
|
||||
</div>
|
||||
|
||||
<div className="text-right mt15">
|
||||
@@ -92,30 +93,30 @@ export default class PhaseSelectingPanel extends TankComponent<IProps, IState> {
|
||||
onClick={this.refreshAdminList.bind(this)}
|
||||
loading={this.loadingAdminList}
|
||||
>
|
||||
刷新
|
||||
{Lang.t("refresh")}
|
||||
</Button>
|
||||
|
||||
<Button className={'ml10'} type={"default"}
|
||||
icon={<SecurityScanOutlined/>}
|
||||
onClick={this.props.onSelectVerify.bind(this)}
|
||||
>
|
||||
验证管理员账户
|
||||
{Lang.t("install.validateAdministrator")}
|
||||
</Button>
|
||||
|
||||
<Button className={'ml10'} type={"default"}
|
||||
icon={<UserAddOutlined/>}
|
||||
onClick={this.props.onSelectCreate.bind(this)}
|
||||
>
|
||||
创建管理员账户
|
||||
{Lang.t("install.createAdministrator")}
|
||||
</Button>
|
||||
|
||||
<Button className={'ml10'} ghost={true} type="primary" icon={<ArrowLeftOutlined/>}
|
||||
onClick={this.props.onPreStep.bind(this)}>
|
||||
上一步
|
||||
{Lang.t("install.preStep")}
|
||||
</Button>
|
||||
<Button className={'ml10'} ghost={true} type="primary" icon={<ArrowRightOutlined/>}
|
||||
onClick={this.props.onNextStep.bind(this)}>
|
||||
下一步
|
||||
{Lang.t("install.nextStep")}
|
||||
</Button>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -5,6 +5,7 @@ import Install from "../../../../common/model/install/Install";
|
||||
import {Button, Form, Input} from "antd";
|
||||
import {ArrowLeftOutlined, SendOutlined} from "@ant-design/icons/lib";
|
||||
import MessageBoxUtil from "../../../../common/util/MessageBoxUtil";
|
||||
import Lang from "../../../../common/model/global/Lang";
|
||||
|
||||
interface IProps {
|
||||
|
||||
@@ -46,7 +47,7 @@ export default class PhaseVerifyPanel extends TankComponent<IProps, IState> {
|
||||
install.adminPassword = values["adminPassword"]
|
||||
|
||||
install.httpValidateAdmin(function () {
|
||||
MessageBoxUtil.success("管理员验证成功!")
|
||||
MessageBoxUtil.success(Lang.t("install.validateAdminSuccess"))
|
||||
|
||||
that.props.onSuccess()
|
||||
})
|
||||
@@ -72,7 +73,7 @@ export default class PhaseVerifyPanel extends TankComponent<IProps, IState> {
|
||||
<div className="widget-phase-verify-panel">
|
||||
|
||||
<div className="text-center">
|
||||
<h2>验证管理员账户</h2>
|
||||
<h2>{Lang.t("install.validateAdministrator")}</h2>
|
||||
</div>
|
||||
|
||||
<Form
|
||||
@@ -85,17 +86,17 @@ export default class PhaseVerifyPanel extends TankComponent<IProps, IState> {
|
||||
}}
|
||||
>
|
||||
<Form.Item
|
||||
label="管理员用户名"
|
||||
label={Lang.t("install.administratorUsername")}
|
||||
name="adminUsername"
|
||||
rules={[{required: true, message: '请输入管理员用户名!'}]}
|
||||
rules={[{required: true, message: Lang.t("inputRequired")}]}
|
||||
>
|
||||
<Input/>
|
||||
</Form.Item>
|
||||
|
||||
<Form.Item
|
||||
label="管理员密码"
|
||||
label={Lang.t("install.administratorPassword")}
|
||||
name="adminPassword"
|
||||
rules={[{required: true, message: '请输入管理员密码!'}]}
|
||||
rules={[{required: true, message: Lang.t("inputRequired")}]}
|
||||
>
|
||||
<Input.Password/>
|
||||
</Form.Item>
|
||||
@@ -104,14 +105,14 @@ export default class PhaseVerifyPanel extends TankComponent<IProps, IState> {
|
||||
|
||||
<Button className={'ml10'} ghost={true} type="primary" icon={<ArrowLeftOutlined/>}
|
||||
onClick={this.props.onPreStep.bind(this)}>
|
||||
上一步
|
||||
{Lang.t("install.preStep")}
|
||||
</Button>
|
||||
|
||||
<Button className={'ml10'} type={"primary"}
|
||||
icon={<SendOutlined/>}
|
||||
htmlType="submit"
|
||||
>
|
||||
提交
|
||||
{Lang.t("submit")}
|
||||
</Button>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user