-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0696461
commit 06f7aab
Showing
12 changed files
with
1,317 additions
and
26 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,75 @@ | ||
// Utility for safely interacting with localStorage | ||
export const safeStorage = { | ||
setItem(key: string, value: string) { | ||
try { | ||
localStorage.setItem(key, value); | ||
return true; | ||
} catch (error: unknown) { | ||
console.warn('[Storage] Failed to save to localStorage:', { | ||
key, | ||
error, | ||
storageUsed: this.getUsedSpace() | ||
}); | ||
// Try to clear old items if storage is full | ||
if (error instanceof Error && error.name === 'QuotaExceededError') { | ||
this.clearOldItems(); | ||
try { | ||
localStorage.setItem(key, value); | ||
return true; | ||
} catch (retryError: unknown) { | ||
console.error('[Storage] Still failed after clearing storage:', retryError); | ||
} | ||
} | ||
return false; | ||
} | ||
}, | ||
|
||
getItem(key: string, defaultValue: string = '') { | ||
try { | ||
const value = localStorage.getItem(key); | ||
return value !== null ? value : defaultValue; | ||
} catch (error: unknown) { | ||
console.warn('[Storage] Failed to read from localStorage:', { | ||
key, | ||
error | ||
}); | ||
return defaultValue; | ||
} | ||
}, | ||
|
||
getUsedSpace() { | ||
try { | ||
let total = 0; | ||
for (let key in localStorage) { | ||
if (Object.prototype.hasOwnProperty.call(localStorage, key)) { | ||
total += localStorage[key].length + key.length; | ||
} | ||
} | ||
return (total * 2) / 1024 / 1024; // Approximate MB used | ||
} catch (error: unknown) { | ||
console.error('[Storage] Failed to calculate storage usage:', error); | ||
return 0; | ||
} | ||
}, | ||
|
||
clearOldItems() { | ||
try { | ||
const themeKey = 'theme'; | ||
const verboseModeKey = 'verboseMode'; | ||
// Keep important settings but clear other items | ||
const currentTheme = this.getItem(themeKey); | ||
const verboseMode = this.getItem(verboseModeKey); | ||
|
||
localStorage.clear(); | ||
|
||
if (currentTheme) { | ||
this.setItem(themeKey, currentTheme); | ||
} | ||
if (verboseMode) { | ||
this.setItem(verboseModeKey, verboseMode); | ||
} | ||
} catch (error) { | ||
console.error('[Storage] Failed to clear storage:', error); | ||
} | ||
} | ||
}; |
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 |
---|---|---|
@@ -1,19 +1 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"/> | ||
<link rel="icon" href="favicon.ico"/> | ||
<meta name="viewport" content="width=device-width,initial-scale=1"/> | ||
<meta name="theme-color" content="#000000"/> | ||
<meta name="description" content="Web site created using create-react-app"/> | ||
<link rel="apple-touch-icon" href="logo192.png"/> | ||
<link rel="manifest" href="manifest.json"/> | ||
<title>React App</title> | ||
<script defer="defer" src="static/js/main.a499650c.js"></script> | ||
<link href="static/css/main.351373b1.css" rel="stylesheet"> | ||
</head> | ||
<body> | ||
<noscript>You need to enable JavaScript to run this app.</noscript> | ||
<div id="root"></div> | ||
</body> | ||
</html> | ||
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Web site created using create-react-app"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><title>React App</title><script defer="defer" src="/static/js/main.853522c4.js"></script><link href="/static/css/main.351373b1.css" rel="stylesheet"></head><body><noscript>You need to enable JavaScript to run this app.</noscript><div id="root"></div></body></html> |
475 changes: 475 additions & 0 deletions
475
webui/src/main/resources/application/static/js/main.49738660.js
Large diffs are not rendered by default.
Oops, something went wrong.
112 changes: 112 additions & 0 deletions
112
webui/src/main/resources/application/static/js/main.49738660.js.LICENSE.txt
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,112 @@ | ||
/*! | ||
* Wait for document loaded before starting the execution | ||
*/ | ||
|
||
/*! | ||
* Font Awesome Free 6.7.1 by @fontawesome - https://fontawesome.com | ||
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License) | ||
* Copyright 2024 Fonticons, Inc. | ||
*/ | ||
|
||
/*! @license DOMPurify 3.1.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.1.6/LICENSE */ | ||
|
||
/*! Check if previously processed */ | ||
|
||
/*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT */ | ||
|
||
/** | ||
* @license React | ||
* react-dom.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @license React | ||
* react-is.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @license React | ||
* react-jsx-runtime.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @license React | ||
* react.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @license React | ||
* scheduler.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @license React | ||
* use-sync-external-store-shim.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* @license React | ||
* use-sync-external-store-shim/with-selector.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** | ||
* Prism: Lightweight, robust, elegant syntax highlighting | ||
* | ||
* @license MIT <https://opensource.org/licenses/MIT> | ||
* @author Lea Verou <https://lea.verou.me> | ||
* @namespace | ||
* @public | ||
*/ | ||
|
||
/** @license React v16.13.1 | ||
* react-is.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
/** @license React v17.0.2 | ||
* react-is.production.min.js | ||
* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ |
1 change: 1 addition & 0 deletions
1
webui/src/main/resources/application/static/js/main.49738660.js.map
Large diffs are not rendered by default.
Oops, something went wrong.
475 changes: 475 additions & 0 deletions
475
webui/src/main/resources/application/static/js/main.853522c4.js
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.