Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
bkunyun
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sunyihao
bkunyun
Commits
996c6119
Commit
996c6119
authored
Jun 16, 2022
by
吴永生#A02208
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 文件传输支持实时网速
parent
53f3ef04
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
38 additions
and
18 deletions
+38
-18
api_prefix.ts
src/api/api_prefix.ts
+2
-2
index.module.css
src/views/ConsoleLayout/components/FileItem/index.module.css
+5
-0
index.tsx
src/views/ConsoleLayout/components/FileItem/index.tsx
+23
-3
index.tsx
src/views/ConsoleLayout/components/TransferList/index.tsx
+2
-2
index.tsx
src/views/Project/ProjectSetting/ProjectMembers/index.tsx
+6
-11
No files found.
src/api/api_prefix.ts
View file @
996c6119
...
...
@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:17:48
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-06-1
3 09:59:45
* @LastEditTime: 2022-06-1
6 20:22:37
* @FilePath: /bkunyun/src/api/api_prefix.ts
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -32,7 +32,7 @@ switch (process.env.REACT_APP_ENV) {
if
([
"www.bkunyun.com"
].
includes
(
window
.
location
.
host
))
{
BACKEND_API_URI_PREFIX
=
"https://www.bkunyun.com"
;
}
else
{
BACKEND_API_URI_PREFIX
=
"http://47.
57.4.97
"
;
BACKEND_API_URI_PREFIX
=
"http://47.
75.104.171
"
;
}
break
;
}
...
...
src/views/ConsoleLayout/components/FileItem/index.module.css
View file @
996c6119
...
...
@@ -17,6 +17,11 @@
text-overflow
:
ellipsis
;
font-size
:
14px
;
}
.speedBox
{
display
:
flex
;
justify-content
:
space-between
;
align-items
:
center
;
}
.rightBox
{
cursor
:
pointer
;
...
...
src/views/ConsoleLayout/components/FileItem/index.tsx
View file @
996c6119
...
...
@@ -79,6 +79,20 @@ const FileItem = observer((props: IProps) => {
});
}
};
const
speed
=
useMemo
(()
=>
{
let
val
=
0
;
const
time
=
Math
.
floor
((
itemInfo
?.
endTime
-
itemInfo
.
startTime
)
/
1000
);
if
(
time
>
0
)
{
val
=
Math
.
floor
(
itemInfo
?.
bytesUploaded
/
time
);
}
return
val
;
},
[
itemInfo
?.
bytesUploaded
,
itemInfo
?.
endTime
,
itemInfo
.
startTime
]);
console
.
log
(
Math
.
floor
((
itemInfo
?.
endTime
-
itemInfo
.
startTime
)
/
1000
),
"111111"
);
return
(
<
div
className=
{
styles
.
itemBox
}
>
<
div
className=
{
styles
.
leftBox
}
>
...
...
@@ -122,9 +136,15 @@ const FileItem = observer((props: IProps) => {
</
span
>
</>
)
:
(
<
span
className=
{
styles
.
span
}
>
{
`${storageUnitFromB(
itemInfo?.bytesUploaded || 0
)}/${storageUnitFromB(itemInfo?.bytesTotal || 0)}`
}
</
span
>
<
div
className=
{
styles
.
speedBox
}
>
<
span
className=
{
styles
.
span
}
>
{
`${storageUnitFromB(
itemInfo?.bytesUploaded || 0
)}/${storageUnitFromB(itemInfo?.bytesTotal || 0)}`
}
</
span
>
{
" "
}
:
<
span
className=
{
styles
.
span
}
>
{
`${storageUnitFromB(
speed
)}/s`
}
</
span
>
</
div
>
)
}
</
div
>
</
div
>
...
...
src/views/ConsoleLayout/components/TransferList/index.tsx
View file @
996c6119
...
...
@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-06-10 18:05:21
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-06-16
03:05:08
* @LastEditTime: 2022-06-16
21:15:59
* @FilePath: /bkunyun/src/views/ConsoleLayout/components/TransferList/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -46,7 +46,7 @@ const TranSferList = observer(() => {
size=
"small"
/>
</
Box
>
<
Box
>
<
Box
style=
{
{
height
:
400
,
overflowY
:
"auto"
}
}
>
{
uploadInfoStore
?.
fileList
.
map
((
item
)
=>
{
return
<
FileItem
fileItemInfo=
{
item
}
key=
{
item
.
id
}
/>;
})
}
...
...
src/views/Project/ProjectSetting/ProjectMembers/index.tsx
View file @
996c6119
...
...
@@ -2,7 +2,7 @@
* @Author: 吴永生#A02208 yongsheng.wu@wholion.com
* @Date: 2022-05-31 10:18:13
* @LastEditors: 吴永生#A02208 yongsheng.wu@wholion.com
* @LastEditTime: 2022-06-16
18:17:0
4
* @LastEditTime: 2022-06-16
20:49:1
4
* @FilePath: /bkunyun/src/views/Project/ProjectSetting/index.tsx
* @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
*/
...
...
@@ -50,22 +50,18 @@ const ProjectMembers = observer(() => {
const
[
projectName
,
setProjectMember
]
=
useState
(
""
);
/** 过滤后数据 */
const
[
filterTableData
,
setFilterTableData
]
=
useState
([]);
/** 项目所有者 */
const
[
projectOwner
,
setProjectOwner
]
=
useState
(
""
);
const
columns
=
useMemo
(()
=>
{
const
val
:
any
=
[
{
id
:
"username"
,
label
:
"成员名称"
},
{
id
:
"projectRoleDesc"
,
label
:
"项目权限"
},
{
id
:
"phone"
,
label
:
"联系方式"
},
];
if
(
isProjectOwner
(
projectOwner
))
{
val
.
push
({
{
id
:
"operation"
,
label
:
"操作"
,
width
:
160
,
render
:
(
item
:
any
,
row
:
any
)
=>
{
return
item
?.
projectRole
===
"OWNER"
?
null
:
(
return
row
?.
projectRole
===
"OWNER"
?
null
:
(
<>
<
span
style=
{
{
color
:
"#1370FF"
,
cursor
:
"pointer"
}
}
...
...
@@ -86,10 +82,10 @@ const ProjectMembers = observer(() => {
</>
);
},
}
);
}
}
,
];
return
val
;
},
[
projectOwner
]);
},
[]);
/** 获取表格数据 */
const
getTableList
=
useCallback
(()
=>
{
...
...
@@ -101,7 +97,6 @@ const ProjectMembers = observer(() => {
}
)
.then((res) =
>
{
const
{
data
=
{}
}
=
res
;
setProjectOwner
(
data
.
owner
);
setTableData
(
data
?.
members
||
[]);
}
);
}, [currentProjectStore?.currentProjectInfo, http]);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment