data.js 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /*
  2. Copyright (C) 2025 QuantumNous
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Affero General Public License as
  5. published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Affero General Public License for more details.
  11. You should have received a copy of the GNU Affero General Public License
  12. along with this program. If not, see <https://www.gnu.org/licenses/>.
  13. For commercial licensing, please contact support@quantumnous.com
  14. */
  15. export function setStatusData(data) {
  16. localStorage.setItem('status', JSON.stringify(data));
  17. localStorage.setItem('system_name', data.system_name);
  18. localStorage.setItem('logo', data.logo);
  19. localStorage.setItem('footer_html', data.footer_html);
  20. localStorage.setItem('quota_per_unit', data.quota_per_unit);
  21. localStorage.setItem('display_in_currency', data.display_in_currency);
  22. localStorage.setItem('enable_drawing', data.enable_drawing);
  23. localStorage.setItem('enable_task', data.enable_task);
  24. localStorage.setItem('enable_data_export', data.enable_data_export);
  25. localStorage.setItem('chats', JSON.stringify(data.chats));
  26. localStorage.setItem(
  27. 'data_export_default_time',
  28. data.data_export_default_time,
  29. );
  30. localStorage.setItem(
  31. 'default_collapse_sidebar',
  32. data.default_collapse_sidebar,
  33. );
  34. localStorage.setItem('mj_notify_enabled', data.mj_notify_enabled);
  35. if (data.chat_link) {
  36. // localStorage.setItem('chat_link', data.chat_link);
  37. } else {
  38. localStorage.removeItem('chat_link');
  39. }
  40. if (data.chat_link2) {
  41. // localStorage.setItem('chat_link2', data.chat_link2);
  42. } else {
  43. localStorage.removeItem('chat_link2');
  44. }
  45. if (data.docs_link) {
  46. localStorage.setItem('docs_link', data.docs_link);
  47. } else {
  48. localStorage.removeItem('docs_link');
  49. }
  50. }
  51. export function setUserData(data) {
  52. localStorage.setItem('user', JSON.stringify(data));
  53. }