@@ -9,33 +9,37 @@ import parseStatus from '../../pluginSet/status';
99
1010class MCard extends Component {
1111 render ( ) {
12- const { id, pluginName, remark, createdBy, repoName, pluginVersions } = this . props ;
12+ const { id, pluginName, remark, createdBy, repoName, pluginVersions, globalStatus } = this . props ;
1313 const { version, status, hasPrePublish, preStatus } = parseStatus ( pluginVersions ) ;
1414 const marketHref = window === window . top ? `${ window . location . origin } /plugins/detail/${ id } ` : `${ config . studioOrigin } /plugins/detail/${ id } ` ;
1515 const wsHref = `${ window === window . top ? window . location . origin : config . studioOrigin } /ws/?ownerName=${ createdBy } &projectName=${ repoName } ` ;
1616 return (
1717 < div className = "plugin-card" >
1818 < div className = "top" >
1919 {
20- status === 5 ? (
20+ ( status === 5 && globalStatus === 1 ) ? (
2121 < a className = "name" href = { marketHref } target = "_blank" rel = "noopener noreferrer" > { pluginName } </ a >
2222 ) : < span className = "name" > { pluginName } </ span >
2323 }
24- < div className = "right" >
25- { status === 5 && < div className = "version" > v{ version } </ div > }
26- {
27- ( hasPrePublish && preStatus === 2 ) ? (
28- < div className = "tag" > { i18n ( 'plugin.prePublish' ) } </ div >
29- ) : ( status === 5 && < div className = "tag" > { i18n ( 'plugin.published' ) } </ div > )
30- }
31- </ div >
24+ { globalStatus === 1 ? (
25+ < div className = "right" >
26+ { status === 5 && < div className = "version" > v{ version } </ div > }
27+ {
28+ ( hasPrePublish && preStatus === 2 ) ? (
29+ < div className = "tag" > { i18n ( 'plugin.prePublish' ) } </ div >
30+ ) : ( status === 5 && < div className = "tag" > { i18n ( 'plugin.published' ) } </ div > )
31+ }
32+ </ div >
33+ ) : < div className = "right" > < div className = "tag" > { i18n ( 'plugin.disabled' ) } </ div > </ div > }
3234 </ div >
3335 < div className = "desc" >
3436 < span > { remark } </ span >
3537 </ div >
3638 < div className = "control" >
37- < Link className = "button" to = { `/dashboard/plugin/mine/${ id } ` } > { i18n ( 'global.manage' ) } </ Link >
38- < a className = "button" href = { wsHref } target = "_blank" rel = "noopener noreferrer" > { i18n ( 'global.workspace' ) } </ a >
39+ < div className = "button-wrap" >
40+ < Link className = "button" to = { `/dashboard/plugin/mine/${ id } ` } > { i18n ( 'global.manage' ) } </ Link >
41+ < a className = "button" href = { wsHref } target = "_blank" rel = "noopener noreferrer" > { i18n ( 'global.workspace' ) } </ a >
42+ </ div >
3943 </ div >
4044 </ div >
4145 ) ;
0 commit comments