data.js 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  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('pay_methods', JSON.stringify(data.pay_methods));
  27. localStorage.setItem(
  28. 'data_export_default_time',
  29. data.data_export_default_time,
  30. );
  31. localStorage.setItem(
  32. 'default_collapse_sidebar',
  33. data.default_collapse_sidebar,
  34. );
  35. localStorage.setItem('mj_notify_enabled', data.mj_notify_enabled);
  36. if (data.chat_link) {
  37. // localStorage.setItem('chat_link', data.chat_link);
  38. } else {
  39. localStorage.removeItem('chat_link');
  40. }
  41. if (data.chat_link2) {
  42. // localStorage.setItem('chat_link2', data.chat_link2);
  43. } else {
  44. localStorage.removeItem('chat_link2');
  45. }
  46. if (data.docs_link) {
  47. localStorage.setItem('docs_link', data.docs_link);
  48. } else {
  49. localStorage.removeItem('docs_link');
  50. }
  51. }
  52. export function setUserData(data) {
  53. localStorage.setItem('user', JSON.stringify(data));
  54. }