Skip to content

Commit

Permalink
Merge branch 'siglens:develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
shyam2520 authored Nov 22, 2023
2 parents 2ff1266 + 0ae5108 commit 8180c9a
Show file tree
Hide file tree
Showing 11 changed files with 210 additions and 39 deletions.
29 changes: 23 additions & 6 deletions static/css/query-builder.css
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,9 @@ input.form-control {
.tab-list {
margin: 10px 24px 0 23px !important;
width: 220px;
height: 40px;
height: 44px;
border-radius: 5px;
border: 1px solid var(--border-switch);
background: var(--myOrg-input);
display: flex;
flex-direction: row;
justify-content: space-between;
Expand All @@ -382,7 +382,7 @@ input.form-control {
}

.tab-li {
height: 32px;
height: 34px;
border-radius: 5px;
}

Expand Down Expand Up @@ -413,9 +413,10 @@ a:visited.ui-button,
color: var(--border-switch) !important;
}

.ui-state-active {
background-color: rgba(99, 71, 217, 0.15) !important;
.ui-tabs .ui-tabs-nav .ui-state-active {
background: var(--tab-active-background) !important;
border: 1px solid var(--purple-1) !important;
margin-top: 1px;
}

.ui-state-active a,
Expand All @@ -431,6 +432,9 @@ a:visited.ui-button,

.ui-tabs .ui-tabs-nav li {
margin: 0;
background: var(--myOrg-input) !important;
height: 34px;
font-size: 17px;
}

#index-btn,
Expand Down Expand Up @@ -605,6 +609,7 @@ div.show-record-popup {
border: 1px solid var(--border-btn-color);
}
.ag-row,
.measureAggGrid .ag-row-even,
.LogResultsGrid .ag-row-even{
background-color: var(--default-tab) !important;
}
Expand All @@ -618,9 +623,21 @@ div.show-record-popup {
background-color: var(--panel-table-line-color);
bottom: 0;
}
.measureAggGrid .ag-row-even,
.ag-theme-mycustomtheme .ag-header,
.ag-theme-mycustomtheme .ag-header-cell-resize,
.ag-theme-mycustomtheme .ag-header {
background: var(--table-head-bg-color) !important;
}
.aggregations{
color: var(--black-5) !important;
margin-left: 10px;
}
.ag-header-viewport{
border-bottom: 1px solid var(--panel-table-line-color);
}
.stop-search{
background-color: var(--border-btn-color);
}
.stop-search:hover{
background-color: var(--border-btn-color);
}
28 changes: 21 additions & 7 deletions static/css/siglens.css
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,7 @@
--alerting-table-bg-color:var(--black-2);
--alerting-table-line-color:var(--white-4);
--alerting-table-hover: var(--black-2);
--tab-active-background:var(--purple-1);
}

/* end aliases */
Expand Down Expand Up @@ -362,6 +363,7 @@
--alerting-table-bg-color:var(--white-2);
--alerting-table-line-color: var(--white-3);
--alerting-table-hover: var(--white-1);
--tab-active-background: #E8E3F9;
}


Expand Down Expand Up @@ -3365,22 +3367,22 @@ input[type="date"]::-webkit-calendar-picker-indicator , input[type="time"]::-web

.section-buttons {
display: flex;
height: 40px;
height: 44px;
border-radius: 5px;
width: fit-content;
align-items: center;
border: 1px solid var(--subsection-border);
padding: 4px;
margin-top: 22px;
background-color: var(--black1-to-white0);
background: var(--myOrg-input);

}

.section-button {
padding: 4px 10px 5px 10px;
height: 32px;
height: 36px;
width: fit-content;
border-radius: 5px;
background-color: var(--black1-to-white0);
background: var(--myOrg-input);
display: flex;
align-items: center;
justify-content: center;
Expand All @@ -3397,9 +3399,9 @@ input[type="date"]::-webkit-calendar-picker-indicator , input[type="time"]::-web
}

.section-button.active {
height: 32px;
height: 34px;
border: 1px solid #6347D9;
background: rgba(99, 71, 217, 0.15);
background: var(--tab-active-background);
}

.api-keys-inner-info {
Expand Down Expand Up @@ -4037,6 +4039,18 @@ color: #C8C7CC;
overflow-y: scroll;
}

#alerting .section-buttons{
box-shadow: var(--box-shadow);
}

#alerting .section-buttons,#alerting .section-button{
background-color: var(--black1-to-white0);
}

#alerting .section-button.active{
background: var(--tab-active-background);
}

