Skip to content

Commit 39d18a2

Browse files
authored
🚀 Add user profile page and optimize button color (#82)
* * 新增个人信息页面,优化按钮颜色
1 parent d03b9ba commit 39d18a2

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+762
-85
lines changed

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
"@fortawesome/react-fontawesome": "^0.2.2",
2121
"@pansy/react-charts": "^1.0.0",
2222
"@quiet-front-end/json-schema-editor-antd": "^0.3.0",
23+
"@shadcn/ui": "^0.0.4",
2324
"@testing-library/jest-dom": "^5.16.2",
2425
"@testing-library/react": "^12.1.3",
2526
"@testing-library/user-event": "^13.5.0",
@@ -29,13 +30,14 @@
2930
"boostrap": "^2.0.0",
3031
"codemirror": "^6.0.1",
3132
"codemirror-promql": "0.17.0",
33+
"components": "^0.1.0",
3234
"downshift": "^9.0.6",
3335
"echarts": "^5.4.3",
3436
"echarts-for-react": "^3.0.2",
3537
"framer-motion": "^11.13.5",
3638
"jsoneditor": "^10.0.0",
3739
"jsoneditor-react": "^3.1.2",
38-
"lucide-react": "^0.468.0",
40+
"lucide-react": "^0.469.0",
3941
"moment": "^2.30.1",
4042
"next": "^15.1.0",
4143
"prom-client": "^15.1.0",
@@ -82,4 +84,4 @@
8284
"postcss": "^8.4.49",
8385
"tailwindcss": "^3.4.16"
8486
}
85-
}
87+
}

src/components/index.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,12 @@ import {
1515
} from '@ant-design/icons';
1616
import { DownOutlined, LeftOutlined } from '@ant-design/icons';
1717
import logoIcon from '../img/logo.jpeg'
18-
import githubIcon from '../img/github_logo.png'
1918
import { getUserInfo } from '../api/user'
2019
import Auth from '../utils/Auth'
2120
import { getTenantList } from '../api/tenant'
2221
import './index.css';
2322
import { ComponentSider } from './sider'
24-
import { useNavigate } from 'react-router-dom'
23+
import {Link, useNavigate} from 'react-router-dom'
2524

2625
export const ComponentsContent = (props) => {
2726
const { name, c } = props
@@ -45,6 +44,10 @@ export const ComponentsContent = (props) => {
4544

4645
const content = (
4746
<>
47+
<Button type="text">
48+
<Link to={`/profile`}>个人信息</Link>
49+
</Button>
50+
4851
<Button type="text" onClick={handleLogout}>
4952
<span style={{color: 'red'}}>退出登录</span>
5053
</Button>
@@ -97,6 +100,8 @@ export const ComponentsContent = (props) => {
97100
}
98101
setTenantStatus(true);
99102
} catch (error) {
103+
localStorage.clear()
104+
message.error("获取租户错误, 退出登录")
100105
console.error(error)
101106
}
102107
}

src/pages/alert/rule/AlertRuleCreateModal.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1511,7 +1511,13 @@ export const AlertRuleCreateModal = ({ visible, onClose, selectedRow, type, hand
15111511
</div>
15121512

15131513
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
1514-
<Button type="primary" htmlType="submit">
1514+
<Button
1515+
type="primary"
1516+
htmlType="submit"
1517+
style={{
1518+
backgroundColor: '#000000'
1519+
}}
1520+
>
15151521
提交
15161522
</Button>
15171523
</div>

src/pages/alert/rule/create.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1873,7 +1873,13 @@ export const AlertRule = ({ type }) => {
18731873
</div>
18741874

18751875
<div style={{display: 'flex', justifyContent: 'flex-end'}}>
1876-
<Button type="primary" htmlType="submit">
1876+
<Button
1877+
type="primary"
1878+
htmlType="submit"
1879+
style={{
1880+
backgroundColor: '#000000'
1881+
}}
1882+
>
18771883
提交
18781884
</Button>
18791885
</div>

src/pages/alert/rule/index.jsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,12 @@ export const AlertRuleList = () => {
288288
</div>
289289
<div>
290290
<Link to={`/ruleGroup/${id}/rule/add`}>
291-
<Button type="primary"> 创 建 </Button>
291+
<Button
292+
type="primary"
293+
style={{
294+
backgroundColor: '#000000'
295+
}}
296+
> 创 建 </Button>
292297
</Link>
293298
</div>
294299
</div>

src/pages/alert/ruleGroup/AlertRuleGroupCreateModal.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,13 @@ export const AlertRuleGroupCreateModal = ({ visible, onClose, selectedRow, type,
101101
</MyFormItem>
102102

103103
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
104-
<Button type="primary" htmlType="submit">
104+
<Button
105+
type="primary"
106+
htmlType="submit"
107+
style={{
108+
backgroundColor: '#000000'
109+
}}
110+
>
105111
提交
106112
</Button>
107113
</div>

src/pages/alert/ruleGroup/index.jsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,14 @@ export const AlertRuleGroup = ({ }) => {
192192
/>
193193
</div>
194194
<div>
195-
<Button type="primary" onClick={() => setCreateModalVisible(true)} style={{marginLeft: 'auto'}}>
195+
<Button
196+
type="primary"
197+
onClick={() => setCreateModalVisible(true)}
198+
style={{
199+
marginLeft: 'auto',
200+
backgroundColor: '#000000'
201+
}}
202+
>
196203
创建
197204
</Button>
198205
</div>

src/pages/alert/tmpl/RuleTemplateCreateModal.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -840,7 +840,13 @@ const RuleTemplateCreateModal = ({ visible, onClose, selectedRow, type, handleLi
840840

841841
{type !== 'view' &&
842842
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
843-
<Button type="primary" htmlType="submit">
843+
<Button
844+
type="primary"
845+
htmlType="submit"
846+
style={{
847+
backgroundColor: '#000000'
848+
}}
849+
>
844850
提交
845851
</Button>
846852
</div>

src/pages/alert/tmpl/index.jsx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,7 +198,13 @@ export const RuleTemplate = () => {
198198
<Search allowClear placeholder="输入搜索关键字" onSearch={onSearch} style={{ width: 300 }} />
199199
</div>
200200
<div>
201-
<Button type="primary" onClick={() => setVisible(true)}>
201+
<Button
202+
type="primary"
203+
onClick={() => setVisible(true)}
204+
style={{
205+
backgroundColor: '#000000'
206+
}}
207+
>
202208
创建
203209
</Button>
204210
</div>
@@ -227,7 +233,12 @@ export const RuleTemplate = () => {
227233
<Button onClick={handleCloseSelectedRuleGroup} style={{marginRight: '10px'}}>
228234
取消
229235
</Button>
230-
<Button type="primary" onClick={handleSubmitUseTmplToRule}>
236+
<Button
237+
type="primary"
238+
onClick={handleSubmitUseTmplToRule}
239+
style={{
240+
backgroundColor: '#000000'
241+
}}>
231242
提交
232243
</Button>
233244
</div>

src/pages/alert/tmplGroup/RuleTemplateGroupCreateModal.jsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,13 @@ const RuleTemplateGroupCreateModal = ({ visible, onClose, selectedRow, openType,
103103
</MyFormItem>
104104

105105
<div style={{ display: 'flex', justifyContent: 'flex-end' }}>
106-
<Button type="primary" htmlType="submit">
106+
<Button
107+
type="primary"
108+
htmlType="submit"
109+
style={{
110+
backgroundColor: '#000000'
111+
}}
112+
>
107113
提交
108114
</Button>
109115
</div>

0 commit comments

Comments
 (0)