mirror of
https://github.com/Eugeny/tabby.git
synced 2025-06-15 00:50:03 +00:00
profile settings
This commit is contained in:
parent
72287cc7cb
commit
85bcac1fb7
@ -0,0 +1,26 @@
|
||||
.modal-body
|
||||
.form-group
|
||||
label Name
|
||||
input.form-control(
|
||||
type='text',
|
||||
autofocus,
|
||||
[(ngModel)]='profile.name',
|
||||
)
|
||||
|
||||
.form-group
|
||||
label Command
|
||||
input.form-control(
|
||||
type='text',
|
||||
[(ngModel)]='profile.sessionOptions.command',
|
||||
)
|
||||
|
||||
.form-group
|
||||
label Working directory
|
||||
input.form-control(
|
||||
type='text',
|
||||
[(ngModel)]='profile.sessionOptions.cwd',
|
||||
)
|
||||
|
||||
.modal-footer
|
||||
button.btn.btn-outline-primary((click)='save()') Save
|
||||
button.btn.btn-outline-danger((click)='cancel()') Cancel
|
@ -0,0 +1,23 @@
|
||||
import { Component } from '@angular/core'
|
||||
import { NgbActiveModal } from '@ng-bootstrap/ng-bootstrap'
|
||||
import { Profile } from '../api'
|
||||
|
||||
@Component({
|
||||
template: require('./editProfileModal.component.pug'),
|
||||
})
|
||||
export class EditProfileModalComponent {
|
||||
profile: Profile
|
||||
|
||||
constructor (
|
||||
private modalInstance: NgbActiveModal,
|
||||
) {
|
||||
}
|
||||
|
||||
save () {
|
||||
this.modalInstance.close(this.profile)
|
||||
}
|
||||
|
||||
cancel () {
|
||||
this.modalInstance.dismiss()
|
||||
}
|
||||
}
|
@ -1,7 +1,7 @@
|
||||
h3 Saved Profiles
|
||||
|
||||
.list-group.mt-3.mb-3
|
||||
.list-group-item.list-item-group-action.d-flex.align-items-center(
|
||||
.list-group-item.list-group-item-action.d-flex.align-items-center(
|
||||
*ngFor='let profile of profiles',
|
||||
(click)='editProfile(profile)',
|
||||
)
|
||||
|
@ -1,6 +1,8 @@
|
||||
import { Component } from '@angular/core'
|
||||
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
|
||||
import { ConfigService } from 'terminus-core'
|
||||
import { Profile } from '../api'
|
||||
import { EditProfileModalComponent } from './editProfileModal.component'
|
||||
|
||||
@Component({
|
||||
template: require('./profilesSettingsTab.component.pug'),
|
||||
@ -10,11 +12,18 @@ export class ProfilesSettingsTabComponent {
|
||||
|
||||
constructor (
|
||||
private config: ConfigService,
|
||||
private ngbModal: NgbModal,
|
||||
) {
|
||||
this.profiles = config.store.terminal.profiles
|
||||
}
|
||||
|
||||
async ngOnInit () {
|
||||
editProfile (profile: Profile) {
|
||||
let modal = this.ngbModal.open(EditProfileModalComponent)
|
||||
modal.componentInstance.profile = Object.assign({}, profile)
|
||||
modal.result.then(result => {
|
||||
Object.assign(profile, result)
|
||||
this.config.save()
|
||||
})
|
||||
}
|
||||
|
||||
deleteProfile (profile: Profile) {
|
||||
|
@ -17,6 +17,7 @@ import { ProfilesSettingsTabComponent } from './components/profilesSettingsTab.c
|
||||
import { TerminalTabComponent } from './components/terminalTab.component'
|
||||
import { TerminalSettingsTabComponent } from './components/terminalSettingsTab.component'
|
||||
import { ColorPickerComponent } from './components/colorPicker.component'
|
||||
import { EditProfileModalComponent } from './components/editProfileModal.component'
|
||||
|
||||
import { SessionsService, BaseSession } from './services/sessions.service'
|
||||
import { TerminalFrontendService } from './services/terminalFrontend.service'
|
||||
@ -95,6 +96,7 @@ import { hterm } from './hterm'
|
||||
ShellSettingsTabComponent,
|
||||
ProfilesSettingsTabComponent,
|
||||
TerminalSettingsTabComponent,
|
||||
EditProfileModalComponent,
|
||||
],
|
||||
declarations: [
|
||||
ColorPickerComponent,
|
||||
@ -103,6 +105,7 @@ import { hterm } from './hterm'
|
||||
ShellSettingsTabComponent,
|
||||
ProfilesSettingsTabComponent,
|
||||
TerminalSettingsTabComponent,
|
||||
EditProfileModalComponent,
|
||||
],
|
||||
})
|
||||
export default class TerminalModule {
|
||||
|
Loading…
x
Reference in New Issue
Block a user