-
Notifications
You must be signed in to change notification settings - Fork 458
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ks-3.4.1]feat: Devops pipeline run detail page add params tab (#4212)
feat: devops pipeline run detail page add params tab Signed-off-by: yazhou <[email protected]>
- Loading branch information
Showing
19 changed files
with
230 additions
and
20 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
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
51 changes: 51 additions & 0 deletions
51
src/pages/devops/containers/Pipelines/Detail/Parameters/Item.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,51 @@ | ||
/* | ||
* 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 classNames from 'classnames' | ||
import styles from './item.scss' | ||
|
||
const ItemWrapper = props => { | ||
const { title, list } = props | ||
return ( | ||
<div className={classNames(styles.card, {})}> | ||
<div className={styles.header}> | ||
<div className={styles.title}>{title}</div> | ||
</div> | ||
<div className={classNames(styles.content, {})}> | ||
{list.map((item, index) => { | ||
return ( | ||
<div key={index} className={styles.item}> | ||
{Array.isArray(item) && | ||
item.map(i => ( | ||
<span key={i} className={styles.kv}> | ||
{i} | ||
</span> | ||
))} | ||
{typeof item === 'string' && ( | ||
<span className={styles.kv}>{item}</span> | ||
)} | ||
</div> | ||
) | ||
})} | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default ItemWrapper |
35 changes: 35 additions & 0 deletions
35
src/pages/devops/containers/Pipelines/Detail/Parameters/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,35 @@ | ||
/* | ||
* 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 EmptyCard from 'devops/components/Cards/EmptyCard' | ||
import { get } from 'lodash' | ||
import { inject, observer } from 'mobx-react' | ||
import * as React from 'react' | ||
import ItemWrapper from './Item' | ||
|
||
const Parameters = props => { | ||
const data = get(props, 'spec.parameters', []).flatMap(item => [ | ||
[item.name, item.value], | ||
]) | ||
if (data.length === 0) { | ||
return <EmptyCard desc={t('NO_BUILD_PARAMETERS')} /> | ||
} | ||
return <ItemWrapper title={t('BUILD_PARAMETERS')} list={data} /> | ||
} | ||
|
||
export default inject('detailStore')(observer(Parameters)) |
88 changes: 88 additions & 0 deletions
88
src/pages/devops/containers/Pipelines/Detail/Parameters/item.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,88 @@ | ||
// Variables | ||
$color-palette-wb-white: #fff; | ||
$color-palette-light-light-color-02: #eff4f9; | ||
$color-palette-light-light-color-06: #ccd3db; | ||
$paragraph-heading-color: #242e42; | ||
$neutral-neutral-15: #242e42; | ||
|
||
// Mixins | ||
@mixin cardBase { | ||
display: grid; | ||
grid-template-columns: 1fr; | ||
gap: 16px; | ||
border-radius: 4px; | ||
background: $color-palette-wb-white; | ||
box-shadow: 0px 4px 8px 0px rgba(36, 46, 66, 0.06); | ||
padding: 16px; | ||
} | ||
|
||
@mixin itemBase { | ||
border-radius: 22px; | ||
padding: 12px 32px; | ||
} | ||
|
||
@mixin textRegular { | ||
color: $paragraph-heading-color; | ||
font-family: PingFang SC; | ||
font-size: 12px; | ||
font-style: normal; | ||
font-weight: 400; | ||
line-height: 20px; | ||
font-feature-settings: 'clig' off, 'liga' off; | ||
} | ||
|
||
@mixin textTitle { | ||
color: $paragraph-heading-color; | ||
font-family: PingFang SC; | ||
font-size: 14px; | ||
font-style: normal; | ||
font-weight: 600; | ||
line-height: 20px; | ||
font-feature-settings: 'clig' off, 'liga' off; | ||
} | ||
|
||
.card + .card { | ||
margin-top: 12px; | ||
} | ||
|
||
.card { | ||
@include cardBase; | ||
|
||
&.hideContent { | ||
gap: 0; | ||
} | ||
.title { | ||
@include textTitle; | ||
} | ||
|
||
.header { | ||
display: grid; | ||
grid-template-columns: 1fr auto; | ||
align-items: center; | ||
} | ||
|
||
.item { | ||
@include itemBase; | ||
border: 1px solid $color-palette-light-light-color-06; | ||
background: $color-palette-light-light-color-02; | ||
display: grid; | ||
grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); | ||
} | ||
|
||
.item + .item { | ||
margin-top: 12px; | ||
} | ||
|
||
.kv { | ||
@include textRegular; | ||
} | ||
.content { | ||
max-height: 1000px; | ||
animation: max-height 0.3s ease-in-out; | ||
overflow: hidden; | ||
&.hide { | ||
max-height: 0; | ||
animation: max-height 0.3s ease-in-out reverse; | ||
} | ||
} | ||
} |
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