Skip to content

Commit

Permalink
Merge branch 'rolling' into FEAT/427_export-import-settings-to-and-fr…
Browse files Browse the repository at this point in the history
…om-a-json-file-support-for-the-ui
  • Loading branch information
neon-mmd committed Nov 2, 2024
2 parents 2a4ddc4 + ef0ae2f commit 9c79f9e
Show file tree
Hide file tree
Showing 21 changed files with 139 additions and 148 deletions.
65 changes: 50 additions & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ reqwest = { version = "0.12.5", default-features = false, features = [
"rustls-tls",
"brotli",
"gzip",
"http2"
"http2",
"socks",
] }
tokio = { version = "1.32.0", features = [
tokio = { version = "1.41.0", features = [
"rt-multi-thread",
"macros",
"fs",
Expand All @@ -46,22 +47,22 @@ mlua = { version = "0.9.9", features = [
"luajit",
"vendored",
], default-features = false }
redis = { version = "0.25.4", features = [
redis = { version = "0.27.5", features = [
"tokio-comp",
"connection-manager",
"tcp_nodelay"
], default-features = false, optional = true }
blake3 = { version = "1.5.4", default-features = false }
error-stack = { version = "0.4.0", default-features = false, features = [
error-stack = { version = "0.5.0", default-features = false, features = [
"std",
] }
async-trait = { version = "0.1.80", default-features = false }
regex = { version = "1.9.4", features = ["perf"], default-features = false }
futures = { version = "0.3.30", default-features = false, features = ["alloc"] }
regex = { version = "1.11.1", features = ["perf"], default-features = false }
futures = { version = "0.3.31", default-features = false, features = ["alloc"] }
dhat = { version = "0.3.2", optional = true, default-features = false }
mimalloc = { version = "0.1.43", default-features = false }
async-once-cell = { version = "0.5.3", default-features = false }
actix-governor = { version = "0.5.0", default-features = false }
actix-governor = { version = "0.7.0", default-features = false }
moka = { version = "0.12.8", optional = true, default-features = false, features = [
"future",
] }
Expand Down Expand Up @@ -95,7 +96,7 @@ actix-multipart = { version = "0.7.2", default-features = false, features = [
[dev-dependencies]
rusty-hook = { version = "^0.11.2", default-features = false }
criterion = { version = "0.5.1", default-features = false }
tempfile = { version = "3.10.1", default-features = false }
tempfile = { version = "3.13.0", default-features = false }

[build-dependencies]
lightningcss = { version = "1.0.0-alpha.57", default-features = false, features = [
Expand Down
1 change: 1 addition & 0 deletions public/images/close.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 4 additions & 32 deletions public/static/index.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,6 @@
/**
* Selects the input element for the search box
* @type {HTMLInputElement}
*/
const searchBox = document.querySelector('input')

/**
* Redirects the user to the search results page with the query parameter
*/
function searchWeb() {
const query = searchBox.value.trim()
try {
let safeSearchLevel = document.querySelector('.search_options select').value
if (query) {
window.location.href = `search?q=${encodeURIComponent(
query,
)}&safesearch=${encodeURIComponent(safeSearchLevel)}`
}
} catch (error) {
if (query) {
window.location.href = `search?q=${encodeURIComponent(query)}`
}
}
* A function that clears the search input text when the clear button is clicked.
*/
function clearSearchText() {
document.querySelector('.search_bar > input').value = ''
}

/**
* Listens for the 'Enter' key press event on the search box and calls the searchWeb function
* @param {KeyboardEvent} e - The keyboard event object
*/
searchBox.addEventListener('keyup', (e) => {
if (e.key === 'Enter') {
searchWeb()
}
})
39 changes: 0 additions & 39 deletions public/static/pagination.js

This file was deleted.

18 changes: 0 additions & 18 deletions public/static/search_area_options.js

This file was deleted.

9 changes: 7 additions & 2 deletions public/static/themes/simple.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ button {
font-size: 1.6rem;
}

.search_bar input::-webkit-search-results-button,
.search_bar input::-webkit-search-cancel-button{
display: none;
}

.search_bar input:focus {
outline: 2px solid var(--foreground-color);
}
Expand Down Expand Up @@ -443,7 +448,7 @@ footer div {
align-items: center;
}

.page_navigation button {
.page_navigation a {
background: var(--background-color);
color: var(--foreground-color);
padding: 1rem;
Expand All @@ -452,7 +457,7 @@ footer div {
border: none;
}

.page_navigation button:active {
.page_navigation a:active {
filter: brightness(1.2);
}

Expand Down
6 changes: 3 additions & 3 deletions src/cache/cacher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ impl SharedCache {
/// # Arguments
///
/// * `url` - It takes the search url as an argument which will be used as the key to fetch the
/// cached results from the cache.
/// cached results from the cache.
///
/// # Error
///
Expand All @@ -563,9 +563,9 @@ impl SharedCache {
/// # Arguments
///
/// * `search_results` - It takes the `SearchResults` as an argument which are results that
/// needs to be cached.
/// needs to be cached.
/// * `url` - It takes the search url as an argument which will be used as the key for storing
/// results in the cache.
/// results in the cache.
///
/// # Error
///
Expand Down
Loading

0 comments on commit 9c79f9e

Please sign in to comment.