|
|
@ -1,12 +1,11 @@
|
|
|
|
import React from "react";
|
|
|
|
import React from "react";
|
|
|
|
import '../../../../App.css';
|
|
|
|
import '../../../../App.css';
|
|
|
|
import {PageHeader, Typography, Input, Button, Row, Col, Avatar, Card} from "antd";
|
|
|
|
import {PageHeader, Typography, Row, Col, message, Card} from "antd";
|
|
|
|
import {connect} from "react-redux";
|
|
|
|
import axios from 'axios';
|
|
|
|
|
|
|
|
import config from "../../../../../public/conf/config.json";
|
|
|
|
import ReleaseView from "../../../../components/apps/release/ReleaseView";
|
|
|
|
import ReleaseView from "../../../../components/apps/release/ReleaseView";
|
|
|
|
import {getRelease} from "../../../../js/actions";
|
|
|
|
|
|
|
|
import LifeCycle from "../../../../components/apps/release/LifeCycle";
|
|
|
|
import LifeCycle from "../../../../components/apps/release/LifeCycle";
|
|
|
|
|
|
|
|
|
|
|
|
const Search = Input.Search;
|
|
|
|
|
|
|
|
const {Title} = Typography;
|
|
|
|
const {Title} = Typography;
|
|
|
|
|
|
|
|
|
|
|
|
const routes = [
|
|
|
|
const routes = [
|
|
|
@ -24,31 +23,67 @@ const routes = [
|
|
|
|
},
|
|
|
|
},
|
|
|
|
];
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
|
|
const mapStateToProps = state => {
|
|
|
|
|
|
|
|
return {release: state.release}
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const mapDispatchToProps = dispatch => ({
|
|
|
|
class Release extends React.Component {
|
|
|
|
getRelease: (uuid) => dispatch(getRelease(uuid))
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class ConnectedRelease extends React.Component {
|
|
|
|
|
|
|
|
routes;
|
|
|
|
routes;
|
|
|
|
|
|
|
|
|
|
|
|
constructor(props) {
|
|
|
|
constructor(props) {
|
|
|
|
super(props);
|
|
|
|
super(props);
|
|
|
|
this.routes = props.routes;
|
|
|
|
this.routes = props.routes;
|
|
|
|
|
|
|
|
this.state={
|
|
|
|
|
|
|
|
loading: true,
|
|
|
|
|
|
|
|
app: null,
|
|
|
|
|
|
|
|
uuid: null
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
componentDidMount() {
|
|
|
|
componentDidMount() {
|
|
|
|
const {uuid} = this.props.match.params;
|
|
|
|
const {uuid} = this.props.match.params;
|
|
|
|
this.props.getRelease(uuid);
|
|
|
|
this.fetchData(uuid);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
componentDidUpdate(prevProps, prevState, snapshot) {
|
|
|
|
|
|
|
|
if (prevState.uuid !== this.state.uuid) {
|
|
|
|
|
|
|
|
const {uuid} = this.props.match.params;
|
|
|
|
|
|
|
|
this.fetchData(uuid);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fetchData = (uuid)=>{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//send request to the invoker
|
|
|
|
|
|
|
|
axios.get(
|
|
|
|
|
|
|
|
config.serverConfig.protocol + "://"+config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + config.serverConfig.invokerUri+"/applications/release/"+uuid,
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
headers: { 'X-Platform': config.serverConfig.platform }
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
).then(res => {
|
|
|
|
|
|
|
|
if (res.status === 200) {
|
|
|
|
|
|
|
|
let app = res.data.data;
|
|
|
|
|
|
|
|
this.setState({
|
|
|
|
|
|
|
|
app: app,
|
|
|
|
|
|
|
|
loading: false,
|
|
|
|
|
|
|
|
uuid: uuid
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).catch((error) => {
|
|
|
|
|
|
|
|
if (error.hasOwnProperty("response") && error.response.status === 401) {
|
|
|
|
|
|
|
|
//todo display a popop with error
|
|
|
|
|
|
|
|
message.error('You are not logged in');
|
|
|
|
|
|
|
|
window.location.href = config.serverConfig.protocol + "://" + config.serverConfig.hostname + ':' + config.serverConfig.httpsPort + '/store/login';
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
message.error('Something went wrong... :(');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setState({loading: false});
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
render() {
|
|
|
|
render() {
|
|
|
|
|
|
|
|
const {app} = this.state;
|
|
|
|
|
|
|
|
const release = app;
|
|
|
|
|
|
|
|
|
|
|
|
const release = this.props.release;
|
|
|
|
|
|
|
|
if (release == null) {
|
|
|
|
if (release == null) {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div style={{background: '#f0f2f5', padding: 24, minHeight: 780}}>
|
|
|
|
<div style={{background: '#f0f2f5', padding: 24, minHeight: 780}}>
|
|
|
@ -72,7 +107,7 @@ class ConnectedRelease extends React.Component {
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
<Col lg={8} md={24} style={{padding: 3}}>
|
|
|
|
<Col lg={8} md={24} style={{padding: 3}}>
|
|
|
|
<Card lg={8} md={24}>
|
|
|
|
<Card lg={8} md={24}>
|
|
|
|
<LifeCycle currentStatus={release.currentStatus.toUpperCase()}/>
|
|
|
|
{/*<LifeCycle currentStatus={release.currentStatus.toUpperCase()}/>*/}
|
|
|
|
</Card>
|
|
|
|
</Card>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
</Row>
|
|
|
|
</Row>
|
|
|
@ -83,6 +118,4 @@ class ConnectedRelease extends React.Component {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const Release = connect(mapStateToProps,mapDispatchToProps)(ConnectedRelease);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
export default Release;
|
|
|
|
export default Release;
|
|
|
|