Skip to content

Commit 0d82bc1

Browse files
author
agile.zhou
committed
Merge branch 'master' into publish
2 parents 73d4ed8 + 1f1c465 commit 0d82bc1

18 files changed

Lines changed: 340 additions & 23 deletions

File tree

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,17 @@ CN Atomgit Mirror site: [AgileConfig](https://atomgit.com/dotnetcore/AgileConfig
3939
12. role base user permission control
4040

4141
🔆🔆🔆Demo Project :[AgileConfig Server Demo](http://agileconfig_server.xbaby.xyz) name.pwd= admin/123456🔆🔆🔆
42-
client project :[AgileConfig_Client](https://github.com/kklldog/AgileConfig_Client)
42+
43+
Community Resource:
44+
.NET Client:[AgileConfig_Client](https://github.com/kklldog/AgileConfig_Client)
45+
JAVA Client:[AgileConfig_JClient](https://github.com/kklldog/agileconfig-jclient)
46+
GO Client:[agileconfig_client_go](https://github.com/kklldog/agileconfig_client_go)
47+
Python Client:[agileconfig_client_python](https://github.com/kklldog/agileconfig_client_python)
48+
GO Client:[go-agile-config](https://github.com/animacaeli/go-agile-config)
49+
Python Client:[py-agile-config](https://github.com/animacaeli/py-agile-config)
50+
Nodejs Client: [node-agile-client](https://github.com/LetTTGACO/node-agile-client)
51+
Blazor UI:[AgileConfigBlazorUI](https://github.com/EzrealJ/AgileConfigBlazorUI)
52+
4353
samples :
4454
[AgileConfigMVCSample](https://github.com/kklldog/AgileConfig_Client/tree/master/AgileConfigMVCSample)
4555
[AgileConfig WPFSample](https://github.com/kklldog/AgileConfig_Client/tree/master/AgileConfigWPFSample)

README_CN.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,15 @@ AgileConfig秉承轻量化的特点,部署简单、配置简单、使用简单
3333
❤️❤️ 演示地址:[AgileConfig Server Demo](https://agileconfig-server.xbaby.xyz) 用户名:admin 密码:123456
3434
🎥[演示视频](https://www.bilibili.com/video/BV1FwqeYcEy9/?vd_source=767c7a8e20240041358ff961ab0cb9e5)
3535

36+
社区资源:
3637
.NET 客户端项目:[AgileConfig_Client](https://github.com/kklldog/AgileConfig_Client)
3738
JAVA 客户端项目:[AgileConfig_JClient](https://github.com/kklldog/agileconfig-jclient)
39+
GO 客户端项目:[AgileConfig_GoClient](https://github.com/kklldog/agileconfig_client_go)
40+
Python 客户端项目:[AgileConfig_GoClient](https://github.com/kklldog/agileconfig_client_python)
41+
GO 客户端项目:[go-agile-config](https://github.com/animacaeli/go-agile-config)
42+
Python 客户端项目:[py-agile-config](https://github.com/animacaeli/py-agile-config)
43+
Nodejs 实现的客户端: [node-agile-client](https://github.com/LetTTGACO/node-agile-client)
44+
Blazor 实现的管理界面:[AgileConfigBlazorUI](https://github.com/EzrealJ/AgileConfigBlazorUI)
3845

3946
示例项目:
4047
[AgileConfig MVCSample](https://github.com/kklldog/AgileConfig_Client/tree/master/AgileConfigMVCSample)
@@ -46,11 +53,7 @@ JAVA 客户端项目:[AgileConfig_JClient](https://github.com/kklldog/agilecon
4653
[教程 - 如何开启 SSO](https://www.cnblogs.com/kklldog/p/agileconfig-170.html)
4754
💥[常见问题,必看!!!](https://github.com/kklldog/AgileConfig/wiki/%E5%B8%B8%E8%A7%81%E9%97%AE%E9%A2%98%EF%BC%8C%E5%BF%85%E7%9C%8B%EF%BC%81%EF%BC%81%EF%BC%81)
4855
[关于多环境的部署说明](https://github.com/dotnetcore/AgileConfig/wiki/%E5%85%B3%E4%BA%8E-1.5-%E7%89%88%E6%9C%AC%E6%94%AF%E6%8C%81%E5%A4%9A%E7%8E%AF%E5%A2%83%E7%9A%84%E8%AF%B4%E6%98%8E)
49-
[如何对接 OpenTelemetry 查看 log,trace,metric](https://mp.weixin.qq.com/s/QoagvZrCby1jI6g3XzZUAg)
50-
51-
社区资源:
52-
🌷 基于 Nodejs 实现的客户端: [node-agile-client](https://github.com/LetTTGACO/node-agile-client)
53-
🌷 基于 Blazor 实现的管理界面:[AgileConfigBlazorUI](https://github.com/EzrealJ/AgileConfigBlazorUI)
56+
[如何对接 OpenTelemetry 查看 log,trace,metric](https://mp.weixin.qq.com/s/QoagvZrCby1jI6g3XzZUAg)
5457

5558
Restful API:
5659
[✈️ restful api](https://github.com/kklldog/AgileConfig/wiki/Restful-API)

README_EN.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,17 @@ CN Atomgit Mirror site: [AgileConfig](https://atomgit.com/dotnetcore/AgileConfig
3838
11. also can be use as a simple service register center
3939

4040
🔆🔆🔆Demo Project :[AgileConfig Server Demo](http://agileconfig_server.xbaby.xyz) name.pwd= admin/123456🔆🔆🔆
41-
client project :[AgileConfig_Client](https://github.com/kklldog/AgileConfig_Client)
41+
42+
Community Resource:
43+
.NET Client:[AgileConfig_Client](https://github.com/kklldog/AgileConfig_Client)
44+
JAVA Client:[AgileConfig_JClient](https://github.com/kklldog/agileconfig-jclient)
45+
GO Client:[AgileConfig_GoClient](https://github.com/kklldog/agileconfig_client_go)
46+
Python Client:[AgileConfig_GoClient](https://github.com/kklldog/agileconfig_client_python)
47+
GO Client:[go-agile-config](https://github.com/animacaeli/go-agile-config)
48+
Python Client:[py-agile-config](https://github.com/animacaeli/py-agile-config)
49+
Nodejs Client: [node-agile-client](https://github.com/LetTTGACO/node-agile-client)
50+
Blazor UI:[AgileConfigBlazorUI](https://github.com/EzrealJ/AgileConfigBlazorUI)
51+
4252
samples :
4353
[AgileConfigMVCSample](https://github.com/kklldog/AgileConfig_Client/tree/master/AgileConfigMVCSample)
4454
[AgileConfig WPFSample](https://github.com/kklldog/AgileConfig_Client/tree/master/AgileConfigWPFSample)

src/AgileConfig.Server.Apisite/AgileConfig.Server.Apisite.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,4 @@
8181
</VisualStudio>
8282
</ProjectExtensions>
8383

84-
</Project>
84+
</Project>

src/AgileConfig.Server.UI/react-ui-antd/config/defaultSettings.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { Settings as ProSettings } from '@ant-design/pro-layout';
22

33
type DefaultSettings = Partial<ProSettings> & {
44
pwa: boolean;
5+
darkMode: boolean;
56
};
67

78
const proSettings: DefaultSettings ={
@@ -13,6 +14,7 @@ const proSettings: DefaultSettings ={
1314
"fixSiderbar": true,
1415
"title": "AgileConfig",
1516
"pwa": false,
17+
"darkMode": false,
1618
"iconfontUrl": "",
1719
"menu": {
1820
"locale": true

src/AgileConfig.Server.UI/react-ui-antd/src/components/GlobalHeader/RightContent.tsx

Lines changed: 31 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
1-
import { Tag } from 'antd';
1+
import { BulbFilled, BulbOutlined } from '@ant-design/icons';
2+
import { Tag, Tooltip } from 'antd';
23
import type { Settings as ProSettings } from '@ant-design/pro-layout';
34
import React from 'react';
45
import type { ConnectProps } from 'umi';
5-
import { connect, SelectLang } from 'umi';
6+
import { connect, SelectLang, useIntl } from 'umi';
67
import type { ConnectState } from '@/models/connect';
78
import Avatar from './AvatarDropdown';
89
import styles from './index.less';
910

1011
export type GlobalHeaderRightProps = {
1112
theme?: ProSettings['navTheme'] | 'realDark';
13+
darkMode?: boolean;
1214
} & Partial<ConnectProps> &
1315
Partial<ProSettings>;
1416

@@ -20,6 +22,8 @@ const ENVTagColor = {
2022

2123
const GlobalHeaderRight: React.SFC<GlobalHeaderRightProps> = (props) => {
2224
const { theme, layout } = props;
25+
const { formatMessage } = useIntl();
26+
const darkMode = !!props.darkMode;
2327
let className = styles.right;
2428

2529
if (theme === 'dark' && layout === 'top') {
@@ -28,6 +32,29 @@ const GlobalHeaderRight: React.SFC<GlobalHeaderRightProps> = (props) => {
2832

2933
return (
3034
<div className={className}>
35+
<Tooltip
36+
title={formatMessage({
37+
id: darkMode ? 'component.globalHeader.theme.light' : 'component.globalHeader.theme.dark',
38+
})}
39+
>
40+
<span
41+
aria-label={formatMessage({
42+
id: darkMode ? 'component.globalHeader.theme.light' : 'component.globalHeader.theme.dark',
43+
})}
44+
className={styles.action}
45+
role="button"
46+
tabIndex={0}
47+
onClick={() => props.dispatch?.({ type: 'settings/changeSetting', payload: { darkMode: !darkMode } })}
48+
onKeyDown={(event) => {
49+
if (event.key === 'Enter' || event.key === ' ') {
50+
event.preventDefault();
51+
props.dispatch?.({ type: 'settings/changeSetting', payload: { darkMode: !darkMode } });
52+
}
53+
}}
54+
>
55+
{darkMode ? <BulbFilled /> : <BulbOutlined />}
56+
</span>
57+
</Tooltip>
3158
<Avatar />
3259
{REACT_APP_ENV && (
3360
<span>
@@ -40,6 +67,7 @@ const GlobalHeaderRight: React.SFC<GlobalHeaderRightProps> = (props) => {
4067
};
4168

4269
export default connect(({ settings }: ConnectState) => ({
43-
theme: settings.navTheme,
70+
theme: settings.darkMode ? 'dark' : settings.navTheme,
4471
layout: settings.layout,
72+
darkMode: settings.darkMode,
4573
}))(GlobalHeaderRight);

src/AgileConfig.Server.UI/react-ui-antd/src/global.less

Lines changed: 179 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,4 +80,182 @@ ol {
8080
.ant-btn-primary.success:hover {
8181
border-color:#73d13d;
8282
background-color: #73d13d;
83-
}
83+
}
84+
85+
// Ant Design 4 generates its component palette at build time. These scoped
86+
// overrides keep the runtime theme switch consistent across application views.
87+
html.dark-mode {
88+
color-scheme: dark;
89+
90+
body,
91+
#root,
92+
.ant-layout,
93+
.ant-pro-basicLayout,
94+
.ant-pro-basicLayout-content,
95+
.ant-pro-page-container,
96+
.ant-pro-grid-content,
97+
.ant-pro-page-container-children-content {
98+
color: rgba(255, 255, 255, 0.85);
99+
background: #141414;
100+
}
101+
102+
.ant-pro-global-header,
103+
.ant-pro-global-header .ant-pro-global-header-layout-mix,
104+
.ant-pro-sider,
105+
.ant-layout-sider {
106+
background: #1f1f1f;
107+
}
108+
109+
.ant-card,
110+
.ant-modal-content,
111+
.ant-drawer-content,
112+
.ant-dropdown-menu,
113+
.ant-popover-inner,
114+
.ant-select-dropdown,
115+
.ant-picker-dropdown,
116+
.ant-cascader-menu,
117+
.ant-menu-submenu-popup,
118+
.ant-message-notice-content,
119+
.ant-notification-notice,
120+
.ant-tooltip-inner {
121+
color: rgba(255, 255, 255, 0.85);
122+
background: #1f1f1f;
123+
}
124+
125+
.ant-card,
126+
.ant-modal-header,
127+
.ant-modal-footer,
128+
.ant-drawer-header,
129+
.ant-popover-inner,
130+
.ant-dropdown-menu,
131+
.ant-select-dropdown,
132+
.ant-picker-panel-container,
133+
.ant-table,
134+
.ant-table-container,
135+
.ant-descriptions-bordered .ant-descriptions-item-label,
136+
.ant-descriptions-bordered .ant-descriptions-item-content {
137+
border-color: #434343;
138+
}
139+
140+
.ant-modal-header,
141+
.ant-drawer-header,
142+
.ant-table,
143+
.ant-table-container,
144+
.ant-table-thead > tr > th,
145+
.ant-table-tbody > tr > td,
146+
.ant-descriptions-bordered .ant-descriptions-item-label,
147+
.ant-descriptions-bordered .ant-descriptions-item-content,
148+
.ant-list-item,
149+
.ant-collapse,
150+
.ant-collapse > .ant-collapse-item,
151+
.ant-tabs-top > .ant-tabs-nav::before,
152+
.ant-tabs-bottom > .ant-tabs-nav::before,
153+
.ant-tabs-top > div > .ant-tabs-nav::before,
154+
.ant-tabs-bottom > div > .ant-tabs-nav::before {
155+
border-color: #434343;
156+
}
157+
158+
.ant-modal-header,
159+
.ant-drawer-header,
160+
.ant-table-thead > tr > th,
161+
.ant-descriptions-bordered .ant-descriptions-item-label,
162+
.ant-collapse,
163+
.ant-collapse > .ant-collapse-item,
164+
.ant-pagination-item,
165+
.ant-pagination-prev .ant-pagination-item-link,
166+
.ant-pagination-next .ant-pagination-item-link {
167+
background: #262626;
168+
}
169+
170+
.ant-table-tbody > tr > td,
171+
.ant-table-tbody > tr.ant-table-row:hover > td,
172+
.ant-descriptions-bordered .ant-descriptions-item-content,
173+
.ant-collapse-content,
174+
.ant-collapse-content > .ant-collapse-content-box {
175+
color: rgba(255, 255, 255, 0.85);
176+
background: #1f1f1f;
177+
}
178+
179+
.ant-input,
180+
.ant-input-affix-wrapper,
181+
.ant-input-number,
182+
.ant-input-number-input,
183+
.ant-select:not(.ant-select-customize-input) .ant-select-selector,
184+
.ant-picker,
185+
.ant-mentions,
186+
.ant-transfer-list,
187+
.ant-btn:not(.ant-btn-primary):not(.danger):not(.warn):not(.success) {
188+
color: rgba(255, 255, 255, 0.85);
189+
background: #141414;
190+
border-color: #434343;
191+
}
192+
193+
.ant-input::placeholder,
194+
.ant-input-number-input::placeholder,
195+
.ant-select-selection-placeholder,
196+
.ant-empty-description,
197+
.ant-form-item-label > label,
198+
.ant-descriptions-title,
199+
.ant-modal-title,
200+
.ant-drawer-title,
201+
.ant-list-item-meta-title,
202+
.ant-statistic-title,
203+
.ant-page-header-heading-title {
204+
color: rgba(255, 255, 255, 0.65);
205+
}
206+
207+
.ant-select-item,
208+
.ant-dropdown-menu-item,
209+
.ant-dropdown-menu-submenu-title,
210+
.ant-menu-item,
211+
.ant-menu-submenu-title,
212+
.ant-picker-cell,
213+
.ant-picker-header,
214+
.ant-picker-content th,
215+
.ant-pagination-item a,
216+
.ant-pagination-prev .ant-pagination-item-link,
217+
.ant-pagination-next .ant-pagination-item-link,
218+
.ant-tabs-tab,
219+
.ant-list-item,
220+
.ant-descriptions-item-label,
221+
.ant-descriptions-item-content {
222+
color: rgba(255, 255, 255, 0.85);
223+
}
224+
225+
.ant-select-item-option-active:not(.ant-select-item-option-disabled),
226+
.ant-dropdown-menu-item:hover,
227+
.ant-dropdown-menu-submenu-title:hover,
228+
.ant-picker-cell-in-view.ant-picker-cell-selected .ant-picker-cell-inner,
229+
.ant-picker-cell-in-view.ant-picker-cell-in-range::before {
230+
background: #303030;
231+
}
232+
233+
.ant-pagination-item-active {
234+
border-color: @primary-color;
235+
}
236+
237+
.ant-pagination-item-active a,
238+
.ant-tabs-tab.ant-tabs-tab-active .ant-tabs-tab-btn,
239+
.ant-picker-cell-in-view.ant-picker-cell-today .ant-picker-cell-inner::before {
240+
color: @primary-color;
241+
}
242+
243+
.ant-result-title,
244+
.ant-result-subtitle,
245+
.ant-typography,
246+
.ant-typography h1,
247+
.ant-typography h2,
248+
.ant-typography h3,
249+
.ant-typography h4,
250+
.ant-typography h5,
251+
.ant-typography h6 {
252+
color: rgba(255, 255, 255, 0.85);
253+
}
254+
255+
.ant-pro-table .ant-card,
256+
.ant-pro-page-container-children-container,
257+
.ant-pro-page-container-content {
258+
background: transparent;
259+
}
260+
261+
}

src/AgileConfig.Server.UI/react-ui-antd/src/layouts/BasicLayout.tsx

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import {
77
MenuDataItem,
88
BasicLayoutProps as ProLayoutProps,
9-
Settings,
109
} from '@ant-design/pro-layout';
1110
import ProLayout from '@ant-design/pro-layout';
1211
import React, { useEffect, useMemo, useRef, useCallback } from 'react';
@@ -20,6 +19,7 @@ import type { ConnectState } from '@/models/connect';
2019
import { getMatchMenu } from '@umijs/route-utils';
2120
import logo from '../assets/logo.svg';
2221
import LayoutFooter from './compos/LayoutFooter';
22+
import type { DefaultSettings } from '../../config/defaultSettings';
2323

2424
const noMatch = (
2525
<Result
@@ -39,7 +39,7 @@ export type BasicLayoutProps = {
3939
authority: string[];
4040
};
4141
categories?: string[];
42-
settings: Settings;
42+
settings: DefaultSettings;
4343
dispatch: Dispatch;
4444
} & ProLayoutProps;
4545
export type BasicLayoutContext = { [K in 'location']: BasicLayoutProps[K] } & {
@@ -119,6 +119,7 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
119119
);
120120

121121
const { formatMessage } = useIntl();
122+
const { darkMode } = settings;
122123

123124
return (
124125
<ProLayout
@@ -127,6 +128,8 @@ const BasicLayout: React.FC<BasicLayoutProps> = (props) => {
127128
formatMessage={formatMessage}
128129
{...props}
129130
{...settings}
131+
navTheme={darkMode ? 'realDark' : settings.navTheme}
132+
headerTheme={darkMode ? 'dark' : settings.headerTheme}
130133
onCollapse={handleMenuCollapse}
131134
onMenuHeaderClick={() => history.push('/')}
132135
menuItemRender={(menuItemProps, defaultDom) => {

0 commit comments

Comments
 (0)