style(web-client): run prettier

This commit is contained in:
Benoît CORTIER
2023-11-04 02:26:46 -04:00
committed by Benoît Cortier
parent dff3f307eb
commit d4ea558da0
52 changed files with 1346 additions and 1302 deletions
+13 -13
View File
@@ -12,30 +12,30 @@
root: true
plugins:
- "@typescript-eslint"
- '@typescript-eslint'
extends:
- "eslint:recommended"
- "plugin:@typescript-eslint/recommended"
- "plugin:svelte/prettier" # Turns off rules that may conflict with Prettier
- "plugin:prettier/recommended"
- 'eslint:recommended'
- 'plugin:@typescript-eslint/recommended'
- 'plugin:svelte/prettier' # Turns off rules that may conflict with Prettier
- 'plugin:prettier/recommended'
parser: "@typescript-eslint/parser"
parser: '@typescript-eslint/parser'
parserOptions:
project: ./tsconfig.json
sourceType: module
ecmaVersion: 2020
extraFileExtensions:
- ".svelte"
- '.svelte'
ignorePatterns:
- "*.cjs"
- '*.cjs'
overrides:
- files: "*.svelte"
- files: '*.svelte'
parser: svelte-eslint-parser
parserOptions:
parser: "@typescript-eslint/parser"
parser: '@typescript-eslint/parser'
env:
browser: true
@@ -44,10 +44,10 @@ env:
rules:
strict: 2
"@typescript-eslint/no-unused-vars":
- "error"
'@typescript-eslint/no-unused-vars':
- 'error'
- argsIgnorePattern: '^_'
"@typescript-eslint/strict-boolean-expressions":
'@typescript-eslint/strict-boolean-expressions':
- 2
- allowString: false
allowNumber: false
+8 -9
View File
@@ -15,7 +15,7 @@ Run `npm run build`
As member of the Devolutions organization, you can import the Web Component from JFrog Artifactory by running the following npm command:
```shell
$ npm install @devolutions/iron-remote-gui
$ npm install @devolutions/iron-remote-gui
```
Otherwise, you can run `npm install` targeting the `dist/` folder directly.
@@ -33,10 +33,10 @@ Call the `connect` method on this object.
For now, we didn't make the enums used by some method directly available (I didn't find the good way to export them directly with the component.).
You need to recreate them on your application for now (it will be improved in future version);
Also, even if the connection to RDP work there is still a lot of improvement to do.
Also, even if the connection to RDP work there is still a lot of improvement to do.
As of now, you can expect, mouse movement and click (4 buttons) - no scroll, Keyboard for at least the standard.
Windows and CTRL+ALT+DEL can be called by method on `UserInteractionService`.
Lock keys (like caps lock), have a partial support.
Windows and CTRL+ALT+DEL can be called by method on `UserInteractionService`.
Lock keys (like caps lock), have a partial support.
Other advanced functionalities (sharing / copy past...) are not implemented yet.
## Component parameters
@@ -59,19 +59,18 @@ You can add some parameters for default initialization on the component `<iron-r
> `authtoken` is the authentication token to send to the Devolutions Gateway.
> `ctrlAltDel()`
>
>
> Sends the ctrl+alt+del key to server.
> `metaKey()`
>
>
> Sends the meta key event to remote host (i.e.: Windows key).
> `setVisibility(value: bool)`
>
>
> Shows or hides rendering canvas.
> `setScale(scale: ScreenScale)`
>
>
> Sets the scale behavior of the canvas.
> See the [ScreenScale](./src/services/user-interaction-service.ts) enum for possible values.
+4 -4
View File
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
@@ -7,12 +7,12 @@
</head>
<body>
<script type="module" src="/src/main.ts"></script>
<iron-remote-gui isvisible="false" desktopwidth="600" desktopheight="400"/>
<iron-remote-gui isvisible="false" desktopwidth="600" desktopheight="400" />
<script>
var el = document.querySelector('iron-remote-gui');
el.addEventListener('ready', (e) => {
console.log("WebComponent Loaded");
console.log('WebComponent Loaded');
e.detail.irgUserInteraction.setVisibility(true);
});
</script>
-3
View File
@@ -16,14 +16,11 @@
"build-alone": "vite build",
"pre-build": "node ./pre-build.js",
"preview": "vite preview",
"check": "svelte-check --tsconfig ./tsconfig.json",
"check:watch": "svelte-check --tsconfig ./tsconfig.json --watch",
"lint": "npm run lint:prettier && npm run lint:eslint",
"lint:prettier": "prettier . --check",
"lint:eslint": "eslint src/**",
"format": "prettier . --write ."
},
"devDependencies": {
+5 -5
View File
@@ -1,8 +1,8 @@
import {spawn} from "child_process";
import { spawn } from 'child_process';
let run = async function (command, cwd) {
return new Promise(resolve => {
const buildCommand = spawn(command, {stdio: "pipe", shell: true, cwd: cwd});
return new Promise((resolve) => {
const buildCommand = spawn(command, { stdio: 'pipe', shell: true, cwd: cwd });
buildCommand.stdout.on('data', (data) => {
console.log(`${data}`);
@@ -16,7 +16,7 @@ let run = async function (command, cwd) {
console.log(`child process exited with code ${code}`);
resolve();
});
})
}
});
};
await run('wasm-pack build --target web', '../../crates/ironrdp-web');
+15 -15
View File
@@ -1,19 +1,19 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Test</title>
</head>
<body>
<script type="module" src="./iron-remote-gui.js"></script>
<iron-remote-gui isvisible="false" desktopwidth="600" desktopheight="400"/>
</head>
<body>
<script type="module" src="./iron-remote-gui.js"></script>
<iron-remote-gui isvisible="false" desktopwidth="600" desktopheight="400" />
<script>
var el = document.querySelector('iron-remote-gui');
el.addEventListener('ready', (e) => {
<script>
var el = document.querySelector('iron-remote-gui');
el.addEventListener('ready', (e) => {
e.detail.irgUserInteraction.setVisibility(true);
});
</script>
</body>
</html>
});
</script>
</body>
</html>
@@ -1,10 +1,10 @@
export enum LockKey {
CAPS_LOCK = "CapsLock",
NUM_LOCK = "NumLock",
SCROLL_LOCK = "ScrollLock",
KANA_MODE = "KanaMode",
"CapsLock" = CAPS_LOCK,
"ScrollLock" = SCROLL_LOCK,
"NumLock" = NUM_LOCK,
"KanaMode" = KANA_MODE
}
CAPS_LOCK = 'CapsLock',
NUM_LOCK = 'NumLock',
SCROLL_LOCK = 'ScrollLock',
KANA_MODE = 'KanaMode',
'CapsLock' = CAPS_LOCK,
'ScrollLock' = SCROLL_LOCK,
'NumLock' = NUM_LOCK,
'KanaMode' = KANA_MODE,
}
@@ -1,8 +1,8 @@
export enum LogType {
OFF = "OFF",
ERROR = "ERROR",
WARN = "WARN",
INFO = "INFO",
DEBUG = "DEBUG",
TRACE = "TRACE"
}
OFF = 'OFF',
ERROR = 'ERROR',
WARN = 'WARN',
INFO = 'INFO',
DEBUG = 'DEBUG',
TRACE = 'TRACE',
}
@@ -1,14 +1,14 @@
export enum ModifierKey {
CTRL_LEFT = "ControlLeft",
SHIFT_LEFT = "ShiftLeft",
SHIFT_RIGHT = "ShiftRight",
ALT_LEFT = "AltLeft",
CTRL_RIGHT = "ControlRight",
ALT_RIGHT = "AltRight",
"ControlLeft" = CTRL_LEFT,
"ShiftLeft" = SHIFT_LEFT,
"ShiftRight" = SHIFT_RIGHT,
"AltLeft" = ALT_LEFT,
"ControlRight" = CTRL_RIGHT,
"AltRight" = ALT_RIGHT,
}
CTRL_LEFT = 'ControlLeft',
SHIFT_LEFT = 'ShiftLeft',
SHIFT_RIGHT = 'ShiftRight',
ALT_LEFT = 'AltLeft',
CTRL_RIGHT = 'ControlRight',
ALT_RIGHT = 'AltRight',
'ControlLeft' = CTRL_LEFT,
'ShiftLeft' = SHIFT_LEFT,
'ShiftRight' = SHIFT_RIGHT,
'AltLeft' = ALT_LEFT,
'ControlRight' = CTRL_RIGHT,
'AltRight' = ALT_RIGHT,
}
@@ -3,5 +3,5 @@
MIDDLE = 1,
RIGHT = 2,
BROWSER_BACK = 3,
BROWSER_FORWARD = 4
BROWSER_FORWARD = 4,
}
@@ -1,4 +1,4 @@
export enum MouseButtonState {
MOUSE_DOWN,
MOUSE_UP
MOUSE_UP,
}
+2 -2
View File
@@ -1,5 +1,5 @@
export enum OS {
WINDOWS = 'windows',
LINUX = 'linux',
ANDROID = 'android'
}
ANDROID = 'android',
}
@@ -1,5 +1,5 @@
export enum ScreenScale {
Fit = 1,
Full = 2,
Real = 3
Real = 3,
}
@@ -1,5 +1,5 @@
export enum SessionEventType {
STARTED,
TERMINATED,
ERROR
ERROR,
}
@@ -1,4 +1,4 @@
export enum SpecialCombination {
CTRL_ALT_DEL,
META
META,
}
@@ -1,4 +1,4 @@
export interface DesktopSize {
width: number,
height: number
width: number;
height: number;
}
@@ -1,7 +1,7 @@
import type {DesktopSize} from './DesktopSize';
import type { DesktopSize } from './DesktopSize';
export interface NewSessionInfo {
session_id: number,
websocket_port: number,
initial_desktop_size: DesktopSize,
session_id: number;
websocket_port: number;
initial_desktop_size: DesktopSize;
}
@@ -1,6 +1,6 @@
import type {DesktopSize} from './DesktopSize';
import type { DesktopSize } from './DesktopSize';
export interface ResizeEvent {
session_id: number,
desktop_size: DesktopSize,
session_id: number;
desktop_size: DesktopSize;
}
@@ -1,20 +1,29 @@
import type {ScreenScale} from '../enums/ScreenScale';
import type {Observable} from 'rxjs';
import type {NewSessionInfo} from './NewSessionInfo';
import type {SessionEvent} from './session-event';
import type {DesktopSize} from './DesktopSize';
import type { ScreenScale } from '../enums/ScreenScale';
import type { Observable } from 'rxjs';
import type { NewSessionInfo } from './NewSessionInfo';
import type { SessionEvent } from './session-event';
import type { DesktopSize } from './DesktopSize';
export interface UserInteraction {
setVisibility(state: boolean): void;
setScale(scale: ScreenScale): void;
connect(username: string, password: string, destination: string, proxyAddress: string, serverDomain: string, authToken: string, desktopSize?: DesktopSize, preConnectionBlob?: string): Observable<NewSessionInfo>;
connect(
username: string,
password: string,
destination: string,
proxyAddress: string,
serverDomain: string,
authToken: string,
desktopSize?: DesktopSize,
preConnectionBlob?: string,
): Observable<NewSessionInfo>;
ctrlAltDel(): void;
metaKey(): void;
shutdown(): void;
sessionListener: Observable<SessionEvent>;
@@ -1,7 +1,7 @@
import type {SessionEventType} from '../enums/SessionEventType';
import type { SessionEventType } from '../enums/SessionEventType';
import type { IronRdpError } from '../../../../crates/ironrdp-web/pkg/ironrdp_web';
export interface SessionEvent {
type: SessionEventType,
data?: IronRdpError | string
type: SessionEventType;
data?: IronRdpError | string;
}

Some files were not shown because too many files have changed in this diff Show More