-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'feature' of https://github.com/juicecube/mlz-admin into…
… release
- Loading branch information
Showing
123 changed files
with
1,781 additions
and
29,534 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 |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
"status": { | ||
"project": { | ||
"default": { | ||
"threshold": 0.70 | ||
"threshold": 20% | ||
} | ||
} | ||
} | ||
|
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 |
---|---|---|
|
@@ -5,7 +5,6 @@ on: | |
types: [closed] | ||
branches: | ||
- release | ||
- 'release/*' | ||
|
||
jobs: | ||
publish: | ||
|
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 |
---|---|---|
|
@@ -11,13 +11,41 @@ const getMds = ($relativedFromDoc) => { | |
return files; | ||
}; | ||
|
||
const { SENTRY_DSN, VERCEL_ENV } = process.env; | ||
const productionConf = | ||
VERCEL_ENV === 'production' | ||
? { | ||
externals: { | ||
'@sentry/browser': 'window.sentry', | ||
'@sentry/tracing': 'window.sentryTracing', | ||
}, | ||
scripts: ['https://unpkg.com/browse/[email protected]/umd/react.production.min.js'], | ||
headScripts: [ | ||
{ | ||
content: `window.process.env = ${process.env}`, | ||
charset: 'utf-8', | ||
}, | ||
{ | ||
content: `sentry.init({ | ||
dsn: ${SENTRY_DSN}, | ||
integrations: [ | ||
new sentryTracing.BrowserTracing(), | ||
], | ||
tracesSampleRate: 1.0, | ||
})`, | ||
charset: 'utf-8', | ||
}, | ||
], | ||
} | ||
: {}; | ||
|
||
export default defineConfig({ | ||
hash: true, | ||
title: '@mlz/admin', | ||
mode: 'site', | ||
favicon: '/assets/logo.36.png', | ||
logo: '/assets/logo.360.png', | ||
locales: [['中文']], | ||
locales: [['zh-CN', '中文']], | ||
menus: { | ||
'/components': [ | ||
{ | ||
|
@@ -49,7 +77,7 @@ export default defineConfig({ | |
{ title: 'Libra投放系统', path: 'https://libra.codemao.cn/' }, | ||
{ title: '行政综合支撑平台', path: 'https://support-admin.codemao.cn/' }, | ||
{ title: 'LuckyCat营销管理系统', path: 'https://luckycat-admin.codemao.cn/' }, | ||
// { title: '供应链管理', path: 'coming' }, | ||
{ title: 'SCM供应链管理系统', path: 'https://supply-chain-manage-admin.codemao.cn/' }, | ||
], | ||
}, | ||
{ | ||
|
@@ -66,4 +94,15 @@ export default defineConfig({ | |
'@c-link': '#1890FF', | ||
'@s-nav-height': '76px', | ||
}, | ||
metas: [ | ||
{ | ||
name: 'keywords', | ||
content: 'react, components, 编程猫, antd', | ||
}, | ||
{ | ||
name: 'description', | ||
content: '一套编程猫设计规范下的管理系统React组件库,基于Antd', | ||
}, | ||
], | ||
...productionConf, | ||
}); |
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
File renamed without changes.
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,19 @@ | ||
.committers-wrapper { | ||
border-top: 1px solid #ebedf1; | ||
padding-top: 34px; | ||
margin-top: 34px; | ||
position: relative; | ||
.joinus-btn { | ||
position: absolute; | ||
right: 0; | ||
top: 24px; | ||
z-index: 1001; | ||
} | ||
ul { | ||
list-style: none; | ||
padding: 0; | ||
li { | ||
margin-bottom: 12px; | ||
} | ||
} | ||
} |
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,87 @@ | ||
import React, { useState, useEffect, CSSProperties } from 'react'; | ||
import axios from 'axios'; | ||
import { Avatar, Tooltip, Typography, Spin, Button, Icon, Affix } from '@mlz/admin'; | ||
import { uniqBy } from 'lodash-es'; | ||
import { getPaths } from '../../../../src/shared/utils'; | ||
import './index.less'; | ||
|
||
const getDocCommits = ($path: string) => axios.get('https://api.github.com/repos/juicecube/mlz-admin/commits?per_page=100&path=' + $path + '&sha=master'); | ||
const getCompCommits = ($path: string) => axios.get('https://api.github.com/repos/juicecube/mlz-admin/commits?per_page=100&path=' + $path + '&sha=master'); | ||
const getAuthorFromData = ($oneCommit) => { | ||
const author = $oneCommit.author || $oneCommit.commit.author; | ||
return { | ||
id: author.id || author.name, | ||
name: author.login || author.name, | ||
html_url: author.html_url, | ||
avatar_url: author.avatar_url || author.name, | ||
}; | ||
}; | ||
const TheAvatar = (props: { item: any; alternatives: string[]; rand: number; style?: CSSProperties }) => { | ||
const { item, alternatives, rand, style } = props; | ||
return ( | ||
<Avatar src={item.avatar_url} style={{ marginRight: 2, backgroundColor: alternatives[rand], ...style }}> | ||
{item.avatar_url[0].toUpperCase()} | ||
</Avatar> | ||
); | ||
}; | ||
export default () => { | ||
const [commits, setCommits] = useState<any[]>([]); | ||
const [loading, toggoleLoading] = useState(true); | ||
const { docPath, componentPath, antdDocPath } = getPaths(); | ||
useEffect(() => { | ||
Promise.all([getDocCommits(docPath), getCompCommits(componentPath)]) | ||
.then((res: any[]) => { | ||
setCommits(res.map((res_i) => res_i.data.map((commit) => getAuthorFromData(commit)))); | ||
toggoleLoading(false); | ||
}) | ||
.catch(() => toggoleLoading(false)); | ||
}, []); | ||
return ( | ||
<div className="committers-wrapper"> | ||
<Affix offsetBottom={66}> | ||
<Button className="joinus-btn" type="primary" onClick={() => window.open(antdDocPath)} icon={<Icon type="file_search_l" />}> | ||
在 Ant Design 中查看 | ||
</Button> | ||
</Affix> | ||
<Spin spinning={loading}> | ||
<ul> | ||
{(() => { | ||
const alternatives = ['#1890ff', '#00a2ae', '#ffbf00', '#a9d5fe', '#7265e6']; | ||
const rand = parseInt(Math.random() * alternatives.length + '', 10); | ||
return commits.map((commitType, index) => { | ||
const commiters = uniqBy(commitType, 'id'); | ||
return ( | ||
<li key={index}> | ||
<span className="commit-title"> | ||
<Typography.Text type="secondary">{index === 0 ? '文档贡献者' : '组件贡献者'}:</Typography.Text> | ||
</span> | ||
<span className="committers"> | ||
<Avatar.Group> | ||
{(commiters.length && | ||
commiters.map((item: any) => { | ||
return item ? ( | ||
<Tooltip title={item.name} placement={index === 0 ? 'top' : 'bottom'} key={item.login}> | ||
{item.html_url ? ( | ||
<a href={item.html_url} target="_blank"> | ||
<TheAvatar {...{ rand, alternatives, item }} /> | ||
</a> | ||
) : ( | ||
<span> | ||
<TheAvatar {...{ rand, alternatives, item }} /> | ||
</span> | ||
)} | ||
</Tooltip> | ||
) : null; | ||
})) || | ||
'--'} | ||
</Avatar.Group> | ||
</span> | ||
</li> | ||
); | ||
}); | ||
})()} | ||
</ul> | ||
</Spin> | ||
</div> | ||
); | ||
}; |
27 changes: 27 additions & 0 deletions
27
docs/components/_site/communital-commits-calculator/index.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,27 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
import axios from 'axios'; | ||
import { Typography } from '@mlz/admin'; | ||
|
||
const getDocCommits = axios.get('https://api.github.com/repos/juicecube/mlz-admin/commits?per_page=100'); | ||
const collaborators = [19811291, 11535146]; | ||
export default () => { | ||
const [ratio, setRatio] = useState<number>(0); | ||
useEffect(() => { | ||
getDocCommits.then((res: { data: any[] }) => { | ||
const commitsCountsNotFromCommunity = res.data.filter((commit) => collaborators.includes(commit?.author?.id) && commit.html_url).length; | ||
const commitsCountsFromCommunity = 100 - commitsCountsNotFromCommunity; | ||
setRatio(commitsCountsFromCommunity / 100); | ||
}); | ||
}, []); | ||
const interactiveLevel = ratio < 0.2 ? '低' : ratio < 0.5 && ratio >= 0.2 ? '中' : '高'; | ||
return ( | ||
<> | ||
<Typography.Text type="secondary" style={{ marginRight: 6 }}> | ||
代码社区贡献率 | ||
</Typography.Text> | ||
<Typography.Text style={{ background: interactiveLevel === '低' ? 'red' : interactiveLevel === '中' ? 'orange' : 'green', borderRadius: 4, padding: '2px 6px', color: 'white', fontSize: 12 }}> | ||
{interactiveLevel} {(ratio * 100).toFixed(1)}% | ||
</Typography.Text> | ||
</> | ||
); | ||
}; |
File renamed without changes.
File renamed without changes.
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,7 @@ | ||
# DecodePhone 手机号解码 | ||
|
||
**📦 手机号解码** | ||
|
||
## 1. 基本使用 | ||
|
||
<code src="./../../demo/decode-phone/normal-usage.demo.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
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
Oops, something went wrong.