Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
疯人忠
Cvat
提交
6f887fc8
C
Cvat
项目概览
疯人忠
/
Cvat
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Cvat
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
6f887fc8
编写于
6月 30, 2022
作者:
M
Maria Khrustaleva
提交者:
GitHub
6月 30, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add support any name for backup file (#91)
上级
54c15830
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
10 addition
and
3 deletion
+10
-3
CHANGELOG.md
CHANGELOG.md
+1
-0
cvat/apps/engine/backup.py
cvat/apps/engine/backup.py
+5
-3
cvat/apps/engine/views.py
cvat/apps/engine/views.py
+4
-0
未找到文件。
CHANGELOG.md
浏览文件 @
6f887fc8
...
...
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
-
Fixed UX bug when jobs pagination is reset after changing a job (
<https://github.com/cvat-ai/cvat/pull/42>
)
-
Progressbars in CLI for file uploading and downloading (
<https://github.com/cvat-ai/cvat/pull/46>
)
-
`utils/cli`
changed to
`cvat-cli`
package (
<https://github.com/cvat-ai/cvat/pull/59>
)
-
Support custom file name for backup (
<https://github.com/cvat-ai/cvat/pull/91>
)
### Changed
-
Bumped nuclio version to 1.8.14 (
<https://github.com/cvat-ai/cvat/pull/29>
)
...
...
cvat/apps/engine/backup.py
浏览文件 @
6f887fc8
...
...
@@ -701,6 +701,8 @@ def _create_backup(db_instance, Exporter, output_path, logger, cache_ttl):
def
export
(
db_instance
,
request
):
action
=
request
.
query_params
.
get
(
'action'
,
None
)
filename
=
request
.
query_params
.
get
(
'filename'
,
None
)
if
action
not
in
(
None
,
'download'
):
raise
serializers
.
ValidationError
(
"Unexpected action specified for the request"
)
...
...
@@ -745,14 +747,14 @@ def export(db_instance, request):
timestamp
=
datetime
.
strftime
(
last_project_update_time
,
"%Y_%m_%d_%H_%M_%S"
)
filename
=
"{}_{}_backup_{}{}"
.
format
(
filename
=
filename
or
"{}_{}_backup_{}{}"
.
format
(
filename_prefix
,
db_instance
.
name
,
timestamp
,
os
.
path
.
splitext
(
file_path
)[
1
])
os
.
path
.
splitext
(
file_path
)[
1
])
.
lower
()
location
=
location_conf
.
get
(
'location'
)
if
location
==
Location
.
LOCAL
:
return
sendfile
(
request
,
file_path
,
attachment
=
True
,
attachment_filename
=
filename
.
lower
()
)
attachment_filename
=
filename
)
elif
location
==
Location
.
CLOUD_STORAGE
:
@
validate_bucket_status
...
...
cvat/apps/engine/views.py
浏览文件 @
6f887fc8
...
...
@@ -487,6 +487,8 @@ class ProjectViewSet(viewsets.ModelViewSet, UploadMixin, AnnotationMixin, Serial
OpenApiParameter
(
'action'
,
location
=
OpenApiParameter
.
QUERY
,
description
=
'Used to start downloading process after backup file had been created'
,
type
=
OpenApiTypes
.
STR
,
required
=
False
,
enum
=
[
'download'
]),
OpenApiParameter
(
'filename'
,
description
=
'Backup file name'
,
location
=
OpenApiParameter
.
QUERY
,
type
=
OpenApiTypes
.
STR
,
required
=
False
),
OpenApiParameter
(
'location'
,
description
=
'Where need to save downloaded backup'
,
location
=
OpenApiParameter
.
QUERY
,
type
=
OpenApiTypes
.
STR
,
required
=
False
,
enum
=
Location
.
list
()),
...
...
@@ -707,6 +709,8 @@ class TaskViewSet(UploadMixin, AnnotationMixin, viewsets.ModelViewSet, Serialize
OpenApiParameter
(
'action'
,
location
=
OpenApiParameter
.
QUERY
,
description
=
'Used to start downloading process after backup file had been created'
,
type
=
OpenApiTypes
.
STR
,
required
=
False
,
enum
=
[
'download'
]),
OpenApiParameter
(
'filename'
,
description
=
'Backup file name'
,
location
=
OpenApiParameter
.
QUERY
,
type
=
OpenApiTypes
.
STR
,
required
=
False
),
OpenApiParameter
(
'location'
,
description
=
'Where need to save downloaded backup'
,
location
=
OpenApiParameter
.
QUERY
,
type
=
OpenApiTypes
.
STR
,
required
=
False
,
enum
=
Location
.
list
()),
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录