.subsection-heading{
display: flex;
align-items: center;
Expand Down
3 changes: 1 addition & 2 deletions static/css/tracing.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
width: fit-content;
align-items: center;
background: var(--myOrg-input);
border: 1px solid var(--subsection-border);
padding: 4px;
}

Expand Down Expand Up @@ -50,7 +49,7 @@
.section-button.active {
height: 32px;
border: 1px solid #6347D9;
background: rgba(99, 71, 217, 0.15);
background: var(--tab-active-background);
}

.search-input{
Expand Down
18 changes: 10 additions & 8 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,13 +66,14 @@
<div id="filter-container">
<div class="filter-con">
<div class="filter-box" id="filter-box-1">
<span class = "aggregations" id="search-filter-text">Search Filter</span>
<ul id="tags" class="tags-list"></ul>
<button id="add-con" class="add-con btn">+</button>
</div>
<div class="add-filter" id="add-filter">
<input id="column-first" class="column-first" type="hidden" />
<input id="symbol" class="symbol" type="hidden" />
<input id="value-first" class="value-first" type="hidden" />
<input id="column-first" class="column-first" type="hidden" onkeyup="checkContent(this)"/>
<input id="symbol" class="symbol" type="hidden" onkeyup="checkContent(this)"/>
<input id="value-first" class="value-first" type="hidden" onkeyup="checkContent(this)"/>
<button id="completed" class="completed btn"></button>
<button id="cancel-enter" class="cancel-enter btn">x</button>
</div>
Expand All @@ -81,24 +82,25 @@
<div class="display-rule">
<div class="filter-con second-enter">
<div class="filter-box" id="filter-box-2">
<span class = "aggregations" id="aggregate-attribute-text">Aggregate Attribute</span>
<ul id="tags-second" class="tags-list"></ul>
<button id="add-con-second" class="add-con btn">+</button>
</div>
<div class="add-filter add-filters" id="add-filter-second">
<input id="column-second" class="column-first" type="hidden" />
<input id="value-second" class="value-first" type="hidden" />
<button id="completed-second" class="completed btn"></button>
<input id="column-second" class="column-first" type="hidden" onkeyup="checkSecondContent(this)"/>
<input id="value-second" class="value-first" type="hidden" onkeyup="checkSecondContent(this)"/>
<button id="completed-second" class="completed btn" ></button>
<button id="cancel-enter-second" class="cancel-enter btn">x</button>
</div>
</div>
<div class="group-by-reminder">Group by</div>
<div class="filter-con third-enter">
<div class="filter-box third-box" id="filter-box-3">
<span class = "aggregations" id="aggregations">Search Criteria</span>
<ul id="tags-third" class="tags-list"></ul>
<button id="add-con-third" class="add-con btn">+</button>
</div>
<div class="add-filter add-third" id="add-filter-third">
<input id="column-third" class="column-third" type="hidden" placeholder="Group by columns" />
<input id="column-third" class="column-third" type="hidden" />
<button id="cancel-enter-third" class="cancel-enter btn">x</button>
</div>
</div>
Expand Down
13 changes: 3 additions & 10 deletions static/js/all-alerts.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,27 +57,19 @@ function getAllAlerts(){

class btnRenderer {
init(params) {
this.eGui = document.createElement('span');
this.eGui = document.createElement('span');
this.eGui.innerHTML = `<div id="alert-grid-btn">
<button class='btn mt-2 mx-3' id="viewbutton" title="Alert Details"></button>
<button class='btn' id="editbutton" title="Edit Alert Rule"></button>
<button class="btn-simple" id="delbutton" title="Delete Alert Rule"></button>
</div>`;
this.eButton = this.eGui.querySelector('#editbutton');
this.dButton = this.eGui.querySelector('.btn-simple');
this.vButton = this.eGui.querySelector('#viewbutton');

function editAlert(event){
var queryString = "?id=" + params.data.alertId;
window.location.href = "../alert.html" + queryString;
event.stopPropagation();
}

function viewAlert(event){
var queryString = "?id=" + params.data.alertId;
window.location.href = "../alert-details.html" + queryString;
event.stopPropagation();
}

function deleteAlert() {
$.ajax({
Expand Down Expand Up @@ -110,7 +102,7 @@ class btnRenderer {
$('#delete-btn').click(deleteAlert)
}

this.vButton.addEventListener('click', viewAlert);

this.eButton.addEventListener('click', editAlert);
this.dButton.addEventListener('click', showPrompt);
}
Expand Down Expand Up @@ -222,4 +214,5 @@ function removeToast() {
function onRowClicked(event) {
var queryString = "?id=" + event.data.alertId;
window.location.href = "../alert-details.html" + queryString;
event.stopPropagation();
}
43 changes: 41 additions & 2 deletions static/js/download-logs.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ let interval = null;
var progressBar = $("#progressbar");
var progressLabel = $(".progress-label");
let confirmDownload = true;
$(document).ready(() => {
setDownloadLogsDialog();
})
$(function () {
if (typeof interval != "undefined") {
doClearInterval();
Expand Down Expand Up @@ -109,7 +112,8 @@ function setDownloadLogsDialog() {
.map((item) => {
return headers
.map((header) => {
return item[header];
let col = item[header];
return typeof col !== "string" ? col : `"${col.replace(/"/g, '""')}"`;
})
.join(",");
})
Expand Down Expand Up @@ -158,6 +162,17 @@ function setDownloadLogsDialog() {

let params = getSearchFilter(false, false);
params.size = totalMatchLogs;
let searchText = params.searchText;
let n = searchText.indexOf("BY");
let arrNew = [], textArr = [];
if(n != -1){
let textCut = searchText.substring(n + 2, searchText.length);
let arrNew = textCut.split(",");
for (let i = 0; i < arrNew.length; i++) {
arrNew[i] = arrNew[i].trim();
}
textArr = arrNew.sort();
}
$.ajax({
method: "post",
url: "api/search",
Expand All @@ -182,13 +197,37 @@ function setDownloadLogsDialog() {
$("#progressbar").hide();
setProgress(progressBar, 100);
if (!confirmDownload) return;
if (res && res.hits && res.hits.records) {
if (res && res.hits && res.hits.records && res.hits.records.length > 0) {
let json = JSON.stringify(res.hits.records);
if (curChoose == ".json") downloadJson(name, json);
else {
const csvData = convertToCSV(json);
downloadCsv(csvData, name);
}
}else if (res && res.aggregations && res.aggregations[""].buckets.length > 0) {
let arr = res.aggregations[""].buckets;
let createNewRecords = [];
for(let i = 0; i < arr.length; i++){
let perInfo = arr[i];
let newPerInfo = {};
for(let key in perInfo){
if(key != "key" && key != "doc_count") newPerInfo[key] = perInfo[key].value;
else if(key == "key") {
for(let j = 0; j < textArr.length; j++){
newPerInfo[textArr[j]] = perInfo.key[j];
}
}
}
createNewRecords.push(newPerInfo);
}
let json = JSON.stringify(createNewRecords);
if (curChoose == ".json") downloadJson(name, json);
else {
const csvData = convertToCSV(json);
downloadCsv(csvData, name);
}
}else{
alert("no data available");
}
},
error: function () {
Expand Down
19 changes: 19 additions & 0 deletions static/js/event-handlers.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,17 +373,32 @@ function runLiveTailBtnHandler(evt) {
}
$("#daterangepicker").hide();
}
/**
*
* @returns true if the 2nd and 3rd box are all selected or all unselected
*/
function SecondOrThirdBox(){
let num = 0;
if(secondBoxSet && secondBoxSet.size > 0) num++;
if (thirdBoxSet && thirdBoxSet.size > 0) num++;
return num != 1;
}
function runFilterBtnHandler(evt) {
$('.popover').hide();
evt.preventDefault();
if (
$("#run-filter-btn").text() === " " ||
$("#query-builder-btn").text() === " "
) {

resetDashboard();
logsRowData = [];
wsState = "query";
data = getSearchFilter(false, false);
if (!SecondOrThirdBox()) {
alert("Error");
return;
}
availColNames = [];
doSearch(data);
} else {
Expand All @@ -404,6 +419,10 @@ function filterInputHandler(evt) {
resetDashboard();
logsRowData = [];
data = getSearchFilter(false, false);
if (!SecondOrThirdBox()) {
alert("Error");
return;
}
availColNames = [];
doSearch(data);
}
Expand Down
4 changes: 4 additions & 0 deletions static/js/log-results-grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,10 @@ const gridOptions = {
if(diff <= 5) {
let scrollingTrigger = true;
data = getSearchFilter(false, scrollingTrigger);
if (data && data.searchText == "error") {
alert("Error");
return;
}
doSearch(data);
}
}
Expand Down
Loading

0 comments on commit 8180c9a

Please sign in to comment.