-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(mis-web): 管理系统用户空间下分区信息中计量方式显示错误 (#780)
### 问题 管理系统下用户空间的分区信息中没有显示正确的计量方式的文字描述字符串 ![image](https://github.com/PKUHPC/SCOW/assets/43978285/0a166bc5-dfb9-4a06-a5e0-b078fe74523a) 此PR修改为与作业价格表中的计量方式显示一致,修改为计量方式文字及icon说明的形式 ### 修改后 ![image](https://github.com/PKUHPC/SCOW/assets/43978285/f0ac2b69-3926-4d28-b1ec-613dbf7df4ae) ![image](https://github.com/PKUHPC/SCOW/assets/43978285/233512c9-8efa-4ac6-b6d7-fbeeb079b9dc)
- Loading branch information
Showing
4 changed files
with
88 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@scow/mis-web": patch | ||
--- | ||
|
||
修改管理系统用户空间集群分区的计量方式显示,修改为与作业价格表中显示方式一致 |
63 changes: 63 additions & 0 deletions
63
apps/mis-web/src/components/AmonutStrategyDescriptionsItem.tsx
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,63 @@ | ||
/** | ||
* Copyright (c) 2022 Peking University and Peking University Institute for Computing and Digital Economy | ||
* SCOW is licensed under Mulan PSL v2. | ||
* You can use this software according to the terms and conditions of the Mulan PSL v2. | ||
* You may obtain a copy of Mulan PSL v2 at: | ||
* http://license.coscl.org.cn/MulanPSL2 | ||
* THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, | ||
* EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, | ||
* MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE. | ||
* See the Mulan PSL v2 for more details. | ||
*/ | ||
|
||
import { QuestionCircleOutlined } from "@ant-design/icons"; | ||
import { Popover, Space } from "antd"; | ||
import React from "react"; | ||
import { AmountStrategyAlgorithmDescriptions, | ||
AmountStrategyDescription, AmountStrategyDescriptions, AmountStrategyText } from "src/models/job"; | ||
|
||
|
||
interface Props { | ||
isColContent?: boolean; | ||
amount?: string; | ||
isColTitle?: boolean; | ||
} | ||
|
||
export const AmountStrategyDescriptionsItem: React.FC<Props> = ({ | ||
amount, isColTitle, isColContent, | ||
}) => { | ||
|
||
if (isColContent && amount) { | ||
return ( | ||
<Space> | ||
{AmountStrategyDescriptions[amount]} | ||
<Popover | ||
title={`${AmountStrategyAlgorithmDescriptions[amount]}`} | ||
> | ||
<QuestionCircleOutlined /> | ||
</Popover> | ||
</Space> | ||
); | ||
} | ||
if (isColTitle) { | ||
return ( | ||
<Space> | ||
{AmountStrategyText} | ||
<Popover | ||
title={AmountStrategyDescription} | ||
content={( | ||
<div> | ||
<p> | ||
{Object.entries(AmountStrategyDescriptions) | ||
.map((value) => <p key={value[0]}>{`${value[1]}(${value[0]})`}</p>)} | ||
</p> | ||
<a href="https://pkuhpc.github.io/SCOW/docs/info/mis/business/billing">{"细节请查阅文档"}</a> | ||
</div> | ||
)} | ||
> | ||
<QuestionCircleOutlined /> | ||
</Popover> | ||
</Space> | ||
); | ||
} | ||
}; |
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