feat(core/settings/serial/ssh/telnet): add clearServiceMessagesOnConnect option on connectable profile

This commit is contained in:
Clem 2023-08-14 15:24:41 +02:00
parent 21e38c8453
commit ef6b8a4eaa
6 changed files with 14 additions and 1 deletions

View File

@ -22,6 +22,7 @@ export interface Profile {
} }
export interface ConnectableProfile extends Profile { export interface ConnectableProfile extends Profile {
clearServiceMessagesOnConnect: boolean
} }
export type PartialProfile<T extends Profile> = Omit<Omit<Omit<{ export type PartialProfile<T extends Profile> = Omit<Omit<Omit<{

View File

@ -32,6 +32,7 @@ export class SerialProfilesService extends ConnectableProfileProvider<SerialProf
slowSend: false, slowSend: false,
input: { backspace: 'backspace' }, input: { backspace: 'backspace' },
}, },
clearServiceMessagesOnConnect: false,
} }
constructor ( constructor (

View File

@ -77,6 +77,12 @@
option(*ngIf='isConnectable()', ngValue='reconnect', translate) Reconnect option(*ngIf='isConnectable()', ngValue='reconnect', translate) Reconnect
option(ngValue='close', translate) Close option(ngValue='close', translate) Close
.form-line(*ngIf='isConnectable()')
.header
.title(translate) Clear terminal after connection
toggle(
[(ngModel)]='profile.clearServiceMessagesOnConnect',
)
.mb-4 .mb-4
.col-12.col-lg-8(*ngIf='this.profileProvider.settingsComponent') .col-12.col-lg-8(*ngIf='this.profileProvider.settingsComponent')

View File

@ -44,6 +44,7 @@ export class SSHProfilesService extends ConnectableProfileProvider<SSHProfile> {
reuseSession: true, reuseSession: true,
input: { backspace: 'backspace' }, input: { backspace: 'backspace' },
}, },
clearServiceMessagesOnConnect: true,
} }
constructor ( constructor (

View File

@ -21,6 +21,7 @@ export class TelnetProfilesService extends ConnectableProfileProvider<TelnetProf
scripts: [], scripts: [],
input: { backspace: 'backspace' }, input: { backspace: 'backspace' },
}, },
clearServiceMessagesOnConnect: false,
} }
constructor (private translate: TranslateService) { super() } constructor (private translate: TranslateService) { super() }

View File

@ -57,6 +57,9 @@ export abstract class ConnectableTerminalTabComponent<P extends ConnectableTermi
async initializeSession (): Promise<void> { async initializeSession (): Promise<void> {
this.reconnectOffered = false this.reconnectOffered = false
this.isDisconnectedByHand = false this.isDisconnectedByHand = false
if (this.profile.clearServiceMessagesOnConnect) {
this.frontend?.clear()
}
} }
/** /**