Add settings page for managing forecasting API key and URL via UI
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
cae411eae7
commit
1c411e402e
19809 changed files with 1962608 additions and 97 deletions
37
frontend/node_modules/recharts/es6/util/LRUCache.js
generated
vendored
Normal file
37
frontend/node_modules/recharts/es6/util/LRUCache.js
generated
vendored
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
|
||||
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == typeof i ? i : i + ""; }
|
||||
function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != typeof i) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
||||
/**
|
||||
* Simple LRU (Least Recently Used) cache implementation
|
||||
*/
|
||||
export class LRUCache {
|
||||
constructor(maxSize) {
|
||||
_defineProperty(this, "cache", new Map());
|
||||
this.maxSize = maxSize;
|
||||
}
|
||||
get(key) {
|
||||
var value = this.cache.get(key);
|
||||
if (value !== undefined) {
|
||||
this.cache.delete(key);
|
||||
this.cache.set(key, value);
|
||||
}
|
||||
return value;
|
||||
}
|
||||
set(key, value) {
|
||||
if (this.cache.has(key)) {
|
||||
this.cache.delete(key);
|
||||
} else if (this.cache.size >= this.maxSize) {
|
||||
var firstKey = this.cache.keys().next().value;
|
||||
if (firstKey != null) {
|
||||
this.cache.delete(firstKey);
|
||||
}
|
||||
}
|
||||
this.cache.set(key, value);
|
||||
}
|
||||
clear() {
|
||||
this.cache.clear();
|
||||
}
|
||||
size() {
|
||||
return this.cache.size;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue