Skip to content

Commit

Permalink
output card: fix report url
Browse files Browse the repository at this point in the history
  • Loading branch information
mkolomeychenko committed Sep 24, 2020
1 parent 1fac788 commit c04828d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/classes_stats_for_images.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ def calc(api: sly.Api, task_id, context, state, app_logger):
remote_path = api.file.get_free_name(TEAM_ID, remote_path)
report_name = sly.fs.get_file_name_with_ext(remote_path)
file_info = api.file.upload(TEAM_ID, local_path, remote_path)
report_url = api.file.get_url(file_info["id"])

fields = [
{"field": "data.overviewTable", "payload": overviewTable},
Expand All @@ -287,6 +288,7 @@ def calc(api: sly.Api, task_id, context, state, app_logger):
{"field": "state.showDialog", "payload": True},
{"field": "data.savePath", "payload": remote_path},
{"field": "data.reportName", "payload": report_name},
{"field": "data.reportUrl", "payload": report_url},
]
api.task.set_fields(task_id, fields)
api.task.set_output_report(task_id, file_info["id"], report_name)
Expand Down
2 changes: 1 addition & 1 deletion src/gui.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<el-col :span="16" style="flex: 1">
<sly-card title="Output" style="height: 100%">
<sly-field v-if="data.progress === 100" title="" description="Report has been successfully saved to Files">
<a slot="title" target="_blank" :href="`${data.savePath}`">{{data.reportName}}</a>
<a slot="title" target="_blank" :href="`${data.reportUrl}`">{{data.reportName}}</a>
<sly-icon slot="icon" :options="{ color: '#33c94c', bgColor: '#d9f7e4', rounded: false }">
<i class="zmdi zmdi-receipt"></i>
</sly-icon>
Expand Down

0 comments on commit c04828d

Please sign in to comment.