mirror of https://github.com/MISP/misp-modules
new: [functionality] checkbox configure module
parent
18d4347f51
commit
7b3e6cc73f
|
@ -59,8 +59,13 @@
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- Display in case a module as reauest_on_query activate -->
|
<div title="Configure modules even if a configuration as already been given" style="margin-top: 10px; transform: translate(25%, 0);">
|
||||||
<div v-if="config_query.length" style="margin-top: 10px; padding: 5px" class="row">
|
<input type="checkbox" id="own_config" name="own_config" @click="own_config()" style="margin-right: 5px;">
|
||||||
|
<label for="own_config">Configure all modules </label>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Display in case a module as request_on_query activate -->
|
||||||
|
<div v-if="config_query.length" style="margin-top: 10px; padding: 6px" class="row">
|
||||||
<h4>Config</h4>
|
<h4>Config</h4>
|
||||||
<div class="card col-4" style="margin-top: 10px; padding: 15px" v-for="module in config_query">
|
<div class="card col-4" style="margin-top: 10px; padding: 15px" v-for="module in config_query">
|
||||||
<h4>[[module.name]]</h4>
|
<h4>[[module.name]]</h4>
|
||||||
|
@ -99,6 +104,8 @@
|
||||||
const cp_entries = ref(1)
|
const cp_entries = ref(1)
|
||||||
const queries = ref()
|
const queries = ref()
|
||||||
|
|
||||||
|
let own_config_bool = false
|
||||||
|
|
||||||
|
|
||||||
async function fetchQuery(){
|
async function fetchQuery(){
|
||||||
const res = await fetch('/get_query')
|
const res = await fetch('/get_query')
|
||||||
|
@ -224,7 +231,10 @@
|
||||||
for(let el in loc_list){
|
for(let el in loc_list){
|
||||||
for(let index in modules_list.value){
|
for(let index in modules_list.value){
|
||||||
if(modules_list.value[index].name == loc_list[el]){
|
if(modules_list.value[index].name == loc_list[el]){
|
||||||
if(modules_list.value[index].request_on_query){
|
if (own_config_bool){
|
||||||
|
config_query.value.push(modules_list.value[index])
|
||||||
|
}
|
||||||
|
else if(modules_list.value[index].request_on_query){
|
||||||
config_query.value.push(modules_list.value[index])
|
config_query.value.push(modules_list.value[index])
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
@ -267,6 +277,36 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function own_config(){
|
||||||
|
own_config_bool = !own_config_bool
|
||||||
|
if(own_config_bool){
|
||||||
|
let loc_list = $('#modules_select').val()
|
||||||
|
config_query.value = []
|
||||||
|
for(let el in loc_list){
|
||||||
|
for(let index in modules_list.value){
|
||||||
|
if(modules_list.value[index].name == loc_list[el]){
|
||||||
|
config_query.value.push(modules_list.value[index])
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
let loc_list = $('#modules_select').val()
|
||||||
|
config_query.value = []
|
||||||
|
for(let el in loc_list){
|
||||||
|
for(let index in modules_list.value){
|
||||||
|
if(modules_list.value[index].name == loc_list[el]){
|
||||||
|
if(modules_list.value[index].request_on_query){
|
||||||
|
config_query.value.push(modules_list.value[index])
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
message_list,
|
message_list,
|
||||||
progress,
|
progress,
|
||||||
|
@ -282,7 +322,8 @@
|
||||||
checked_attr,
|
checked_attr,
|
||||||
add_entry,
|
add_entry,
|
||||||
delete_entry,
|
delete_entry,
|
||||||
generateCoreFormatUI
|
generateCoreFormatUI,
|
||||||
|
own_config
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}).mount('.container-fluid')
|
}).mount('.container-fluid')
|
||||||
|
|
Loading…
Reference in New Issue