-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: add table version 2 in config page feat: tr feat(msp): refactor transaction feat(msp): refactor transaction feat(msp): refactor transaction feat(msp): refactor transaction * feat(msp): refactor transaction * feat(msp): remove mock feat(msp): remove empty file feat(msp): adjust chart grid * feat(msp): rename tab name feat(msp): remove extra entry * feat(msp): rename mode to theme Co-authored-by: 老俊 <782803291@qq.com>
- Loading branch information
Showing
23 changed files
with
1,385 additions
and
1,716 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
.cp-kv { | ||
&.dark { | ||
.items { | ||
background: rgba($white, 0.04); | ||
|
||
.items-value { | ||
color: $white; | ||
} | ||
|
||
.items-title, | ||
.items-unit { | ||
color: rgba($white, 0.6); | ||
} | ||
} | ||
} | ||
|
||
&.light { | ||
.items { | ||
background: rgba($color-default, 0.04); | ||
|
||
.items-value { | ||
color: $color-default; | ||
} | ||
|
||
.items-title, | ||
.items-unit { | ||
color: rgba($color-default, 0.6); | ||
} | ||
} | ||
} | ||
} |
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 @@ | ||
// Copyright (c) 2021 Terminus, Inc. | ||
// | ||
// This program is free software: you can use, redistribute, and/or modify | ||
// it under the terms of the GNU Affero General Public License, version 3 | ||
// or later ("AGPL"), as published by the Free Software Foundation. | ||
// | ||
// This program 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. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import React from 'react'; | ||
import { Col, Row, Tooltip } from 'antd'; | ||
import Ellipsis from 'common/components/ellipsis'; | ||
import ErdaIcon from 'common/components/erda-icon'; | ||
import './index.scss'; | ||
|
||
const IndicatorCard: React.FC<CP_KV.Props> = (props) => { | ||
const { props: configProps, data } = props; | ||
const { gutter = 8, span } = configProps || {}; | ||
const list = data.list ?? []; | ||
const itemSpan = span ?? new Array(list.length).fill(Math.ceil(24 / list.length)); | ||
return ( | ||
<Row className={`${configProps.wrapperClass ?? ''} ${configProps.theme ?? 'light'} cp-kv w-full`} gutter={gutter}> | ||
{list.map((item, index) => { | ||
return ( | ||
<Col key={item.key} span={itemSpan[index]}> | ||
<div className="items p-3"> | ||
<div className="text-center"> | ||
<span className="text-xl items-value">{item.value}</span> | ||
{item.subKey ? <span className="text-xs items-unit ml-0.5">{item.subKey}</span> : null} | ||
</div> | ||
<div className="flex justify-center items-center items-title"> | ||
<Ellipsis className="text-xs text-center" title={item.key} /> | ||
{item.tip ? ( | ||
<Tooltip title={item.tip}> | ||
<ErdaIcon type="help" color="currentColor" className="ml-0.5 cursor-pointer" /> | ||
</Tooltip> | ||
) : null} | ||
</div> | ||
</div> | ||
</Col> | ||
); | ||
})} | ||
</Row> | ||
); | ||
}; | ||
|
||
export default IndicatorCard; |
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,37 @@ | ||
// Copyright (c) 2021 Terminus, Inc. | ||
// | ||
// This program is free software: you can use, redistribute, and/or modify | ||
// it under the terms of the GNU Affero General Public License, version 3 | ||
// or later ("AGPL"), as published by the Free Software Foundation. | ||
// | ||
// This program 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. | ||
// | ||
// You should have received a copy of the GNU Affero General Public License | ||
// along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
declare namespace CP_KV { | ||
interface IProps { | ||
theme?: 'dark' | 'light'; | ||
gutter?: number; | ||
span?: number[]; | ||
wrapperClass?: string; | ||
className?: string; | ||
} | ||
|
||
interface Spec { | ||
type: 'KV'; | ||
props: IProps; | ||
data: { | ||
list: { | ||
key: string; | ||
value: string | number; | ||
subKey?: string; | ||
tip?: string; | ||
}[]; | ||
}; | ||
} | ||
|
||
type Props = MakeProps<Spec>; | ||
} |
Oops, something went wrong.