()
| 809 | } |
| 810 | |
| 811 | async function apiRevertGlobalBak() { |
| 812 | const { id: bakcupId } = $.toObj($request.body) |
| 813 | const backup = $.getjson(bakcupId) |
| 814 | if (backup) { |
| 815 | const { |
| 816 | chavy_boxjs_sysCfgs, |
| 817 | chavy_boxjs_sysApps, |
| 818 | chavy_boxjs_sessions, |
| 819 | chavy_boxjs_userCfgs, |
| 820 | chavy_boxjs_cur_sessions, |
| 821 | chavy_boxjs_app_subCaches, |
| 822 | ...datas |
| 823 | } = backup |
| 824 | $.setdata(JSON.stringify(chavy_boxjs_sessions), $.KEY_sessions) |
| 825 | $.setdata(JSON.stringify(chavy_boxjs_userCfgs), $.KEY_usercfgs) |
| 826 | $.setdata(JSON.stringify(chavy_boxjs_cur_sessions), $.KEY_cursessions) |
| 827 | $.setdata(JSON.stringify(chavy_boxjs_app_subCaches), $.KEY_app_subCaches) |
| 828 | const isNull = (val) => |
| 829 | [undefined, null, 'null', 'undefined', ''].includes(val) |
| 830 | Object.keys(datas).forEach((datkey) => |
| 831 | $.setdata(isNull(datas[datkey]) ? '' : `${datas[datkey]}`, datkey) |
| 832 | ) |
| 833 | } |
| 834 | const boxdata = getBoxData() |
| 835 | $.json = boxdata |
| 836 | } |
| 837 | |
| 838 | async function apiSaveGlobalBak() { |
| 839 | const backups = $.getjson($.KEY_backups, []) |
nothing calls this directly
no test coverage detected
searching dependent graphs…