mirror of https://github.com/MISP/misp-modules
chg: [website] fusion between expansion and hover
parent
30f84f6512
commit
0b73052ebc
|
@ -37,14 +37,7 @@ def query(sid):
|
||||||
@home_blueprint.route("/get_modules")
|
@home_blueprint.route("/get_modules")
|
||||||
def get_modules():
|
def get_modules():
|
||||||
"""Return all modules available"""
|
"""Return all modules available"""
|
||||||
expansion = ""
|
res = HomeModel.get_modules()
|
||||||
hover = ""
|
|
||||||
|
|
||||||
if "expansion" in request.args:
|
|
||||||
expansion = request.args.get("expansion")
|
|
||||||
if "hover" in request.args:
|
|
||||||
hover = request.args.get("hover")
|
|
||||||
res = HomeModel.get_modules(expansion, hover)
|
|
||||||
|
|
||||||
if "message" in res:
|
if "message" in res:
|
||||||
return res, 404
|
return res, 404
|
||||||
|
@ -53,15 +46,7 @@ def get_modules():
|
||||||
@home_blueprint.route("/get_list_misp_attributes")
|
@home_blueprint.route("/get_list_misp_attributes")
|
||||||
def get_list_misp_attributes():
|
def get_list_misp_attributes():
|
||||||
"""Return all misp attributes for input and output"""
|
"""Return all misp attributes for input and output"""
|
||||||
expansion = ""
|
res = HomeModel.get_list_misp_attributes()
|
||||||
hover = ""
|
|
||||||
|
|
||||||
if "expansion" in request.args:
|
|
||||||
expansion = request.args.get("expansion")
|
|
||||||
if "hover" in request.args:
|
|
||||||
hover = request.args.get("hover")
|
|
||||||
|
|
||||||
res = HomeModel.get_list_misp_attributes(expansion, hover)
|
|
||||||
|
|
||||||
if "message" in res:
|
if "message" in res:
|
||||||
return res, 404
|
return res, 404
|
||||||
|
@ -72,7 +57,7 @@ def run_modules():
|
||||||
"""Run modules"""
|
"""Run modules"""
|
||||||
if "query" in request.json:
|
if "query" in request.json:
|
||||||
if "input" in request.json:
|
if "input" in request.json:
|
||||||
if "expansion" in request.json or "hover" in request.json:
|
if "modules" in request.json:
|
||||||
session = SessionModel.Session_class(request.json)
|
session = SessionModel.Session_class(request.json)
|
||||||
session.start()
|
session.start()
|
||||||
SessionModel.sessions.append(session)
|
SessionModel.sessions.append(session)
|
||||||
|
|
|
@ -5,75 +5,76 @@ from .db_class.db import History, Module, Config, Module_Config, Session_db
|
||||||
|
|
||||||
|
|
||||||
def get_module(mid):
|
def get_module(mid):
|
||||||
|
"""Return a module by id"""
|
||||||
return Module.query.get(mid)
|
return Module.query.get(mid)
|
||||||
|
|
||||||
def get_module_by_name(name):
|
def get_module_by_name(name):
|
||||||
|
"""Return a module by name"""
|
||||||
return Module.query.filter_by(name=name).first()
|
return Module.query.filter_by(name=name).first()
|
||||||
|
|
||||||
def get_config(cid):
|
def get_config(cid):
|
||||||
|
"""Return a config by id"""
|
||||||
return Config.query.get(cid)
|
return Config.query.get(cid)
|
||||||
|
|
||||||
def get_config_by_name(name):
|
def get_config_by_name(name):
|
||||||
|
"""Return a config by name"""
|
||||||
return Config.query.filter_by(name=name).first()
|
return Config.query.filter_by(name=name).first()
|
||||||
|
|
||||||
def get_module_config_module(mid):
|
def get_module_config_module(mid):
|
||||||
|
"""Return a moudle_config by module id"""
|
||||||
return Module_Config.query.filter_by(module_id=mid).all()
|
return Module_Config.query.filter_by(module_id=mid).all()
|
||||||
|
|
||||||
def get_module_config_both(mid, cid):
|
def get_module_config_both(mid, cid):
|
||||||
|
"""Return a moudle_config by module id and config id"""
|
||||||
return Module_Config.query.filter_by(module_id=mid, config_id=cid).first()
|
return Module_Config.query.filter_by(module_id=mid, config_id=cid).first()
|
||||||
|
|
||||||
def get_session(sid):
|
def get_session(sid):
|
||||||
|
"""Return a session by id"""
|
||||||
return Session_db.query.filter_by(uuid=sid).first()
|
return Session_db.query.filter_by(uuid=sid).first()
|
||||||
|
|
||||||
def get_modules(expansion, hover):
|
def get_modules():
|
||||||
|
"""Return all modules for expansion and hover types"""
|
||||||
res = query_get_module()
|
res = query_get_module()
|
||||||
if not "message" in res:
|
if not "message" in res:
|
||||||
loc_list = dict()
|
loc_list = list()
|
||||||
loc_list["expansion"] = list()
|
|
||||||
loc_list["hover"] = list()
|
|
||||||
for module in res:
|
for module in res:
|
||||||
module_db = get_module_by_name(module["name"])
|
module_db = get_module_by_name(module["name"])
|
||||||
module_loc = module
|
module_loc = module
|
||||||
module_loc["request_on_query"] = module_db.request_on_query
|
module_loc["request_on_query"] = module_db.request_on_query
|
||||||
if module_db.is_active:
|
if module_db.is_active:
|
||||||
if expansion:
|
if "expansion" in module["meta"]["module-type"] or "hover" in module["meta"]["module-type"]:
|
||||||
if "expansion" in module["meta"]["module-type"]:
|
if not module_loc in loc_list:
|
||||||
loc_list["expansion"].append(module_loc)
|
loc_list.append(module_loc)
|
||||||
if hover:
|
loc_list.sort(key=lambda x: x["name"])
|
||||||
if "hover" in module["meta"]["module-type"]:
|
|
||||||
loc_list["hover"].append(module_loc)
|
|
||||||
loc_list["expansion"].sort(key=lambda x: x["name"])
|
|
||||||
loc_list["hover"].sort(key=lambda x: x["name"])
|
|
||||||
return loc_list
|
return loc_list
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
def util_get_attr(module, loc_list):
|
def util_get_attr(module, loc_list):
|
||||||
|
"""Additional algo for get_list_misp_attributes"""
|
||||||
if "input" in module["mispattributes"]:
|
if "input" in module["mispattributes"]:
|
||||||
for input in module["mispattributes"]["input"]:
|
for input in module["mispattributes"]["input"]:
|
||||||
if not input in loc_list:
|
if not input in loc_list:
|
||||||
loc_list.append(input)
|
loc_list.append(input)
|
||||||
return loc_list
|
return loc_list
|
||||||
|
|
||||||
def get_list_misp_attributes(expansion, hover):
|
def get_list_misp_attributes():
|
||||||
|
"""Return all types of attributes used in expansion and hover"""
|
||||||
res = query_get_module()
|
res = query_get_module()
|
||||||
if not "message" in res:
|
if not "message" in res:
|
||||||
loc_list = list()
|
loc_list = list()
|
||||||
|
|
||||||
for module in res:
|
for module in res:
|
||||||
if get_module_by_name(module["name"]).is_active:
|
if get_module_by_name(module["name"]).is_active:
|
||||||
if expansion:
|
if "expansion" in module["meta"]["module-type"] or "hover" in module["meta"]["module-type"]:
|
||||||
if "expansion" in module["meta"]["module-type"]:
|
loc_list = util_get_attr(module, loc_list)
|
||||||
loc_list = util_get_attr(module, loc_list)
|
|
||||||
if hover:
|
|
||||||
if "hover" in module["meta"]["module-type"]:
|
|
||||||
loc_list = util_get_attr(module, loc_list)
|
|
||||||
loc_list.sort()
|
loc_list.sort()
|
||||||
return loc_list
|
return loc_list
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
|
||||||
def get_modules_config():
|
def get_modules_config():
|
||||||
|
"""Return configs for all modules """
|
||||||
modules = Module.query.order_by(Module.name).all()
|
modules = Module.query.order_by(Module.name).all()
|
||||||
modules_list = []
|
modules_list = []
|
||||||
for module in modules:
|
for module in modules:
|
||||||
|
@ -88,6 +89,7 @@ def get_modules_config():
|
||||||
|
|
||||||
|
|
||||||
def change_config_core(request_json):
|
def change_config_core(request_json):
|
||||||
|
"""Change config for a module"""
|
||||||
module = get_module_by_name(request_json["module_name"])
|
module = get_module_by_name(request_json["module_name"])
|
||||||
for element in request_json:
|
for element in request_json:
|
||||||
if not element == "module_name":
|
if not element == "module_name":
|
||||||
|
@ -101,6 +103,7 @@ def change_config_core(request_json):
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def change_status_core(module_id):
|
def change_status_core(module_id):
|
||||||
|
"""Active or deactive a module"""
|
||||||
module = get_module(module_id)
|
module = get_module(module_id)
|
||||||
module.is_active = not module.is_active
|
module.is_active = not module.is_active
|
||||||
db.session.commit()
|
db.session.commit()
|
||||||
|
@ -108,8 +111,13 @@ def change_status_core(module_id):
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
##############
|
||||||
|
# Session DB #
|
||||||
|
##############
|
||||||
|
|
||||||
def get_status_db(session):
|
def get_status_db(session):
|
||||||
glob_query = json.loads(session.glob_query)
|
glob_query = json.loads(session.glob_query)
|
||||||
|
"""Return status of a session"""
|
||||||
result = json.loads(session.result)
|
result = json.loads(session.result)
|
||||||
return{
|
return{
|
||||||
'id': session.uuid,
|
'id': session.uuid,
|
||||||
|
@ -122,9 +130,11 @@ def get_status_db(session):
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_result_db(session):
|
def get_result_db(session):
|
||||||
|
"""Return result of a session"""
|
||||||
return json.loads(session.result)
|
return json.loads(session.result)
|
||||||
|
|
||||||
def get_history():
|
def get_history():
|
||||||
|
"""Return history"""
|
||||||
histories_list = list()
|
histories_list = list()
|
||||||
histories = History.query.all()
|
histories = History.query.all()
|
||||||
for history in histories:
|
for history in histories:
|
||||||
|
|
|
@ -7,7 +7,6 @@ from . import home_core as HomeModel
|
||||||
import uuid
|
import uuid
|
||||||
from . import db
|
from . import db
|
||||||
from .db_class.db import History, Session_db
|
from .db_class.db import History, Session_db
|
||||||
from sqlalchemy import func
|
|
||||||
|
|
||||||
|
|
||||||
sessions = list()
|
sessions = list()
|
||||||
|
@ -21,23 +20,11 @@ class Session_class:
|
||||||
self.stopped = False
|
self.stopped = False
|
||||||
self.result_stopped = dict()
|
self.result_stopped = dict()
|
||||||
self.result = dict()
|
self.result = dict()
|
||||||
self.expansion = self.expansion_setter(request_json)
|
|
||||||
self.hover = self.hover_setter(request_json)
|
|
||||||
self.query = request_json["query"]
|
self.query = request_json["query"]
|
||||||
self.input_query = request_json["input"]
|
self.input_query = request_json["input"]
|
||||||
self.glob_query = self.expansion + self.hover
|
self.glob_query = self.expansion + self.hover
|
||||||
self.nb_errors = 0
|
self.nb_errors = 0
|
||||||
self.config_module = self.config_module_setter(request_json)
|
self.config_module = self.config_module_setter(request_json)
|
||||||
|
|
||||||
def expansion_setter(self, request_json):
|
|
||||||
if "expansion" in request_json:
|
|
||||||
return request_json["expansion"]
|
|
||||||
return []
|
|
||||||
|
|
||||||
def hover_setter(self, request_json):
|
|
||||||
if "hover" in request_json:
|
|
||||||
return request_json["hover"]
|
|
||||||
return []
|
|
||||||
|
|
||||||
def config_module_setter(self, request_json):
|
def config_module_setter(self, request_json):
|
||||||
if request_json["config"]:
|
if request_json["config"]:
|
||||||
|
|
|
@ -20,75 +20,38 @@
|
||||||
<span v-if="status_site" id="status">[[status_site]]</span>
|
<span v-if="status_site" id="status">[[status_site]]</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Modules selection -->
|
<br>
|
||||||
<div class="card card-body" style="margin-top: 10px;">
|
|
||||||
<h4>Modules Type</h4>
|
|
||||||
<table>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<input type="checkbox" id="expansion_module" @click="expansion_module()" value="expansion_module">
|
|
||||||
<label class="checkbox-type-module" for="expansion_module" title="Select all expansion modules">Expansion modules</label>
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<input type="checkbox" id="hover_module" @click="hover_module()" value="hover_module">
|
|
||||||
<label class="checkbox-type-module" for="hover_module" title="Select all hover modules">Hover modules</label>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Attributes selection -->
|
<!-- Attributes selection -->
|
||||||
<div v-if="misp_attributes_list.length" class="card card-body" style="margin-top: 10px;">
|
<div v-if="misp_attributes_list.length" style="margin-top: 10px; transform: translate(25%, 0);">
|
||||||
<div class="row" style="margin-top: 2px;">
|
<div>
|
||||||
<div>
|
<h4>Input Attributes</h4>
|
||||||
<div>
|
</div>
|
||||||
<h4>Input Attributes</h4>
|
<div>
|
||||||
</div>
|
<select data-placeholder="Input" class="select2-input form-control" name="input_select" id="input_select">
|
||||||
<div>
|
<option value="None">--</option>
|
||||||
<select data-placeholder="Input" class="select2-input form-control" name="input_select" id="input_select">
|
<template v-for="attributes in misp_attributes_list">
|
||||||
<option value="None">--</option>
|
<option :value="attributes">[[attributes]]</option>
|
||||||
<template v-for="attributes in misp_attributes_list">
|
</template>
|
||||||
<option :value="attributes">[[attributes]]</option>
|
</select>
|
||||||
</template>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Results modules selection -->
|
<!-- Results modules selection -->
|
||||||
<template v-if="modules_list">
|
<template v-if="modules_list.length">
|
||||||
<div v-if="Object.keys(modules_list).length">
|
<div v-if="attr_selected.length" style="margin-top: 10px; width: 50%; transform: translate(50%, 0);">
|
||||||
<div class="row" v-if="attr_selected.length">
|
<h4>Modules</h4>
|
||||||
<div class="col-5" v-if="modules_list.expansion.length">
|
<select data-placeholder="Modules" class="select2-modules form-control" multiple name="modules_select" id="modules_select">
|
||||||
<div class="col-5">
|
<template v-for="key in modules_list">
|
||||||
<h4>Expansions Modules</h4>
|
<option v-if="key.mispattributes.input.includes(attr_selected)" :value="key.name" :title="key.meta.description">[[key.name]]</option>
|
||||||
</div>
|
</template>
|
||||||
|
</select>
|
||||||
<select data-placeholder="Expansion" class="select2-expansion form-control" multiple name="expansion_select" id="expansion_select">
|
|
||||||
<template v-for="key in modules_list.expansion">
|
|
||||||
<option v-if="key.mispattributes.input.includes(attr_selected)" :value="key.name" :title="key.meta.description">[[key.name]]</option>
|
|
||||||
</template>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="col-5" v-if="modules_list.hover.length">
|
|
||||||
<div class="col-5">
|
|
||||||
<h4>Hover Modules</h4>
|
|
||||||
</div>
|
|
||||||
<select data-placeholder="Hover" class="select2-hover form-control" multiple name="hover_select" id="hover_select">
|
|
||||||
<template v-for="key in modules_list.hover">
|
|
||||||
<option v-if="key.mispattributes.input.includes(attr_selected)" :value="key.name" :title="key.meta.description">[[key.name]]</option>
|
|
||||||
</template>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<!-- Display in case a module as reauest_on_query activate -->
|
<!-- Display in case a module as reauest_on_query activate -->
|
||||||
<div v-if="config_query.length" style="margin-top: 10px;" class="row">
|
<div v-if="config_query.length" style="margin-top: 10px; padding: 5px" class="row">
|
||||||
<h4>Config</h4>
|
<h4>Config</h4>
|
||||||
<div class="card col" style="margin-top: 10px;" 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>
|
||||||
<div v-for="conf in module.meta.config" class="mb-3">
|
<div v-for="conf in module.meta.config" class="mb-3">
|
||||||
<label :for="'form-'+conf+'-'+module.name" class="form-label">[[conf]]</label>
|
<label :for="'form-'+conf+'-'+module.name" class="form-label">[[conf]]</label>
|
||||||
|
@ -112,15 +75,12 @@
|
||||||
delimiters: ['[[', ']]'],
|
delimiters: ['[[', ']]'],
|
||||||
setup() {
|
setup() {
|
||||||
const query = ref("Query")
|
const query = ref("Query")
|
||||||
const modules_list = ref({})
|
const modules_list = ref([])
|
||||||
const misp_attributes_list = ref({})
|
const misp_attributes_list = ref({})
|
||||||
const attr_selected = ref([])
|
const attr_selected = ref([])
|
||||||
|
|
||||||
const progress = ref(0)
|
const progress = ref(0)
|
||||||
|
|
||||||
let expansion_bool = false
|
|
||||||
let hover_bool = false
|
|
||||||
|
|
||||||
const current_query = ref()
|
const current_query = ref()
|
||||||
const status_site = ref()
|
const status_site = ref()
|
||||||
|
|
||||||
|
@ -131,6 +91,7 @@
|
||||||
current_query.value = $("#process-query").val()
|
current_query.value = $("#process-query").val()
|
||||||
if (!current_query.value) {
|
if (!current_query.value) {
|
||||||
status_site.value = '↖ You need to type something'
|
status_site.value = '↖ You need to type something'
|
||||||
|
window.scrollTo(0, 0);
|
||||||
return
|
return
|
||||||
}else{
|
}else{
|
||||||
status_site.value = ""
|
status_site.value = ""
|
||||||
|
@ -140,8 +101,7 @@
|
||||||
progress.value = 0
|
progress.value = 0
|
||||||
let error_flag = false
|
let error_flag = false
|
||||||
|
|
||||||
let result_dict = {"expansion": $("#expansion_select").val(),
|
let result_dict = {"modules": $("#modules_select").val(),
|
||||||
"hover": $("#hover_select").val(),
|
|
||||||
"input": $("#input_select").val(),
|
"input": $("#input_select").val(),
|
||||||
"query": current_query.value
|
"query": current_query.value
|
||||||
}
|
}
|
||||||
|
@ -185,26 +145,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
async function query_modules(){
|
async function query_modules(){
|
||||||
let url = ""
|
let res = await fetch("/get_modules")
|
||||||
if(expansion_bool) url += "expansion="+expansion_bool+"&"
|
|
||||||
if(hover_bool) url += "hover="+hover_bool
|
|
||||||
|
|
||||||
let res = await fetch("/get_modules?"+url)
|
|
||||||
let loc = await res.json()
|
let loc = await res.json()
|
||||||
modules_list.value = loc
|
modules_list.value = loc
|
||||||
|
|
||||||
await query_misp_attributes()
|
await query_misp_attributes()
|
||||||
}
|
}
|
||||||
|
query_modules()
|
||||||
|
|
||||||
async function query_misp_attributes(){
|
async function query_misp_attributes(){
|
||||||
let url = ""
|
let res = await fetch("/get_list_misp_attributes")
|
||||||
if(expansion_bool) url += "expansion="+expansion_bool+"&"
|
|
||||||
if(hover_bool) url += "hover="+hover_bool
|
|
||||||
|
|
||||||
let res = await fetch("/get_list_misp_attributes?"+url)
|
|
||||||
let loc = await res.json()
|
let loc = await res.json()
|
||||||
misp_attributes_list.value = loc
|
misp_attributes_list.value = loc
|
||||||
|
|
||||||
|
@ -212,7 +163,8 @@
|
||||||
|
|
||||||
if (!$('.select2-input').hasClass("select2-hidden-accessible")) {
|
if (!$('.select2-input').hasClass("select2-hidden-accessible")) {
|
||||||
$('.select2-input').select2({
|
$('.select2-input').select2({
|
||||||
theme: 'bootstrap-5'
|
theme: 'bootstrap-5',
|
||||||
|
width: '50%'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (!$('.select2-expansion').hasClass("select2-hidden-accessible")) {
|
if (!$('.select2-expansion').hasClass("select2-hidden-accessible")) {
|
||||||
|
@ -234,31 +186,25 @@
|
||||||
|
|
||||||
await nextTick()
|
await nextTick()
|
||||||
|
|
||||||
if (!$('.select2-expansion').hasClass("select2-hidden-accessible")) {
|
if (!$('.select2-modules').hasClass("select2-hidden-accessible")) {
|
||||||
$('.select2-expansion').select2({
|
$('.select2-modules').select2({
|
||||||
theme: 'bootstrap-5'
|
theme: 'bootstrap-5'
|
||||||
})
|
})
|
||||||
$('#expansion_select').on('change.select2', async function (e) {
|
$('#modules_select').on('change.select2', async function (e) {
|
||||||
let loc_list = $(this).select2('data').map(item => item.id)
|
let loc_list = $(this).select2('data').map(item => item.id)
|
||||||
config_query.value = []
|
config_query.value = []
|
||||||
for(let el in loc_list){
|
for(let el in loc_list){
|
||||||
for(let index in modules_list.value.expansion){
|
for(let index in modules_list.value){
|
||||||
if(modules_list.value.expansion[index].name == loc_list[el]){
|
if(modules_list.value[index].name == loc_list[el]){
|
||||||
if(modules_list.value.expansion[index].request_on_query){
|
if(modules_list.value[index].request_on_query){
|
||||||
config_query.value.push(modules_list.value.expansion[index])
|
config_query.value.push(modules_list.value[index])
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (!$('.select2-hover').hasClass("select2-hidden-accessible")) {
|
|
||||||
$('.select2-hover').select2({
|
|
||||||
theme: 'bootstrap-5'
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#input_select').on('select2:open', function (e) {
|
$('#input_select').on('select2:open', function (e) {
|
||||||
|
@ -266,15 +212,6 @@
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
async function expansion_module(){
|
|
||||||
expansion_bool = !expansion_bool
|
|
||||||
await query_modules()
|
|
||||||
}
|
|
||||||
async function hover_module(){
|
|
||||||
hover_bool = !hover_bool
|
|
||||||
await query_modules()
|
|
||||||
}
|
|
||||||
|
|
||||||
function pairedList() {
|
function pairedList() {
|
||||||
let pairs = [];
|
let pairs = [];
|
||||||
for (let i = 0; i < this.items.length; i += 2) {
|
for (let i = 0; i < this.items.length; i += 2) {
|
||||||
|
@ -298,8 +235,6 @@
|
||||||
status_site,
|
status_site,
|
||||||
config_query,
|
config_query,
|
||||||
actionQuery,
|
actionQuery,
|
||||||
expansion_module,
|
|
||||||
hover_module,
|
|
||||||
pairedList,
|
pairedList,
|
||||||
checked_attr,
|
checked_attr,
|
||||||
generateCoreFormatUI
|
generateCoreFormatUI
|
||||||
|
|
|
@ -121,12 +121,15 @@
|
||||||
if (data['remaining'] > 0) {
|
if (data['remaining'] > 0) {
|
||||||
setTimeout(pollScan, 3000);
|
setTimeout(pollScan, 3000);
|
||||||
} else {
|
} else {
|
||||||
|
let sum = data['complete'] - data["nb_errors"]
|
||||||
// Button Stop pressed
|
// Button Stop pressed
|
||||||
if (data['stopped'])
|
if (data['stopped']){
|
||||||
status_site.value = 'Stopped ! ' + data['complete'] - data["nb_errors"] + ' Success. ' + data["nb_errors"] + ' Errors. ' + data['complete'] + ' Total.'
|
status_site.value = 'Stopped ! ' + sum + ' Success. ' + data["nb_errors"] + ' Errors. ' + data['complete'] + ' Total.'
|
||||||
// Display result of the search
|
console.log(data['complete'] - data["nb_errors"]);
|
||||||
else
|
// Display result of the search
|
||||||
status_site.value = data['complete'] - data["nb_errors"] + ' Success. ' + data["nb_errors"] + ' Errors. ' + data['complete'] + ' Total.'
|
}else{
|
||||||
|
status_site.value = sum + ' Success. ' + data["nb_errors"] + ' Errors. ' + data['complete'] + ' Total.'
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (last_registered < data['registered']) {
|
if (last_registered < data['registered']) {
|
||||||
last_registered = data['registered']
|
last_registered = data['registered']
|
||||||
|
|
Loading…
Reference in New Issue