Skip to content

A full-featured download manager.

feat: task progress info show seeder number

Dr_rOot819f86632edb
diff --git a/src/renderer/assets/icons/magnet.svg b/src/renderer/assets/icons/magnet.svg
new file mode 100644
index 00000000..d206c8c4
--- /dev/null
+++ b/src/renderer/assets/icons/magnet.svg
@@ -0,0 +1,9 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24">
+ <g stroke-linecap="square" stroke-linejoin="miter" stroke-width="2" fill="#000000" stroke="#000000">
+ <line fill="none" stroke-miterlimit="10" x1="8.2" y1="4.5" x2="11.1" y2="7.3"></line>
+ <line fill="none" stroke-miterlimit="10" x1="16.7" y1="12.9" x2="19.5" y2="15.8"></line>
+ <path fill="none" stroke="#000000" stroke-miterlimit="10"
+ d="M12.5,17.2 c-1.6,1.6-4.1,1.6-5.7,0c-1.6-1.6-1.6-4.1,0-5.7l7.1-7.1l-2.8-2.8L4,8.7C0.9,11.8,0.9,16.9,4,20s8.2,3.1,11.3,0l7.1-7.1l-2.8-2.8 L12.5,17.2z">
+ </path>
+ </g>
+</svg>
diff --git a/src/renderer/components/Icons/magnet.js b/src/renderer/components/Icons/magnet.js
new file mode 100644
index 00000000..bded9cab
--- /dev/null
+++ b/src/renderer/components/Icons/magnet.js
@@ -0,0 +1,20 @@
+import Icon from '@/components/Icons/Icon'
+
+Icon.register({
+ 'magnet': {
+ 'width': 24,
+ 'height': 24,
+ 'raw': `
+ <line fill="none" stroke-miterlimit="10" x1="8.2" y1="4.5" x2="11.1" y2="7.3"></line>
+ <line fill="none" stroke-miterlimit="10" x1="16.7" y1="12.9" x2="19.5" y2="15.8"></line>
+ <path fill="none" stroke-miterlimit="10"
+ d="M12.5,17.2 c-1.6,1.6-4.1,1.6-5.7,0c-1.6-1.6-1.6-4.1,0-5.7l7.1-7.1l-2.8-2.8L4,8.7C0.9,11.8,0.9,16.9,4,20s8.2,3.1,11.3,0l7.1-7.1l-2.8-2.8 L12.5,17.2z">
+ </path>`,
+ 'g': {
+ 'stroke': 'currentColor',
+ 'stroke-linecap': 'round',
+ 'stroke-linejoin': 'round',
+ 'stroke-width': '2'
+ }
+ }
+})
diff --git a/src/renderer/components/Task/TaskProgressInfo.vue b/src/renderer/components/Task/TaskProgressInfo.vue
index 54b07685..24a76954 100644
--- a/src/renderer/components/Task/TaskProgressInfo.vue
+++ b/src/renderer/components/Task/TaskProgressInfo.vue
@@ -2,8 +2,8 @@
<el-row class="task-progress-info">
<el-col :span="8" class="task-progress-info-left">
<div v-if="task.completedLength > 0 || task.totalLength > 0">
- <span>{{ task.completedLength | bytesToSize }}</span>
- <span v-if="task.totalLength > 0"> / {{ task.totalLength | bytesToSize }}</span>
+ <span>{{ task.completedLength | bytesToSize }}</span>
+ <span v-if="task.totalLength > 0"> / {{ task.totalLength | bytesToSize }}</span>
</div>
</el-col>
<el-col :span="16" class="task-progress-info-right">
@@ -29,6 +29,10 @@
})
}}
</span>
+ <span class="task-speed-text" v-if="isBT">
+ <i><mo-icon name="magnet" width="10" height="10" /></i>
+ <i>{{ task.numSeeders }}</i>
+ </span>
<span class="task-speed-text">
<i><mo-icon name="node" width="10" height="10" /></i>
<i>{{ task.connections }}</i>
@@ -50,6 +54,7 @@
import '@/components/Icons/arrow-up'
import '@/components/Icons/arrow-down'
import '@/components/Icons/node'
+ import '@/components/Icons/magnet'
export default {
name: 'mo-task-progress-info',
@@ -81,30 +86,30 @@
</script>
<style lang="scss">
- .task-progress-info {
- font-size: 12px;
- line-height: 14px;
- min-height: 14px;
- color: #9B9B9B;
- margin-top: 8px;
- i {
- font-style: normal;
- }
+.task-progress-info {
+ font-size: 12px;
+ line-height: 14px;
+ min-height: 14px;
+ color: #9B9B9B;
+ margin-top: 8px;
+ i {
+ font-style: normal;
}
- .task-progress-info-left {
- min-height: 14px;
- text-align: left;
- }
- .task-progress-info-right {
- min-height: 14px;
- text-align: right;
- }
- .task-speed-info {
- & > .task-speed-text {
- margin-left: 8px;
- & > i {
- vertical-align: middle;
- }
+}
+.task-progress-info-left {
+ min-height: 14px;
+ text-align: left;
+}
+.task-progress-info-right {
+ min-height: 14px;
+ text-align: right;
+}
+.task-speed-info {
+ & > .task-speed-text {
+ margin-left: 8px;
+ & > i {
+ vertical-align: middle;
}
}
+}
</style>