Skip to content

Commit

Permalink
some previous changes
Browse files Browse the repository at this point in the history
  • Loading branch information
IhorStorozhok committed Apr 5, 2024
1 parent 1babd94 commit 684f6f1
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 7 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
<script>
// @ts-nocheck
export let searchText = "";
import Button from "../../../lib/Button/Button.svelte";
import DropDown from "../../../lib/DropDown/DropDown.svelte";
import { clickOutside } from "../../../lib/OutsideClicker/OutsideClicker.js";
let dropDownIsVisible = false;
let isSearchVIsible = false;
let timer;
const debounce = (v) => {
clearTimeout(timer);
timer = setTimeout(() => {
searchText = v;
}, 750);
};
function dropDownToggle() {
dropDownIsVisible = !dropDownIsVisible;
}
Expand Down Expand Up @@ -65,6 +75,12 @@
{#if !searchText}<div class="searchIcoContainer">
<i class={"log log-Search"} />
</div>{/if}
<input type="text" bind:value={searchText} placeholder="Search" />
<input
type="text"
on:input={(e) => {
searchText = e.target.value;
}}
placeholder="Search"
/>
</div>
</div>
8 changes: 2 additions & 6 deletions application/frontend/src/Views/Logs/NewLogsV2.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -347,11 +347,7 @@
},
});
toastIsVisible.set(true);
toastTimeoutId.set(
setTimeout(() => {
toastIsVisible.set(false);
}, 10000)
);
}
}
Expand Down Expand Up @@ -678,7 +674,7 @@
}
$: {
if (allLogs) {
if ([...allLogs]) {
highlightSearchText();
}
}
Expand Down
11 changes: 11 additions & 0 deletions application/frontend/src/Views/Logs/functions.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,3 +205,14 @@ export const findSearchTextInLogs = (sel, searchText, caseSens) => {
});
});
};

export function debounce(callback, delay) {
let timeoutId;

return function (...args) {
clearTimeout(timeoutId);
timeoutId = setTimeout(() => {
callback.apply(this, args);
}, delay);
};
}
2 changes: 2 additions & 0 deletions application/frontend/src/Views/Main/Main.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
import MainChartMenu from "../../lib/ChartMenu/MainChartMenu.svelte";
import SettingsController from "./SettingsController.svelte";
import StreamInfo from "../../lib/StreamInfo/StreamInfo.svelte";
import { findSearchTextInLogs } from "../../Views/Logs/functions";
let api = new fetchApi();
let hostList = [];
Expand All @@ -55,6 +56,7 @@
let withoutRightPanel = false;
function handleClick({ target }) {
findSearchTextInLogs();
if (!target.classList.contains("buttonToBottom")) {
lastLogTimestamp.set(new Date().getTime());
}
Expand Down

0 comments on commit 684f6f1

Please sign in to comment.