Skip to content

Commit

Permalink
fix: Detail page init loading value (#522)
Browse files Browse the repository at this point in the history
* fix: Deploy page button translate
  • Loading branch information
whDongRui authored Oct 31, 2018
1 parent fd64091 commit fa8adbe
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/Layout/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ export default class Layout extends Component {
{backBtn}

<Loading isLoading={isLoading} className={styles[loadClass]}>
{!isLoading && children}
{children}
</Loading>
</div>
);
Expand Down
5 changes: 3 additions & 2 deletions src/pages/Admin/Apps/Deploy/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ export default class AppDeploy extends Component {
}

renderFooter() {
const { t } = this.props;
const { isLoading, isK8s, runtimes, versions, subnets } = this.props.appDeployStore;

if (!this.isDeployReady()) {
Expand All @@ -309,10 +310,10 @@ export default class AppDeploy extends Component {
className={styles.btn}
disabled={isLoading || !canSubmit}
>
Confirm
{t('Confirm')}
</Button>
<Button onClick={this.handleCancel} className={styles.btn}>
Cancel
{t('Cancel')}
</Button>
</div>
);
Expand Down
9 changes: 4 additions & 5 deletions src/pages/Admin/Clusters/Detail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ import styles from './index.scss';
@observer
export default class ClusterDetail extends Component {
state = {
isLoading: true
isLoading: false
};

async componentDidMount() {
Expand All @@ -46,6 +46,7 @@ export default class ClusterDetail extends Component {
match
} = this.props;
const { clusterId } = match.params;
this.setState({ isLoading: true });

await clusterDetailStore.fetch(clusterId);
await clusterDetailStore.fetchJobs(clusterId);
Expand All @@ -68,7 +69,7 @@ export default class ClusterDetail extends Component {
if (!runtimeStore.isK8s) {
await sshKeyStore.fetchKeyPairs({ owner: user.user_id });
}
this.setState({isLoading: false});
this.setState({ isLoading: false });
// if (!runtimeStore.isK8s) {
// // vmbase
// } else {
Expand Down Expand Up @@ -388,13 +389,11 @@ export default class ClusterDetail extends Component {
</Card>
</Section>


<Section size={8}>
<Loading isLoading={isLoading}>
{!isLoading && <Panel>{isK8s ? <Helm cluster={cluster} /> : <VMbase cluster={cluster} />}</Panel>}
<Panel>{isK8s ? <Helm cluster={cluster} /> : <VMbase cluster={cluster} />}</Panel>
</Loading>
</Section>

</Grid>

{this.renderModals()}
Expand Down
5 changes: 3 additions & 2 deletions src/pages/AppDetail/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@ import styles from './index.scss';
@observer
export default class AppDetail extends Component {
state = {
isLoading: true
isLoading: false
};

async componentDidMount() {
const { rootStore, appStore, repoStore, appVersionStore, user, match } = this.props;
const { appId, versionId } = match.params;

this.setState({ isLoading: true });
rootStore.setNavFix(true);
appVersionStore.appId = appId;
appStore.currentPic = 1;
Expand All @@ -57,7 +58,7 @@ export default class AppDetail extends Component {
if (providerName === 'kubernetes' && version_id) {
await appVersionStore.fetchPackageFiles(version_id);
}
this.setState({isLoading: false});
this.setState({ isLoading: false });
}

componentWillUnmount() {
Expand Down

0 comments on commit fa8adbe

Please sign in to comment.