Skip to content

Commit 06fa369

Browse files
committed
fix: loading of profile management
1 parent 97577bc commit 06fa369

File tree

3 files changed

+30
-12
lines changed

3 files changed

+30
-12
lines changed

media/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
},
1414
"dependencies": {
1515
"@alicloud/console-components": "^1.6.2",
16+
"@ant-design/icons": "^5.3.7",
1617
"@monaco-editor/react": "^4.6.0",
1718
"@vercel/ncc": "^0.38.1",
1819
"@vscode-elements/elements": "^1.3.0",

media/src/components/ProfileManager/ProfileManagerIndex.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
import { Button, Form, Input, Message } from "@alicloud/console-components";
66
import React from "react";
77
import { PontUIService } from "../../service/UIService";
8+
import { message } from "antd";
9+
import { LoadingOutlined } from "@ant-design/icons";
810

911
export class ProfileManagerIndexProps {}
1012

@@ -30,9 +32,10 @@ export const ProfileManagerIndex: React.FC<ProfileManagerIndexProps> = (props) =
3032
</div>
3133
{status === "success" ? (
3234
<div className="my-4 text-base">
33-
<Message type="success" style={{ borderRadius: 4 }}>
34-
新增成功!
35-
</Message>
35+
<div className="flex w-[100%] rounded-sm bg-[#d8f5d8] px-4 py-2 text-sm">
36+
<div className="codicon codicon-pass-filled success m-[2px] mr-1 leading-5 text-green-600"></div>
37+
<div className="text-[12px] leading-5 text-gray-600">新增成功!</div>
38+
</div>
3639
<div className="my-8 flex justify-end">
3740
<Button
3841
type="primary"
@@ -55,14 +58,10 @@ export const ProfileManagerIndex: React.FC<ProfileManagerIndexProps> = (props) =
5558
) : (
5659
<div>
5760
{status === "loading" ? (
58-
<Message type="loading" className="my-4 text-base" style={{ border: "none" }}>
59-
写入中...
60-
</Message>
61-
) : null}
62-
{status === "faild" ? (
63-
<Message type="error" className="my-4 text-base" style={{ borderRadius: 4 }}>
64-
添加失败,请重试
65-
</Message>
61+
<div className="my-4 flex w-[100%] rounded-sm bg-[#f6f6f6] px-4 py-2 text-sm">
62+
<LoadingOutlined />
63+
<div className="ml-2 text-[12px] leading-5 text-gray-600">写入中...</div>
64+
</div>
6665
) : null}
6766
<Form labelAlign="left">
6867
<Form.Item label={<span className="text-sm font-medium">Profile 名称</span>} required>
@@ -121,7 +120,8 @@ export const ProfileManagerIndex: React.FC<ProfileManagerIndexProps> = (props) =
121120
if (res.success === true) {
122121
setStatus("success");
123122
} else {
124-
setStatus("faild");
123+
message.error("添加失败,请重试");
124+
setStatus("edit");
125125
}
126126
});
127127
}

media/yarn.lock

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@
9292
resolved "https://registry.npmmirror.com/@ant-design/icons-svg/-/icons-svg-4.3.1.tgz#4b2f65a17d4d32b526baa6414aca2117382bf8da"
9393
integrity sha512-4QBZg8ccyC6LPIRii7A0bZUk3+lEDCLnhB+FVsflGdcWPPmV+j3fire4AwwoqHV/BibgvBmR9ZIo4s867smv+g==
9494

95+
"@ant-design/icons-svg@^4.4.0":
96+
version "4.4.2"
97+
resolved "https://registry.npmmirror.com/@ant-design/icons-svg/-/icons-svg-4.4.2.tgz#ed2be7fb4d82ac7e1d45a54a5b06d6cecf8be6f6"
98+
integrity sha512-vHbT+zJEVzllwP+CM+ul7reTEfBR0vgxFe7+lREAsAA7YGsYpboiq2sQNeQeRvh09GfQgs/GyFEvZpJ9cLXpXA==
99+
95100
"@ant-design/icons@^5.2.6":
96101
version "5.2.6"
97102
resolved "https://registry.npmmirror.com/@ant-design/icons/-/icons-5.2.6.tgz#2d4a9a37f531eb2a20cebec01d6fb69cf593900d"
@@ -103,6 +108,17 @@
103108
classnames "^2.2.6"
104109
rc-util "^5.31.1"
105110

111+
"@ant-design/icons@^5.3.7":
112+
version "5.3.7"
113+
resolved "https://registry.npmmirror.com/@ant-design/icons/-/icons-5.3.7.tgz#d9f3654bf7934ee5faba43f91b5a187f5309ec68"
114+
integrity sha512-bCPXTAg66f5bdccM4TT21SQBDO1Ek2gho9h3nO9DAKXJP4sq+5VBjrQMSxMVXSB3HyEz+cUbHQ5+6ogxCOpaew==
115+
dependencies:
116+
"@ant-design/colors" "^7.0.0"
117+
"@ant-design/icons-svg" "^4.4.0"
118+
"@babel/runtime" "^7.11.2"
119+
classnames "^2.2.6"
120+
rc-util "^5.31.1"
121+
106122
"@ant-design/react-slick@~1.0.2":
107123
version "1.0.2"
108124
resolved "https://registry.npmmirror.com/@ant-design/react-slick/-/react-slick-1.0.2.tgz#241bb412aeacf7ff5d50c61fa5db66773fde6b56"
@@ -5644,6 +5660,7 @@ string-convert@^0.2.0:
56445660
integrity sha512-u/1tdPl4yQnPBjnVrmdLo9gtuLvELKsAoRapekWggdiQNvvvum+jYF329d84NAa660KQw7pB2n36KrIKVoXa3A==
56455661

56465662
"string-width-cjs@npm:string-width@^4.2.0", string-width@^4.1.0:
5663+
name string-width-cjs
56475664
version "4.2.3"
56485665
resolved "https://registry.npmmirror.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
56495666
integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==

0 commit comments

Comments
 (0)