-
Notifications
You must be signed in to change notification settings - Fork 55
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
feat: set project capacity with async #147
Conversation
app/controller/api/project.js
Outdated
const readableSize = bufSize >= 1024 ? | ||
`${(bufSize / 1024).toFixed(2)}KB` : | ||
`${bufSize}B`; | ||
const readableSize = bufSize >= 1024 * 1024 ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
用filesize吧
app/router.js
Outdated
@@ -24,6 +24,7 @@ module.exports = app => { | |||
router.get('/notfound', controller.page.notfound); | |||
|
|||
router.get('/api/project', controller.api.project.showAll); | |||
router.get('/api/project/capacity', controller.api.project.capacity); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
statistics? capacity不专业
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
可以~
Codecov Report
@@ Coverage Diff @@
## master #147 +/- ##
==========================================
- Coverage 93.27% 91.63% -1.64%
==========================================
Files 40 40
Lines 877 885 +8
==========================================
- Hits 818 811 -7
- Misses 59 74 +15
Continue to review full report at Codecov.
|
@@ -3,6 +3,7 @@ language: node_js | |||
node_js: | |||
- '8' | |||
install: | |||
- rm -rf node_modules |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里不用删除吧?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
昨天 npminstall 在 ci 一直报权限问题,删掉就可以了
|
||
item.capacity = { | ||
count: iterfaceList.length, | ||
size: readableSize, | ||
size: filesize, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是这个 filesize https://www.npmjs.com/package/filesize
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个方便~ 我换下
No description provided.