chg: [query] query as same

pull/670/head
David Cruciani 2024-07-08 16:06:29 +02:00
parent 2423bc7ade
commit 5190d30997
No known key found for this signature in database
GPG Key ID: 8690CDE1E3994B9B
2 changed files with 10 additions and 7 deletions

View File

@ -8,7 +8,9 @@ function parseMispObject(misp_object, query_url, functionToCall){
if(v.type != 'counter' && v.type != 'datetime'){
if(query_url){
$query=$("<a>").attr("href", query_url+v.value).text("query").css("margin-left", "10px")
$query=$("<a>").attr({"href": query_url+v.value, "title": "Query this value with new attributes or modules"})
.text("query")
.css("margin-left", "10px")
}
if(functionToCall){
// `_${functionToCall.name}('${v.value}')` refer to 'window._query_as_same = query_as_same' in my vue file
@ -16,7 +18,8 @@ function parseMispObject(misp_object, query_url, functionToCall){
"title": "Query this value with the same attribute and modules as the main query",
"class": "btn btn-link"
})
.text("query as same")
// .text("query as same")
.append($("<i>").attr("class", "fa-solid fa-recycle"))
.css({"margin-left": "10px", "padding": "0", "--bs-btn-border-width": "0"})
}
}
@ -45,8 +48,8 @@ function parseMispObject(misp_object, query_url, functionToCall){
"margin-left": "0.5em",
}),
$("<div>").text("Value: "+ v.value),
$query,
$query_same
$query_same,
$query
)
)
)

View File

@ -12,16 +12,16 @@
</div>
<div class="btn-group" style="float: right;" role="group" aria-label="Basic mixed styles example">
<a style="float: right;" class="btn btn-primary" href="/" title="Do a new query with no relation with this one">New query</a>
<a style="float: right;" class="btn btn-primary" href="/" title="Do a new query with no relation with this one"><i class="fa-solid fa-plus"></i> New query</a>
<a style="float: right;" class="btn btn-secondary" href="/?query={{query}}" title="New query with same name">Query</a>
<div class="dropdown" style="float: right;">
<button class="btn btn-primary dropdown-toggle" title="New query with same parameters" style="border-radius: 0;" data-bs-toggle="dropdown" aria-expanded="false" data-bs-auto-close="outside">
Query as same
<i class="fa-solid fa-recycle"></i>
</button>
<div class="dropdown-menu p-4" style="min-width: 200px;">
<div class="mb-3">
<label for="query_as_params" class="form-label">To query:</label>
<input type="email" class="form-control" id="query_as_params" placeholder="{{', '.join(query)}}">
<input type="email" class="form-control" id="query_as_params" value="{{', '.join(query)}}">
<div id="query_as_params_error" style="color:brown"></div>
</div>
<button type="submit" class="btn btn-primary btn-sm" @click="query_as_params()" style="border-radius: 50px;">Query</button>