This commit is contained in:
portree_kid 2020-07-04 22:37:00 +02:00
parent 3c315c4f0c
commit fad6b3de84

View File

@ -7,6 +7,7 @@
</div> </div>
</h1> </h1>
<el-container direction="vertical"> <el-container direction="vertical">
<span v-if="scanning" class="center">{{scanName}}</span>
<el-progress :percentage="Number(((progress / max)*100).toPrecision(3))" v-if="max>0"></el-progress> <el-progress :percentage="Number(((progress / max)*100).toPrecision(3))" v-if="max>0"></el-progress>
<!--<el-progress :percentage="progress / max"></el-progress>--> <!--<el-progress :percentage="progress / max"></el-progress>-->
<!--{{max}}&nbsp;{{progress}}--> <!--{{max}}&nbsp;{{progress}}-->
@ -45,7 +46,8 @@
progress: 0, progress: 0,
scanning: false, scanning: false,
polling: null, polling: null,
worker: null worker: null,
scanName: 'unknown'
} }
}, },
methods: { methods: {
@ -64,6 +66,7 @@
scanAPT () { scanAPT () {
try { try {
this.scanning = true this.scanning = true
this.scanName = 'Scanning APT'
const winURL = process.env.NODE_ENV === 'development' const winURL = process.env.NODE_ENV === 'development'
? `http://localhost:9080/src/renderer/utils/worker.js` ? `http://localhost:9080/src/renderer/utils/worker.js`
: `file://${process.resourcesPath}/workers/worker.js` : `file://${process.resourcesPath}/workers/worker.js`
@ -110,6 +113,7 @@
scanGroundnets () { scanGroundnets () {
try { try {
this.scanning = true this.scanning = true
this.scanName = 'Scanning Groundnets'
const winURL = process.env.NODE_ENV === 'development' const winURL = process.env.NODE_ENV === 'development'
? `http://localhost:9080/src/renderer/utils/worker.js` ? `http://localhost:9080/src/renderer/utils/worker.js`
: `file://${process.resourcesPath}/workers/worker.js` : `file://${process.resourcesPath}/workers/worker.js`
@ -144,7 +148,6 @@
this.max = e.data[1] this.max = e.data[1]
} }
if (e.data[0] === 'progress') { if (e.data[0] === 'progress') {
this.scanning = false
this.progress += e.data[1] this.progress += e.data[1]
} }
} }
@ -158,6 +161,7 @@
// let flightgearDirectory = this.$store.state.settings.flightgearDirectory // let flightgearDirectory = this.$store.state.settings.flightgearDirectory
try { try {
this.scanning = true this.scanning = true
this.scanName = 'Scanning Traffic'
const winURL = process.env.NODE_ENV === 'development' const winURL = process.env.NODE_ENV === 'development'
? `http://localhost:9080/src/renderer/utils/worker.js` ? `http://localhost:9080/src/renderer/utils/worker.js`
: `file://${process.resourcesPath}/workers/worker.js` : `file://${process.resourcesPath}/workers/worker.js`
@ -212,4 +216,9 @@
.el-button+.el-button { .el-button+.el-button {
margin-left: 0px; margin-left: 0px;
} }
.center {
font-weight: bold;
font-size: 12pt;
align-self: center;
}
</style> </style>