Newest Commit - code same as last commit

This commit is contained in:
2026-02-06 17:32:49 +01:00
parent 7852a77a7c
commit ef09b642d6
64 changed files with 35 additions and 14 deletions

0
.gitignore vendored Normal file → Executable file
View File

0
.npmrc Normal file → Executable file
View File

0
.prettierignore Normal file → Executable file
View File

0
.prettierrc Normal file → Executable file
View File

0
README.md Normal file → Executable file
View File

0
e2e/demo.test.ts Normal file → Executable file
View File

0
eslint.config.js Normal file → Executable file
View File

0
package-lock.json generated Normal file → Executable file
View File

0
package.json Normal file → Executable file
View File

0
playwright.config.ts Normal file → Executable file
View File

0
pnpm-lock.yaml generated Normal file → Executable file
View File

0
src/app.css Normal file → Executable file
View File

0
src/app.d.ts vendored Normal file → Executable file
View File

0
src/app.html Normal file → Executable file
View File

0
src/demo.spec.ts Normal file → Executable file
View File

0
src/lib/assets/favicon.svg Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

0
src/lib/assets/fs/fs.json Normal file → Executable file
View File

0
src/lib/assets/fs/signature Normal file → Executable file
View File

0
src/lib/assets/quan.ttf Normal file → Executable file
View File

0
src/lib/index.ts Normal file → Executable file
View File

24
src/lib/stores/bash/bash.ts Normal file → Executable file
View File

