-
Notifications
You must be signed in to change notification settings - Fork 455
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6492e60
commit 716c3bf
Showing
25 changed files
with
1,799 additions
and
11 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
61 changes: 61 additions & 0 deletions
61
src/pages/devops/containers/ImageBuilder/Detail/BuildRecords/index.jsx
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,61 @@ | ||
/* | ||
* This file is part of KubeSphere Console. | ||
* Copyright (C) 2019 The KubeSphere Console Authors. | ||
* | ||
* KubeSphere Console is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* KubeSphere Console is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with KubeSphere Console. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import React from 'react' | ||
import { get } from 'lodash' | ||
import { observer, inject } from 'mobx-react' | ||
|
||
import ImageBuilderLastRun from 'projects/components/Cards/ImageBuilderLastRun' | ||
import RunRecords from 'projects/components/Cards/ImageRunRecord' | ||
import styles from './index.scss' | ||
|
||
@inject('detailStore', 's2iRunStore') | ||
@observer | ||
class BuildRecords extends React.Component { | ||
get store() { | ||
return this.props.detailStore | ||
} | ||
|
||
get isB2i() { | ||
return get(this.store.detail, 'spec.config.isBinaryURL') | ||
} | ||
|
||
render() { | ||
const { params } = this.props.match | ||
const { runDetail } = this.props.s2iRunStore | ||
|
||
return ( | ||
<React.Fragment> | ||
<div className={styles.title}>{t('LAST_BUILD_ENVIRONMENT')}</div> | ||
<div className={styles.card}> | ||
<ImageBuilderLastRun | ||
isB2i={this.isB2i} | ||
runDetail={runDetail} | ||
params={params} | ||
/> | ||
</div> | ||
<div className={styles.title}>{t('RUN_RECORDS')}</div> | ||
<div className={styles.card}> | ||
<RunRecords isB2i={this.isB2i} params={params} /> | ||
</div> | ||
</React.Fragment> | ||
) | ||
} | ||
} | ||
|
||
export default BuildRecords |
43 changes: 43 additions & 0 deletions
43
src/pages/devops/containers/ImageBuilder/Detail/BuildRecords/index.scss
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,43 @@ | ||
@import '~scss/variables'; | ||
@import '~scss/mixins'; | ||
|
||
.main { | ||
padding: 0; | ||
|
||
> div:first-child { | ||
padding: 20px 20px 0 20px; | ||
} | ||
} | ||
|
||
.table { | ||
:global { | ||
.table { | ||
border-radius: 0 0 $border-radius $border-radius; | ||
} | ||
} | ||
} | ||
|
||
.clickable { | ||
&:hover { | ||
cursor: pointer; | ||
color: $btn-primary-hover-bg; | ||
} | ||
} | ||
|
||
.content { | ||
padding-top: 20px; | ||
} | ||
|
||
.title { | ||
height: 20px; | ||
margin-bottom: 5px; | ||
@include TypographySymbolText; | ||
} | ||
|
||
.card { | ||
padding: 12px; | ||
margin-bottom: 12px; | ||
border-radius: 4px; | ||
box-shadow: 0 4px 8px 0 rgba(36, 46, 66, 0.06); | ||
background-color: #ffffff; | ||
} |
95 changes: 95 additions & 0 deletions
95
src/pages/devops/containers/ImageBuilder/Detail/Environment/index.jsx
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,95 @@ | ||
/* | ||
* This file is part of KubeSphere Console. | ||
* Copyright (C) 2019 The KubeSphere Console Authors. | ||
* | ||
* KubeSphere Console is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* KubeSphere Console is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with KubeSphere Console. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import React from 'react' | ||
import { toJS } from 'mobx' | ||
import { observer, inject } from 'mobx-react' | ||
import { isEmpty, get } from 'lodash' | ||
|
||
import EnvStore from 'stores/workload/env' | ||
|
||
import ContainerEnvCard from 'components/Cards/Containers/EnvVariables' | ||
|
||
@inject('s2iRunStore') | ||
@observer | ||
export default class EnvVariables extends React.Component { | ||
constructor(props) { | ||
super(props) | ||
this.envStore = new EnvStore() | ||
} | ||
|
||
componentDidMount() { | ||
this.fetchData() | ||
} | ||
|
||
get module() { | ||
return this.props.module | ||
} | ||
|
||
get store() { | ||
return this.props.s2iRunStore | ||
} | ||
|
||
get namespace() { | ||
return this.store.jobDetail.namespace | ||
} | ||
|
||
get cluster() { | ||
return this.props.match.params.cluster | ||
} | ||
|
||
get containers() { | ||
const data = toJS(this.store.jobDetail) | ||
const { spec, containers = [] } = data | ||
|
||
if (this.module === 'containers') return [data] | ||
|
||
if (!isEmpty(containers)) return containers | ||
if (!isEmpty(spec)) return get(spec, 'template.spec.containers', []) | ||
|
||
return [] | ||
} | ||
|
||
get test() { | ||
return '2' | ||
} | ||
|
||
fetchData = () => { | ||
this.envStore.fetchList({ | ||
cluster: this.cluster, | ||
namespace: this.namespace, | ||
containers: this.containers, | ||
}) | ||
} | ||
|
||
render() { | ||
const { data, isLoading } = toJS(this.envStore.list) | ||
return ( | ||
<div> | ||
{data.map((container, index) => ( | ||
<ContainerEnvCard | ||
key={index} | ||
detail={container} | ||
expand={index === 0} | ||
loading={isLoading} | ||
/> | ||
))} | ||
</div> | ||
) | ||
} | ||
} |
68 changes: 68 additions & 0 deletions
68
src/pages/devops/containers/ImageBuilder/Detail/Events/index.jsx
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,68 @@ | ||
/* | ||
* This file is part of KubeSphere Console. | ||
* Copyright (C) 2019 The KubeSphere Console Authors. | ||
* | ||
* KubeSphere Console is free software: you can redistribute it and/or modify | ||
* it under the terms of the GNU Affero General Public License as published by | ||
* the Free Software Foundation, either version 3 of the License, or | ||
* (at your option) any later version. | ||
* | ||
* KubeSphere Console is distributed in the hope that it will be useful, | ||
* but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
* GNU Affero General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU Affero General Public License | ||
* along with KubeSphere Console. If not, see <https://www.gnu.org/licenses/>. | ||
*/ | ||
|
||
import React from 'react' | ||
import { toJS } from 'mobx' | ||
import { observer, inject } from 'mobx-react' | ||
import { joinSelector } from 'utils' | ||
import EventStore from 'stores/event' | ||
|
||
import EventsCard from 'components/Cards/Events' | ||
|
||
class Events extends React.Component { | ||
constructor(props) { | ||
super(props) | ||
|
||
this.eventStore = new EventStore() | ||
this.fetchData() | ||
} | ||
|
||
get store() { | ||
return this.props.s2iRunStore | ||
} | ||
|
||
get namespace() { | ||
return this.store.jobDetail.namespace | ||
} | ||
|
||
fetchData = () => { | ||
const { uid, name, namespace } = this.store.jobDetail | ||
const { cluster } = this.props.match.params | ||
const fields = { | ||
'involvedObject.name': name, | ||
'involvedObject.namespace': namespace, | ||
'involvedObject.kind': 'Job', | ||
'involvedObject.uid': uid, | ||
} | ||
|
||
this.eventStore.fetchList({ | ||
cluster, | ||
namespace: this.namespace, | ||
fieldSelector: joinSelector(fields), | ||
}) | ||
} | ||
|
||
render() { | ||
const { data, isLoading } = toJS(this.eventStore.list) | ||
|
||
return <EventsCard data={data} loading={isLoading} /> | ||
} | ||
} | ||
|
||
export default inject('s2iRunStore')(observer(Events)) | ||
export const Component = Events |
Oops, something went wrong.