A few renames and minor cleanups
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1,6 +1,6 @@
|
|||||||
/*!
|
/*!
|
||||||
* Bootstrap v5.3.2 (https://getbootstrap.com/)
|
* Bootstrap v5.3.7 (https://getbootstrap.com/)
|
||||||
* Copyright 2011-2023 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
* Copyright 2011-2025 The Bootstrap Authors (https://github.com/twbs/bootstrap/graphs/contributors)
|
||||||
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -26,7 +26,7 @@ bootstrap
|
|||||||
MIT
|
MIT
|
||||||
The MIT License (MIT)
|
The MIT License (MIT)
|
||||||
|
|
||||||
Copyright (c) 2011-2023 The Bootstrap Authors
|
Copyright (c) 2011-2025 The Bootstrap Authors
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
@@ -278,28 +278,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|||||||
|
|
||||||
jsx-runtime
|
jsx-runtime
|
||||||
MIT
|
MIT
|
||||||
The MIT License (MIT)
|
|
||||||
|
|
||||||
Copyright (c) 2015-present Jason Miller
|
|
||||||
|
|
||||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
of this software and associated documentation files (the "Software"), to deal
|
|
||||||
in the Software without restriction, including without limitation the rights
|
|
||||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
||||||
copies of the Software, and to permit persons to whom the Software is
|
|
||||||
furnished to do so, subject to the following conditions:
|
|
||||||
|
|
||||||
The above copyright notice and this permission notice shall be included in all
|
|
||||||
copies or substantial portions of the Software.
|
|
||||||
|
|
||||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
||||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
||||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
||||||
SOFTWARE.
|
|
||||||
|
|
||||||
|
|
||||||
preact
|
preact
|
||||||
MIT
|
MIT
|
||||||
|
|||||||
1311
js/package-lock.json
generated
1311
js/package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,6 @@
|
|||||||
import { ConnectionFactory } from "./websocket";
|
import { ConnectionFactory } from "./websocket";
|
||||||
import { Terminal, WebTTY, protocols } from "./webtty";
|
import { Terminal, WebTTY, protocols } from "./webtty";
|
||||||
import { OurXterm } from "./xterm";
|
import { GoTTYXterm } from "./xterm";
|
||||||
|
|
||||||
// @TODO remove these
|
// @TODO remove these
|
||||||
declare var gotty_auth_token: string;
|
declare var gotty_auth_token: string;
|
||||||
@@ -11,7 +11,7 @@ const elem = document.getElementById("terminal")
|
|||||||
|
|
||||||
if (elem !== null) {
|
if (elem !== null) {
|
||||||
var term: Terminal;
|
var term: Terminal;
|
||||||
term = new OurXterm(elem);
|
term = new GoTTYXterm(elem);
|
||||||
|
|
||||||
const httpsEnabled = window.location.protocol == "https:";
|
const httpsEnabled = window.location.protocol == "https:";
|
||||||
const queryArgs = (gotty_ws_query_args === "") ? "" : "?" + gotty_ws_query_args;
|
const queryArgs = (gotty_ws_query_args === "") ? "" : "?" + gotty_ws_query_args;
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import { WebLinksAddon } from 'xterm-addon-web-links';
|
|||||||
import { WebglAddon } from 'xterm-addon-webgl';
|
import { WebglAddon } from 'xterm-addon-webgl';
|
||||||
import { ZModemAddon } from "./zmodem";
|
import { ZModemAddon } from "./zmodem";
|
||||||
|
|
||||||
export class OurXterm {
|
export class GoTTYXterm {
|
||||||
// The HTMLElement that contains our terminal
|
// The HTMLElement that contains our terminal
|
||||||
elem: HTMLElement;
|
elem: HTMLElement;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { Component, ComponentChildren, createRef, render } from "preact";
|
import { Component, ComponentChildren, createRef, render } from "preact";
|
||||||
import { ITerminalAddon, Terminal } from "xterm";
|
import { ITerminalAddon, Terminal } from "xterm";
|
||||||
import { Browser, Detection, Offer, Sentry, Session } from 'zmodem.js/src/zmodem_browser';
|
import { Browser, Detection, Offer, Sentry, Session } from "zmodem.js";
|
||||||
import { Button, MyModal } from "./MyModal";
|
import { Button, MyModal } from "./MyModal";
|
||||||
|
|
||||||
export class ZModemAddon implements ITerminalAddon {
|
export class ZModemAddon implements ITerminalAddon {
|
||||||
@@ -209,15 +209,17 @@ export class SendFileModal extends Component<SendFileModalProps, SendFileModalSt
|
|||||||
send() {
|
send() {
|
||||||
Browser.send_files(this.props.session,
|
Browser.send_files(this.props.session,
|
||||||
this.filePickerRef.current!.files, {
|
this.filePickerRef.current!.files, {
|
||||||
on_offer_response: (f, xfer) => { this.setState({ state: "started" }) },
|
on_offer_response: (f, xfer) => {
|
||||||
}).then(() => {
|
this.setState({ state: "started" })
|
||||||
this.setState({ state: "done" })
|
},
|
||||||
this.props.session.close()
|
}
|
||||||
|
).then(() => {
|
||||||
|
this.setState({ state: "done" });
|
||||||
|
this.props.session.close();
|
||||||
if (this.props.onFinish !== undefined) {
|
if (this.props.onFinish !== undefined) {
|
||||||
this.props.onFinish();
|
this.props.onFinish();
|
||||||
}
|
}
|
||||||
})
|
}).catch(e => console.log(e));
|
||||||
.catch(e => console.log(e));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
|
|||||||
48
js/typings/zmodem.d.ts
vendored
Normal file
48
js/typings/zmodem.d.ts
vendored
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
declare module 'zmodem.js' {
|
||||||
|
export function send(data: Buffer): Promise<void>;
|
||||||
|
export function receive(): Promise<Buffer>;
|
||||||
|
|
||||||
|
export interface SendFilesOptions {
|
||||||
|
on_offer_response?: (file: File, xfer: any) => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface SentryOptions {
|
||||||
|
to_terminal: (data: Uint8Array) => void;
|
||||||
|
on_detect: (detection: Detection) => void;
|
||||||
|
sender: (data: Uint8Array) => void;
|
||||||
|
on_retract: () => void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface FileDetails {
|
||||||
|
name: string;
|
||||||
|
size: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Browser {
|
||||||
|
static save_to_disk(payloads: any, filename: string): void;
|
||||||
|
static send_files(session: Session, files: FileList | null, options?: SendFilesOptions): Promise<void>;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Detection {
|
||||||
|
confirm(): Session;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Offer {
|
||||||
|
accept(): Promise<any>;
|
||||||
|
skip(): void;
|
||||||
|
get_details(): FileDetails;
|
||||||
|
get_offset(): number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Sentry {
|
||||||
|
constructor(options: SentryOptions);
|
||||||
|
consume(data: Uint8Array): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Session {
|
||||||
|
type: "send" | "receive";
|
||||||
|
on(event: string, callback: (...args: any[]) => void): void;
|
||||||
|
start(): void;
|
||||||
|
close(): void;
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user