@@ -65,6 +65,16 @@ export class Bash {
this.vfs = new VirtualFS({ fs: args.fs, user: args.user });
}
private _appendNewResult(inode: number, output: any, cmd: string) {
const data: PrintData = {
path: this.vfs.formatPath(this.vfs.getPathByInode(inode)),
output: output,
cmd: cmd
};
console.log(data);
this._terminal.PrintOutput(data);
}
updateHistory(input: string): void {
if ((this.user.history.length = 255)) {
this.user.history.unshift(...this.user.history.splice(-1));
@@ -107,14 +117,14 @@ export class Bash {
if (command.root) {
if (this.hasSudoPerms(this.user.uid)) {
let out: Result = command.method.call(this, args);
this.appendNewResult(this.getCwd(), out, this.user.history[0]);
this._appendNewResult(this.getCwd(), out, this.user.history[0]);
}
this.throwError(result);
}
let out: Result = command.method.call(this, args);
console.log(out);
this.appendNewResult(out.path, out.data?.data, this.user.history[0]);
this._appendNewResult(out.path, out.data?.data, this.user.history[0]);
}
throwError(result: Result): void {
@@ -134,16 +144,6 @@ export class Bash {
}
}
private appendNewResult(inode: number, output: any, cmd: string) {
const data: PrintData = {
path: this.vfs.formatPath(this.vfs.getPathByInode(inode)),
output: output,
cmd: cmd
};
console.log(data);
this._terminal.PrintOutput(data);
}
formatBytes(bytes: number, dPoint?: number, pow: 1024 | 1000 = 1024): string {
if (!+bytes) return '0';

0
src/lib/stores/bash/commands/cd.ts Normal file → Executable file
View File

0
src/lib/stores/bash/commands/ls.ts Normal file → Executable file
View File

0
src/lib/stores/bash/fs.ts Normal file → Executable file
View File

0
src/lib/stores/bash/sort.ts Normal file → Executable file
View File

0
src/lib/stores/bash/static.ts Normal file → Executable file
View File

0
src/lib/stores/char.ts Normal file → Executable file
View File

0
src/lib/stores/lang.ts Normal file → Executable file
View File

0
src/lib/stores/stack.ts Normal file → Executable file
View File

0
src/lib/stores/terminal/init.svelte.ts Normal file → Executable file
View File

0
src/lib/stores/terminal/stdio.ts Normal file → Executable file
View File

8
src/lib/stores/terminal/terminal.ts Normal file → Executable file
View File

@@ -110,6 +110,14 @@ export class Terminal {
return this.bash.getUser();
}
getTerminalWidth(): number {
const width = this.callbacks.getWidth?.();
if(!width) { throw new Error('somehow width is undefined still after all the checks'); }
console.log(width);
return width;
}
getCwd(): string {
const fs: VirtualFS = this.bash.getFs();
console.log(fs.getPathByInode(this.bash.getCwd()));

0
src/lib/stores/theme.ts Normal file → Executable file
View File

0
src/modules/Footer.svelte Normal file → Executable file
View File

0
src/modules/Loading.svelte Normal file → Executable file
View File

0
src/modules/Panel.svelte Normal file → Executable file
View File

0
src/modules/Settings.svelte Normal file → Executable file
View File

17
src/modules/Terminal.svelte Normal file → Executable file
View File

@@ -10,6 +10,16 @@
const printOutput = (e: HTMLElement, d: PrintData): void => print(e, d);
function getWidth() {
const e = document.getElementById('cout');
if(!e){
throw new Error('cant get width of the teminal element. Its null');
}
const padding: number = parseInt(window.getComputedStyle(e, null).getPropertyValue('padding').slice(0, -2));
console.log(padding);
return e.clientWidth - (padding * 2);
}
function updateTerminal() {
username = terminal!.getUser().username;
cwd = terminal!.getCwd();
@@ -47,7 +57,8 @@
}
}
let callbackInit = {
//Callback initializer
const callbackInit = {
print: (data: any) => {
const e = document.getElementById('outputWrapper');
if (!e) return;
@@ -56,6 +67,7 @@
getWidth: getWidth
};
//Test user with basic data so the bash can run
let testUser: User = {
username: 'kamil',
passwd: '123',
@@ -65,6 +77,7 @@
history: []
};
//Empty terminal variable where the terminal class instance will be stored
let terminal: Terminal;
let username: string = $state(testUser.username);
let cwd: string = $state(testUser.home);
@@ -82,7 +95,7 @@
</script>
<label for="input" onkeydowncapture={(e) => handleInput(e)}>
<div id="terminal" class="terminal-window shadow-() size-full resize rounded-md shadow-bg">
<div id="terminal" class="terminal-window shadow-() size-full rounded-md shadow-bg">
<div
class="terminal-bar flex h-9 w-full flex-row items-center rounded-t-md bg-bg-dark text-center font-terminal text-sm font-bold text-primary-dark light:bg-bg-dark-light light:text-primary-light"
>

0
src/modules/panel/LangModule.svelte Normal file → Executable file
View File

0
src/modules/panel/ProjectModule.svelte Normal file → Executable file
View File

0
src/modules/panel/SidebarButton.svelte Normal file → Executable file
View File

0
src/modules/terminal/Input.svelte Normal file → Executable file
View File

0
src/modules/terminal/Output.svelte Normal file → Executable file
View File

0
src/routes/+layout.svelte Normal file → Executable file
View File

0
src/routes/+page.svelte Normal file → Executable file
View File

0
src/routes/errors/404/+page.svelte Normal file → Executable file
View File

0
src/routes/page.svelte.spec.ts Normal file → Executable file
View File

0
src/routes/panel/+layout.svelte Normal file → Executable file
View File

0
src/routes/panel/+page.svelte Normal file → Executable file
View File

0
src/routes/panel/langs/+page.svelte Normal file → Executable file
View File

0
src/routes/panel/metrics/+page.svelte Normal file → Executable file
View File

0
src/routes/panel/projects/+page.svelte Normal file → Executable file
View File

0
src/routes/panel/stats/+page.svelte Normal file → Executable file
View File

0
src/routes/test/+page.svelte Normal file → Executable file
View File

0
src/style/animations.css Normal file → Executable file
View File

0
src/style/fonts.css Normal file → Executable file
View File

0
src/style/global.css Normal file → Executable file
View File

0
static/robots.txt Normal file → Executable file
View File

0
svelte-portfolio.code-workspace Normal file → Executable file
View File

0
svelte.config.js Normal file → Executable file
View File

0
tailwind.config.ts Normal file → Executable file
View File

0
tsconfig.json Normal file → Executable file
View File

0
vite.config.ts Normal file → Executable file
View File

0
vitest-setup-client.ts Normal file → Executable file
View File