-
Notifications
You must be signed in to change notification settings - Fork 111
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Feat: add the envbinding route page (#663)
Signed-off-by: barnettZQG <[email protected]> (cherry picked from commit ca4301a) Co-authored-by: barnettZQG <[email protected]>
- Loading branch information
1 parent
af2cfe3
commit 5ef1a13
Showing
10 changed files
with
96 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Loading } from '@b-design/ui'; | ||
import { connect } from 'dva'; | ||
import { routerRedux } from 'dva/router'; | ||
import React, { useEffect } from 'react'; | ||
import type { Dispatch } from 'redux'; | ||
import { getApplicationEnvbinding } from '../../api/application'; | ||
|
||
const EnvRoute = (props: { match: { params: { appName: string } }; dispatch: Dispatch<any> }) => { | ||
useEffect(() => { | ||
getApplicationEnvbinding({ appName: props.match.params.appName }).then((res) => { | ||
if (res && Array.isArray(res.envBindings) && res.envBindings.length > 0) { | ||
props.dispatch( | ||
routerRedux.push( | ||
`/applications/${props.match.params.appName}/envbinding/${res.envBindings[0].name}/workflow`, | ||
), | ||
); | ||
} else { | ||
props.dispatch(routerRedux.push(`/applications/${props.match.params.appName}`)); | ||
} | ||
}); | ||
}); | ||
return <Loading visible={true} />; | ||
}; | ||
|
||
export default connect()(EnvRoute); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters