Finish all the work for installing.

This commit is contained in:
lishuang
2020-06-07 22:16:31 +08:00
parent 3902a657ee
commit dd20af4c19
2 changed files with 19 additions and 7 deletions
+7 -6
View File
@@ -95,13 +95,14 @@ class RawFrame extends TankComponent<IProps, IState> {
}, function (errMessage: string, response: any) {
that.initialized = true
that.updateUI()
if (response && response.data && response.data["code"] === WebResultCode.NOT_INSTALLED) {
MessageBoxUtil.warning("网站尚未安装,即将引导进入安装页面!")
that.preference.installed = false
Sun.navigateTo("/install/index")
}
that.initialized = true
that.updateUI()
})
@@ -142,7 +143,7 @@ class RawFrame extends TankComponent<IProps, IState> {
<Layout style={{minHeight: '100vh'}}>
<Sider>
{this.preference.installed?(
{this.preference.installed ? (
<div>
<div className="avatar-area">
<Link className="username-text" to={"/user/detail/" + user.uuid}>
@@ -158,7 +159,7 @@ class RawFrame extends TankComponent<IProps, IState> {
}
</div>
</div>
):(
) : (
<div className="install-area">
<img alt="avatar" className="install-logo" src={LogoSvg}/>
</div>
@@ -191,7 +192,7 @@ class RawFrame extends TankComponent<IProps, IState> {
<Content>
{
this.preference.installed?(
this.preference.installed ? (
<div className="pages-content">
<Route exact path="/" render={() =>
<Redirect to="/matter/list"/>
@@ -217,7 +218,7 @@ class RawFrame extends TankComponent<IProps, IState> {
<Route path="/matter/create" component={MatterEdit}/>
<Route path="/matter/edit/:uuid" component={MatterEdit}/>
</div>
):(
) : (
<div className="pages-content">
<Route path="/install/index" component={InstallIndex}/>
</div>
+12 -1
View File
@@ -18,6 +18,8 @@ interface IState {
export default class FinishPanel extends TankComponent<IProps, IState> {
loading: boolean = false
constructor(props: IProps) {
super(props);
@@ -36,11 +38,19 @@ export default class FinishPanel extends TankComponent<IProps, IState> {
let that = this
let install: Install = this.props.install
that.loading = true
that.updateUI()
install.httpFinish(function () {
window.location.href = "/"
}, null, function () {
that.loading = false
that.updateUI()
})
}
@@ -56,7 +66,8 @@ export default class FinishPanel extends TankComponent<IProps, IState> {
title="安装信息配置完毕!"
subTitle="点击下方按钮来完成安装过程并进入首页。"
extra={[
<Button icon={<HomeOutlined/>} type="primary" key="home" onClick={this.finish.bind(this)}>
<Button icon={<HomeOutlined/>} type="primary" key="home" loading={that.loading}
onClick={this.finish.bind(this)}>
</Button>
]}