diff options
Diffstat (limited to 'modules/core/module-system.js')
| -rw-r--r-- | modules/core/module-system.js | 53 |
1 files changed, 51 insertions, 2 deletions
diff --git a/modules/core/module-system.js b/modules/core/module-system.js index c0dbe14..c2115c1 100644 --- a/modules/core/module-system.js +++ b/modules/core/module-system.js @@ -44,7 +44,7 @@ } }, 500); this.commands['status'] = () => { - this.terminal.print(`System: WebX11 v4.2`); + this.terminal.print(`System: WebX11 ${window.NEWOS4_VERSION || 'v4.0'}`); this.terminal.print(`Network: ${navigator.onLine ? 'Online' : 'Offline'}`); this.terminal.print(`Files: ${this.terminal.fs.ls().length} items`); this.terminal.print(`Modules: ${Object.keys(this.terminal.moduleManager.modules).length} loaded`); @@ -134,6 +134,55 @@ this.terminal.print(`Font size set to ${val}px (saved) š`, 'success'); }; this.commands['setfont'] = this.commands['font-size']; + + // Checkpoint commands (delegated to virtual-fs.js) + this.commands['checkpoint'] = (args) => { + try { + const name = args[0] || ''; + this.terminal.fs.checkpoint(name); + const displayName = name || new Date().toISOString(); + this.terminal.print('ā
Checkpoint created: ' + displayName, 'success'); + } catch (e) { + this.terminal.print('Checkpoint failed: ' + e.message, 'error'); + } + }; + this.commands['checkpoint-list'] = () => { + try { + const list = this.terminal.fs.listCheckpoints(); + if (!list || list.length === 0) { + this.terminal.print('No checkpoints found', 'info'); + return; + } + this.terminal.print('š Checkpoints:', 'text-muted'); + list.forEach(c => this.terminal.print(' ⢠' + c)); + } catch (e) { + this.terminal.print('checkpoint-list failed: ' + e.message, 'error'); + } + }; + this.commands['checkpoint-del'] = (args) => { + if (!args[0]) return this.terminal.print('Usage: checkpoint-del <name>', 'warning'); + try { + if (this.terminal.fs.deleteCheckpoint(args[0])) { + this.terminal.print('Deleted checkpoint: ' + args[0], 'success'); + } else { + this.terminal.print('Checkpoint not found: ' + args[0], 'error'); + } + } catch (e) { + this.terminal.print('checkpoint-del failed: ' + e.message, 'error'); + } + }; + this.commands['rollback'] = (args) => { + if (!args[0]) return this.terminal.print('Usage: rollback <name>', 'warning'); + try { + if (this.terminal.fs.rollback(args[0])) { + this.terminal.print('ā» Rolled back to checkpoint: ' + args[0], 'success'); + } else { + this.terminal.print('Rollback failed: checkpoint not found or invalid', 'error'); + } + } catch (e) { + this.terminal.print('Rollback failed: ' + e.message, 'error'); + } + }; } _autoRotateLogs(force = false) { try { @@ -253,7 +302,7 @@ skills:'š Skills', config:'āļø Config', webx:'š WebX', data:'š¾ Data', ext:'š§° Extras', gui:'š„ļø GUI', vault:'š Vault' }; - let result = 'āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā\nā š· WebX11 v4.2 ā All Commands ā\nāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā\n\n'; + let result = 'āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā\nā š· WebX11 ' + (window.NEWOS4_VERSION || 'v4.0') + ' ā All Commands ā\nāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā\n\n'; const total = Object.keys(helpMap).length; result += `š ${total} commands loaded\n\n`; for (const [key, cmds] of Object.entries(cats)) { |