|
|
|
@ -11,7 +11,7 @@ |
|
|
|
|
{% block content %} |
|
|
|
|
|
|
|
|
|
<div id="app"> |
|
|
|
|
<modal ref="modal" v-bind:individual="individual"></modal> |
|
|
|
|
<modal ref="modal" v-bind:individual="individual" v-on:do-search="searchNewResults"></modal> |
|
|
|
|
<directories v-bind:directories='directories'></directories> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
@ -67,7 +67,14 @@ Vue.component('modal', { |
|
|
|
|
</div> |
|
|
|
|
<div class="col-9"> |
|
|
|
|
<div v-if='!this.individual.scrape_add'> |
|
|
|
|
<input type="email" class="form-control" id="exampleFormControlInput1" placeholder="name@example.com"> |
|
|
|
|
<div class="my-3 p-0 input-group"> |
|
|
|
|
<input type="text" v-model="search" class="form-control" placeholder="Search Volumes..." /> |
|
|
|
|
<div class="input-group-append"> |
|
|
|
|
<button class="btn btn-success" type="button" @click="$emit('do-search', search)"> |
|
|
|
|
Search |
|
|
|
|
</button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<select id="selectVolume" class="form-select" aria-label="Default select example" @change='doSomething($event)'> |
|
|
|
|
<candidate |
|
|
|
|
v-for="item in json" |
|
|
|
@ -85,6 +92,12 @@ Vue.component('modal', { |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
<div class="modal-footer"> |
|
|
|
|
<span v-if="this.individual.scrape_ignore_directory"> |
|
|
|
|
<button type="button" class="btn btn-success" data-bs-dismiss="modal" @click='toggleDirectoryIgnore'>Show Directory</button> |
|
|
|
|
</span> |
|
|
|
|
<span v-else> |
|
|
|
|
<button type="button" class="btn btn-danger" data-bs-dismiss="modal" @click='toggleDirectoryIgnore'>Hide Directory</button> |
|
|
|
|
</span> |
|
|
|
|
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
@ -117,6 +130,9 @@ Vue.component('modal', { |
|
|
|
|
return item['id'] == this.individual.scrape_candidate |
|
|
|
|
})[0] |
|
|
|
|
document.getElementById('selectVolume').value = this.individual.scrape_candidate |
|
|
|
|
}, |
|
|
|
|
toggleDirectoryIgnore() { |
|
|
|
|
app.toggleDirectoryIgnore(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
delimiters: ["[[","]]"] |
|
|
|
@ -209,6 +225,12 @@ Vue.component('directories', { |
|
|
|
|
<button type="button" class="btn-close text-reset" data-bs-dismiss="offcanvas" aria-label="Close"></button> |
|
|
|
|
</div> |
|
|
|
|
<div class="offcanvas-body"> |
|
|
|
|
<div class="form-check"> |
|
|
|
|
<input class="form-check-input" type="checkbox" value="" id="showIgnoredDirectories" v-model="checked"> |
|
|
|
|
<label class="form-check-label" for="flexCheckDefault"> |
|
|
|
|
Show Hidden Directories |
|
|
|
|
</label> |
|
|
|
|
</div> |
|
|
|
|
<div class="text-center w-100 m-0 p-3"> |
|
|
|
|
<button type="button" class="btn btn-info m-1 w-100" data-bs-toggle="tooltip" data-bs-placement="top" title="Add Selected Directories" onclick="app.addDirectories()"> |
|
|
|
|
<i class="fas fa-plus"></i> |
|
|
|
@ -223,12 +245,17 @@ Vue.component('directories', { |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
`, |
|
|
|
|
data() { return { search: '', } }, |
|
|
|
|
data() { return { search: '', ignore: 'false', checked: false} }, |
|
|
|
|
computed: { |
|
|
|
|
filteredList() { |
|
|
|
|
return this.directories.filter(directory => { |
|
|
|
|
return directory.scrape_directory.toLowerCase().includes(this.search.toLowerCase()) |
|
|
|
|
}) |
|
|
|
|
if (!this.checked) { |
|
|
|
|
return this.directories |
|
|
|
|
.filter(directory => { return directory.scrape_directory.toLowerCase().includes(this.search.toLowerCase()) }) |
|
|
|
|
.filter(directory => { return directory.scrape_ignore_directory.toString().includes(this.checked) }) |
|
|
|
|
} else { |
|
|
|
|
return this.directories |
|
|
|
|
.filter(directory => { return directory.scrape_directory.toLowerCase().includes(this.search.toLowerCase()) }) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|
methods: {}, |
|
|
|
@ -288,6 +315,44 @@ var app = new Vue({ |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
toggleDirectoryIgnore() { |
|
|
|
|
console.log('toggle') |
|
|
|
|
axios.put('{{ url_for('api.api_put_directories_edit', scrape_id='SCRAPEID') }}'.replace('SCRAPEID', this.individual.scrape_id), { |
|
|
|
|
data: { |
|
|
|
|
scrape_ignore_directory: !this.individual.scrape_ignore_directory |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.then(res=> { |
|
|
|
|
console.log(res) |
|
|
|
|
if(res.data.status_code == 200) { |
|
|
|
|
this.individual.scrape_ignore_directory = !this.individual.scrape_ignore_directory |
|
|
|
|
if(this.individual.scrape_ignore_directory) { |
|
|
|
|
stashrToast('Directory Hidden', 'success') |
|
|
|
|
} else { |
|
|
|
|
stashrToast('Directory Unhidden', 'success') |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.catch(err => console.log(err)) |
|
|
|
|
}, |
|
|
|
|
searchNewResults(search) { |
|
|
|
|
axios.post('{{ url_for('api.api_post_directories_extend', scrape_id='SCRAPEID') }}'.replace('SCRAPEID', this.individual.scrape_id), { |
|
|
|
|
data: { |
|
|
|
|
search_terms: search |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
.then(res => { |
|
|
|
|
if(res.data.status_code == 200) { |
|
|
|
|
axios.get('{{ url_for('api.api_get_directories_candidates', scrape_id='SCRAPEID') }}'.replace('SCRAPEID', this.individual.scrape_id)) |
|
|
|
|
.then(res => { |
|
|
|
|
if (res.data.status_code == 200) { |
|
|
|
|
this.directories = []; |
|
|
|
|
this.getDirectories(); |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
delimiters: ["[","]]"] |
|
|
|
|
}) |
|
|
|
|