aboutsummaryrefslogtreecommitdiff
path: root/modules/core/module-system.js
diff options
context:
space:
mode:
Diffstat (limited to 'modules/core/module-system.js')
-rw-r--r--modules/core/module-system.js53
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)) {