mirror of
https://github.com/volodymyrsmirnov/MalwareMultiScan.git
synced 2025-08-25 22:01:16 +00:00
completed the UI and docker-compose.yaml basic app
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
<template>
|
||||
<b-card no-body>
|
||||
<b-tabs card pills>
|
||||
<b-tab title="File Scan" active>
|
||||
<b-tabs card no-fade pills>
|
||||
<b-tab active title="File Scan">
|
||||
<b-input-group>
|
||||
<b-form-file placeholder="Select or drop files here" v-model="file"/>
|
||||
<b-form-file v-model="file" placeholder="Select or drop files here"/>
|
||||
<b-input-group-append>
|
||||
<b-button variant="primary" :disabled="!file || uploading" @click="scanFile">Scan</b-button>
|
||||
<b-button :disabled="!file || uploading" variant="primary" @click="scanFile">Scan</b-button>
|
||||
</b-input-group-append>
|
||||
</b-input-group>
|
||||
|
||||
<b-progress class="mt-3" v-if="uploading" :value="progress" animated />
|
||||
<b-progress v-if="uploading" :value="progress" animated class="mt-3"/>
|
||||
</b-tab>
|
||||
|
||||
<b-tab title="URL Scan">
|
||||
<b-input-group>
|
||||
<b-input type="url" placeholder="https://secure.eicar.org/eicar.com.txt" v-model="url"/>
|
||||
<b-input v-model="url" placeholder="https://secure.eicar.org/eicar.com.txt" type="url"/>
|
||||
<b-input-group-append>
|
||||
<b-button variant="primary" :disabled="!isUrl(url)" @click="scanUrl">Scan</b-button>
|
||||
<b-button :disabled="!isUrl(url)" variant="primary" @click="scanUrl">Scan</b-button>
|
||||
</b-input-group-append>
|
||||
</b-input-group>
|
||||
</b-tab>
|
||||
@@ -41,7 +41,7 @@ export default Vue.extend({
|
||||
},
|
||||
|
||||
methods: {
|
||||
isUrl(url: string) : boolean {
|
||||
isUrl(url: string): boolean {
|
||||
return /(http|https):\/\/(\w+:?\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@\-\/]))?/.test(url);
|
||||
},
|
||||
|
||||
@@ -53,8 +53,7 @@ export default Vue.extend({
|
||||
|
||||
data.append('file', this.file, this.file.name);
|
||||
|
||||
try
|
||||
{
|
||||
try {
|
||||
this.uploading = true;
|
||||
|
||||
const result = await this.$axios.$post<ScanResult>('queue/file', data, {
|
||||
@@ -67,8 +66,7 @@ export default Vue.extend({
|
||||
});
|
||||
|
||||
await this.$router.push({name: 'id', params: {id: result.id}});
|
||||
}
|
||||
finally {
|
||||
} finally {
|
||||
this.progress = 0;
|
||||
this.uploading = false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user