项目详情-项目类型显示

This commit is contained in:
caishi 2020-07-03 10:25:07 +08:00
parent 47e04190ca
commit 1cdf81eb8a
1 changed files with 9 additions and 8 deletions

View File

@ -161,8 +161,6 @@ class Detail extends Component {
}
getProject = (num) => {
const name = window.location.hostname === "localhost" ? "testforgeplus.trustie.net":window.location.hostname;
console.log(`wss:${name}/cable`);
const { projectsId } = this.props.match.params;
const url = `/projects/${projectsId}/simple.json`;
axios.get(url).then((result) => {
@ -197,9 +195,8 @@ class Detail extends Component {
}
canvasChannel = () => {
const name = window.location.hostname === "localhost" ? "http://testforgeplus.trustie.net":window.location.hostname;
console.log(`wss:${name}/cable`);
const actioncable = require("actioncable")
var project = this.state.project
var project = this.state.project;
var cable = actioncable.createConsumer(`wss:${name}/cable`);
this.canvasChannel1 = cable.subscriptions.create({
channel: `MirrorProjectChannel`,
@ -381,10 +378,14 @@ class Detail extends Component {
</Tooltip> : ""
}
{
projectDetail && checkLogin && projectDetail.type && projectDetail.type === 2 ?
<Tooltip placement={'right'} title={mirror}>
<i className="iconfont icon-banbenku font-18 fl mt6 ml10" style={{ color: "#8D90E3" }}></i>
</Tooltip> : ""
projectDetail && checkLogin && projectDetail.type && projectDetail.type !== 0 ?
projectDetail.type === 2 ?
<Tooltip title="该项目是一个镜像" className="ml5">
<i className="iconfont icon-banbenku font-18" style={{ color: "#8D90E3" }}/>
</Tooltip>:
<span className="ml5">
<i className="iconfont icon-jingxiang font-18 color-green" />
</span>:""
}
</span>
</p>