mirror of
https://github.com/HeyPuter/puter.git
synced 2026-11-04 21:15:50 +00:00
dev: update emu load indicator
This commit is contained in:
1 parent
04c05a5bb8
commit
6e1ed7ab04
7 files changed
+35
-9
No files matched your search
Generated
+9
@@ -7296,6 +7296,14 @@
|
||||
"@xterm/xterm": "^5.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/addon-image": {
|
||||
"version": "0.8.0",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/addon-image/-/addon-image-0.8.0.tgz",
|
||||
"integrity": "sha512-b/dqpFn3jUad2pUP5UpF4scPIh0WdxRQL/1qyiahGfUI85XZTCXo0py9G6AcOR2QYUw8eJ8EowGspT7BQcgw6A==",
|
||||
"peerDependencies": {
|
||||
"@xterm/xterm": "^5.2.0"
|
||||
}
|
||||
},
|
||||
"node_modules/@xterm/xterm": {
|
||||
"version": "5.5.0",
|
||||
"resolved": "https://registry.npmjs.org/@xterm/xterm/-/xterm-5.5.0.tgz",
|
||||
@@ -17436,6 +17444,7 @@
|
||||
"license": "AGPL-3.0-only",
|
||||
"dependencies": {
|
||||
"@xterm/addon-fit": "^0.10.0",
|
||||
"@xterm/addon-image": "^0.8.0",
|
||||
"@xterm/xterm": "^5.5.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
|
||||
@@ -115,6 +115,11 @@ const setup_pty = (ptt, pty) => {
|
||||
})()
|
||||
}
|
||||
|
||||
let TUX_SIXEL; (async () => {
|
||||
const resp = await fetch('./static/tux.sixel');
|
||||
const text = await resp.text();
|
||||
TUX_SIXEL = text;
|
||||
})();
|
||||
|
||||
puter.ui.on('connection', event => {
|
||||
const { conn, accept, reject } = event;
|
||||
@@ -131,6 +136,7 @@ puter.ui.on('connection', event => {
|
||||
accept({
|
||||
version: '1.0.0',
|
||||
status,
|
||||
logo: TUX_SIXEL,
|
||||
});
|
||||
console.log('emulator got connection event', event);
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
P0;0;0q"1;1;80;80#0;2;0;0;0#1;2;0;0;0#2;2;1;1;2#3;2;2;2;2#4;2;4;4;4#5;2;5;5;5#6;2;7;5;2#7;2;9;7;2#8;2;7;7;7#9;2;9;9;9#10;2;10;10;10#11;2;12;12;12#12;2;15;10;4#13;2;15;12;4#14;2;18;13;2#15;2;20;13;2#16;2;21;15;2#17;2;24;16;2#18;2;13;13;13#19;2;15;15;15#20;2;16;16;16#21;2;18;18;18#22;2;20;20;20#23;2;21;21;21#24;2;23;23;23#25;2;24;24;24#26;2;27;18;2#27;2;29;21;5#28;2;31;21;3#29;2;36;24;2#30;2;32;24;13#31;2;34;26;12#32;2;37;27;12#33;2;38;27;2#34;2;41;27;2#35;2;38;31;4#36;2;40;31;4#37;2;49;31;2#38;2;45;32;3#39;2;47;36;3#40;2;47;34;10#41;2;34;26;13#42;2;39;32;20#43;2;42;34;23#44;2;46;38;18#45;2;26;26;26#46;2;27;27;27#47;2;29;29;29#48;2;31;31;31#49;2;35;32;26#50;2;37;34;26#51;2;37;34;30#52;2;32;32;32#53;2;34;34;34#54;2;35;35;35#55;2;37;37;37#56;2;48;40;27#57;2;44;39;31#58;2;40;38;35#59;2;43;42;37#60;2;49;44;35#61;2;40;40;40#62;2;42;42;42#63;2;43;43;43#64;2;45;45;45#65;2;48;48;48#66;2;51;33;2#67;2;53;34;2#68;2;54;34;2#69;2;54;36;2#70;2;55;40;6#71;2;60;39;2#72;2;61;42;4#73;2;60;45;4#74;2;61;46;4#75;2;64;43;3#76;2;65;45;3#77;2;69;46;2#78;2;66;48;4#79;2;71;48;3#80;2;51;38;18#81;2;56;43;18#82;2;62;46;14#83;2;60;48;18#84;2;54;43;20#85;2;60;47;24#86;2;66;49;17#87;2;56;48;28#88;2;73;52;4#89;2;72;56;5#90;2;75;57;5#91;2;71;52;14#92;2;75;56;13#93;2;71;56;17#94;2;75;59;18#95;2;68;53;20#96;2;69;57;24#97;2;75;52;4#98;2;77;54;4#99;2;78;56;4#100;2;81;57;4#101;2;78;61;4#102;2;82;59;4#103;2;84;60;4#104;2;85;62;4#105;2;82;64;4#106;2;82;65;4#107;2;86;64;4#108;2;84;68;6#109;2;80;65;7#110;2;88;65;4#111;2;89;67;4#112;2;90;68;4#113;2;88;69;6#114;2;92;68;5#115;2;93;70;5#116;2;94;71;5#117;2;89;72;5#118;2;93;73;4#119;2;92;75;4#120;2;93;75;4#121;2;95;73;5#122;2;96;73;5#123;2;96;75;5#124;2;79;59;13#125;2;81;64;16#126;2;84;67;21#127;2;84;65;23#128;2;88;70;24#129;2;89;72;24#130;2;93;79;6#131;2;95;77;5#132;2;91;76;6#133;2;91;78;12#134;2;95;82;7#135;2;96;84;8#136;2;96;81;18#137;2;96;85;15#138;2;96;84;17#139;2;96;84;21#140;2;96;85;24#141;2;60;56;35#142;2;64;52;26#143;2;64;57;37#144;2;56;53;42#145;2;71;62;42#146;2;68;60;45#147;2;74;64;45#148;2;79;64;27#149;2;96;85;29#150;2;93;80;36#151;2;50;50;50#152;2;53;53;53#153;2;54;54;54#154;2;56;56;56#155;2;58;58;58#156;2;60;60;60#157;2;62;62;62#158;2;70;65;57#159;2;75;70;56#160;2;64;64;64#161;2;65;65;65#162;2;67;67;67#163;2;68;68;68#164;2;70;70;70#165;2;71;71;71#166;2;73;73;73#167;2;75;75;75#168;2;85;76;53#169;2;83;81;73#170;2;96;90;75#171;2;76;76;76#172;2;78;78;78#173;2;79;79;79#174;2;81;81;81#175;2;82;82;82#176;2;84;84;84#177;2;85;85;85#178;2;87;87;87#179;2;89;89;89#180;2;91;91;91#181;2;92;92;92#182;2;93;93;93#183;2;95;95;95#184;2;96;96;96#185;2;98;98;98#186;2;99;99;99#0!29~^NFB@@@!8?@@@BBFN^!28~$#3!29?_??CA?O@@???@@@O?a?CGO_$#4!30?OG??A???@@@!4?A?C#9??_$!30?_?G???A??G#47?C#8?A??C??O$#10!31?O??C??A??G?A??C?G$#22!31?_O#5C?A!8?A???G$#48!32?_!5?CCC!7?_$#20!33?G?C!8?C#46G?_$#18!33?_!5?A?G#21!4?G??_$#52!33?O#45G?GC!4?CG???O$#2!34?__!8o__$#24!34?O#53G!8?G?O$#23!36?C!5?GC?O$#19!37?GG!9?O$#11!38?A?AA-#0!27~F#5C?_#2w}!10~__oop}wo#52G#9C#0BN!25~$#4!27?_A??C#10@#5!10?@!9?G$#3!27?W@#20C@#24A#10!11?I???C!5?_$#11!28?OAO#52@#4!11?OO??I!4?A$#9!28?G#25GG#11!12?C#23G!6?c#22O$#19!28?_#53_C#21!13?@?A#20?@?@#45?_$#8!29?@#45A#55!13?CC#3@??C??@Co$#48!29?O#53!14?A#19G!6?G$#18!45?@!4?GA$#61!45?A#8G!4?@?O$#24!46?C??A#46A$#48!49?@CO-#0!27~#5~???G!6?_?C???@?G!7?E#0F!24~$#20!28?@#53]!4?_!6?C#8A!8?@??G$#21!28?}#52`#2~F@??@@^^FBB@???@r~~~{#52@#20A$#23!31?O#3AB??A??G??_@???K!7?w$#62!31?_#19C#64C?G#65_!6?O#54_#22A!7?G$#152!32?G#171OG#18A!7?A!9?@$#162!32?_#10_#4@?G_!6?A@!5?A??@$#177!32?O#172G#9ACC!9?A!7?o$#179!34?O_#24O#11??O#175O?G#46_!8?o#21C$#55!34?C#184O#21???_#58G#166G#153C#160C#156C#19C#10C#53!5?M#24o$#180!40?_#167_#163O#177G#176G#152G#47O$#186!41?O#178??O#181O#157_$#182!45?_-#0!27~#4{???G#62@!8?B#12C#5@#117_O#20G!7?_#4O#0!24~$#5!27?B??]#2O?A!8?BEA??\!4~#10_?C#5_$#19!28?K!9?@#89C???G??_#3a!7?N$#18!28?o#52_#3@??@#46@!9?C!7?C#25B#9B$#20!28?B#53X#11_#64@???A#118OC#134o??G?OO#171AA#47!5?BG#11G$#54!29?C#17?_#151A???@#132OG???G#21?@#167@#40O#22!5?W#45C#18O$#55!29?A#24?C#40O#97OG#113G??C#23@#108C!4?_#153C#52!6?O$#61!31?A#79_#10C#8A??@#35?A#137_O#168??G#169G#172@#55!6?_$#171!32?G#100_#16C#116oG#39AA#133G#136G#135_o_#184?C$#175!32?C#147G#107O#73C#119_G#139?O#140O#96C$#112!34?_#155@#44A#130_#149?_#160A$#111!36?C#178???@-#0!26~N#18_C#48F#2_#9A#97@!6?O?C#102CA?A#36A#5G??A!7?_$#3!26?O!4?k#32C#167O_!7?_#103C#104A@#58C#2F\p`bew_#8@CO$#4!26?_N???O#69A#146GO!5?_#166_?O#124C#186__#45O#3a???P???@CO$#8!27?O#22O?L#34@#151G#70C#90C!4?C#100GG#88A#147G#171G#145C#74@#165_#23?A!4?@#11AG#0BN!21~$#47!28?__#10O#153?O#104@#72GO?__#86_#79O#92O#159O#175_#173O#172G#163G#9??G??GC#4O?AG$#11!28?B#53G#21A#154?_#105A#115@#78G!4?C#109A#184??_#178O#176O#48??C#22O!5?O#18_$#19!28?G#61O#172???_#116A#117C#101G!6?@#64!6?KG#54?@CO$#118!35?@#98O?W???G#25!8?O?A?_$#120!35?A#132@C#135AA@@#24!9?C#47??I?_$#158!35?_#85_#99O?G!4?@#21!10?C$#130!36?A#134B??A?@#46!12?G$#133!36?C#89G#108C#138@$#139!38?@-#0!21~^NB@#8AO??J#185_C!4?O!5?A!5?_#5A!5?@!4?C#4GO$#3!21?_?CA??G?CA#165A#181@#184A?G??Line truncated
|
||||
@@ -15,7 +15,8 @@ module.exports = {
|
||||
}),
|
||||
new CopyPlugin({
|
||||
patterns: [
|
||||
{ from: 'benchmark', to: 'static' }
|
||||
{ from: 'benchmark', to: 'static' },
|
||||
{ from: 'tux.sixel', to: 'static' },
|
||||
]
|
||||
})
|
||||
]
|
||||
|
||||
@@ -40,6 +40,7 @@ export class EmuCommandProvider {
|
||||
let prev_phase = 'init';
|
||||
let progress_shown = false;
|
||||
let tux_enabled = false;
|
||||
const leftpadd = 10;
|
||||
const on_message = message => {
|
||||
if ( message.$ !== 'status' ) {
|
||||
console.log('[!!] message from the emulator', message);
|
||||
@@ -53,21 +54,22 @@ export class EmuCommandProvider {
|
||||
if ( message.phase === 'ready' ) {
|
||||
if ( progress_shown ) {
|
||||
// show complete progress so it doesn't look weird
|
||||
ctx.externs.out.write('\r[' + '='.repeat(ctx.env.COLS-2) + ']\n');
|
||||
ctx.externs.out.write(`\r\x1B[${leftpadd}C[` +
|
||||
'='.repeat(ctx.env.COLS-2-leftpadd) + ']\n');
|
||||
}
|
||||
p_ready.resolve();
|
||||
return;
|
||||
}
|
||||
if ( message.phase !== prev_phase ) {
|
||||
progress_shown = false;
|
||||
ctx.externs.out.write(`phase: ${message.phase}\n`);
|
||||
ctx.externs.out.write(`\r\x1B[${leftpadd}Cphase: ${message.phase}\n`);
|
||||
prev_phase = message.phase;
|
||||
}
|
||||
if ( message.phase_progress ) {
|
||||
progress_shown = true;
|
||||
let w = ctx.env.COLS;
|
||||
w -= 2;
|
||||
ctx.externs.out.write('\r[');
|
||||
w -= 2 + leftpadd;
|
||||
ctx.externs.out.write(`\r\x1B[${leftpadd}C[`);
|
||||
const done = Math.floor(message.phase_progress * w);
|
||||
for ( let i=0 ; i < done ; i++ ) {
|
||||
ctx.externs.out.write('=');
|
||||
@@ -83,9 +85,12 @@ export class EmuCommandProvider {
|
||||
if ( conn.response.status.ready ) {
|
||||
p_ready.resolve();
|
||||
} else {
|
||||
tux_enabled = true;
|
||||
conn.response.status.$ = 'status';
|
||||
ctx.externs.out.write('\x1B[36;1mWaiting for emulator to be ready...\x1B[0m\n');
|
||||
ctx.externs.out.write(' Puter Linux is starting...\n');
|
||||
ctx.externs.out.write(' (Alpine Linux edge i686)\n');
|
||||
ctx.externs.out.write('\x1B[2A');
|
||||
ctx.externs.out.write(conn.response.logo + '\n');
|
||||
ctx.externs.out.write('\x1B[2A');
|
||||
on_message(conn.response.status);
|
||||
}
|
||||
console.log('status from emu', conn.response);
|
||||
|
||||
@@ -19,7 +19,8 @@
|
||||
"rollup-plugin-copy": "^3.4.0"
|
||||
},
|
||||
"dependencies": {
|
||||
"@xterm/xterm": "^5.5.0",
|
||||
"@xterm/addon-fit": "^0.10.0"
|
||||
"@xterm/addon-fit": "^0.10.0",
|
||||
"@xterm/addon-image": "^0.8.0",
|
||||
"@xterm/xterm": "^5.5.0"
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@
|
||||
*/
|
||||
import { Terminal } from '@xterm/xterm';
|
||||
import { FitAddon } from '@xterm/addon-fit';
|
||||
import { ImageAddon } from '@xterm/addon-image';
|
||||
import { PTY } from './pty/PTY';
|
||||
import { XDocumentANSIShell } from './pty/XDocumentANSIShell';
|
||||
|
||||
@@ -98,6 +99,8 @@ window.main_term = async () => {
|
||||
const term = new Terminal({
|
||||
linkHandler,
|
||||
});
|
||||
const imageAddon = new ImageAddon();
|
||||
term.loadAddon(imageAddon);
|
||||
term.open(document.getElementById('terminal'));
|
||||
|
||||
const fitAddon = new FitAddon();
|
||||
|
||||
Reference in new issue
Block a user