forked from inflection-zone/rean-admin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #107 from REAN-Foundation/release/uat-0.2.15
Release/uat 0.2.15
- Loading branch information
Showing
45 changed files
with
2,008 additions
and
886 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<script lang="ts"> | ||
export let text: string; | ||
let showTooltip = false; | ||
let tooltipElement: HTMLSpanElement; | ||
let shouldShowTooltip = false; | ||
$: shouldShowTooltip = text.length > 40; | ||
function handleMouseEnter() { | ||
if (shouldShowTooltip) { | ||
showTooltip = true; | ||
} | ||
} | ||
function handleMouseLeave() { | ||
showTooltip = false; | ||
} | ||
</script> | ||
|
||
<!-- svelte-ignore a11y-no-static-element-interactions --> | ||
<span | ||
class="relative inline-block" | ||
on:mouseenter={handleMouseEnter} | ||
on:mouseleave={handleMouseLeave} | ||
> | ||
<slot></slot> | ||
{#if showTooltip && shouldShowTooltip} | ||
<span | ||
bind:this={tooltipElement} | ||
class="absolute z-10 text-xs rounded-lg shadow-lg" | ||
style="bottom: 100%; left: 50%; transform: translateX(-50%); background-color: rgba(71, 85, 105, 0.95); border: 1px solid rgba(51, 65, 85, 0.1); color: #ffffff; margin-top: 10px; padding: 8px; font-size: 12px; min-width: 200px; max-width: 400px; text-align: left; white-space: normal; word-wrap: break-word; overflow-wrap: break-word; box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);" | ||
> | ||
{text} | ||
<span | ||
class="absolute" | ||
style="top: 100%; left: 50%; transform: translateX(-50%); width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 6px solid rgba(71, 85, 105, 0.95);" | ||
> | ||
</span> | ||
</span> | ||
{/if} | ||
</span> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
|
||
export interface ICache { | ||
set(key: string, value: unknown): Promise<void>; | ||
get(key: string): Promise<unknown | undefined>; | ||
has(key: string): Promise<boolean>; | ||
delete(key: string): Promise<boolean>; | ||
clear(): Promise<void>; | ||
findAndClear(searchPattern: string): Promise<string[]>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
|
||
export class CacheMap<V> { | ||
|
||
private cache: Map<string, V>; | ||
|
||
constructor() { | ||
this.cache = new Map<string, V>(); | ||
} | ||
|
||
set(key: string, value: V): void { | ||
this.cache.set(key, value); | ||
} | ||
|
||
get(key: string): V | undefined { | ||
return this.cache.get(key); | ||
} | ||
|
||
has(key: string): boolean { | ||
return this.cache.has(key); | ||
} | ||
|
||
delete(key: string): boolean { | ||
return this.cache.delete(key); | ||
} | ||
|
||
clear(): void { | ||
this.cache.clear(); | ||
} | ||
|
||
findAndClear(searchPattern: string): string[] { | ||
let keys: string[] = []; | ||
for (let key of this.cache.keys()) { | ||
if (key.includes(searchPattern)) { | ||
keys.push(key); | ||
} | ||
} | ||
for (let key of keys) { | ||
this.cache.delete(key); | ||
} | ||
return keys; | ||
} | ||
|
||
} | ||
|
||
//////////////////////////////////////////////////////////////////////////////////////// |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# Cache | ||
|
||
## Setup KeyDB as a Redis cache | ||
KeyDB is a high-performance fork of Redis with a focus on multithreading and memory efficiency | ||
It is designed to be a drop-in replacement for Redis | ||
KeyDB is fully compatible with Redis and supports all Redis commands | ||
|
||
``` | ||
docker run \ | ||
-d --name keydb \ | ||
-p 6379:6379 \ | ||
-e "CACHE_PASSWORD=your-password" \ | ||
-v /path/to/your/data:/data \ | ||
-v /path/to/your/logs:/logs keydb/keydb \ | ||
eqalpha/keydb | ||
``` | ||
|
||
Process to connect with KeyDB is same as Redis. | ||
1. Run the docker container. | ||
2. Set the password by logging into container | ||
a. First run redis-cli as | ||
```# redis-cli``` | ||
b. Set the password using | ||
```# auth <your-password>``` | ||
3. Create a client and connect to KeyDB. | ||
4. Use the client to perform operations. | ||
5. Close the connection when done. |
Oops, something went wrong.