dropped slug

This commit is contained in:
Eugene Pankov
2020-03-01 17:02:49 +01:00
parent 566aa83fa9
commit e4b7693685
10 changed files with 19 additions and 32 deletions

View File

@@ -11,7 +11,7 @@ h3.mb-3 Shell
)
option(
*ngFor='let profile of profiles',
[ngValue]='slug(profile.name).toLowerCase()'
[ngValue]='slugify(profile.name).toLowerCase()'
) {{profile.name}}

View File

@@ -1,4 +1,4 @@
import slug from 'slug'
import slugify from 'slugify'
import { Component } from '@angular/core'
import { NgbModal } from '@ng-bootstrap/ng-bootstrap'
import { Subscription } from 'rxjs'
@@ -17,7 +17,7 @@ export class ShellSettingsTabComponent {
Platform = Platform
isConPTYAvailable: boolean
isConPTYStable: boolean
slug = slug
slugify = slugify
private configSubscription: Subscription
constructor (

View File

@@ -1,4 +1,4 @@
import slug from 'slug'
import slugify from 'slugify'
import { Injectable } from '@angular/core'
import { HotkeyDescription, HotkeyProvider } from 'terminus-core'
import { TerminalService } from './services/terminal.service'
@@ -78,7 +78,7 @@ export class TerminalHotkeyProvider extends HotkeyProvider {
return [
...this.hotkeys,
...profiles.map(profile => ({
id: `profile.${slug(profile.name).toLowerCase()}`,
id: `profile.${slugify(profile.name).toLowerCase()}`,
name: `New tab: ${profile.name}`,
})),
]

View File

@@ -1,5 +1,5 @@
import * as fs from 'mz/fs'
import slug from 'slug'
import slugify from 'slugify'
import { NgModule } from '@angular/core'
import { BrowserModule } from '@angular/platform-browser'
@@ -182,7 +182,7 @@ export default class TerminalModule { // eslint-disable-line @typescript-eslint/
}
if (hotkey.startsWith('profile.')) {
const profiles = await terminal.getProfiles()
const profile = profiles.find(x => slug(x.name).toLowerCase() === hotkey.split('.')[1])
const profile = profiles.find(x => slugify(x.name).toLowerCase() === hotkey.split('.')[1])
if (profile) {
terminal.openTabWithOptions(profile.sessionOptions)
}

View File

@@ -1,5 +1,5 @@
import * as fs from 'mz/fs'
import slug from 'slug'
import slugify from 'slugify'
import { Observable, AsyncSubject } from 'rxjs'
import { Injectable, Inject } from '@angular/core'
import { AppService, Logger, LogService, ConfigService, SplitTabComponent } from 'terminus-core'
@@ -54,7 +54,7 @@ export class TerminalService {
async openTab (profile?: Profile, cwd?: string|null, pause?: boolean): Promise<TerminalTabComponent> {
if (!profile) {
const profiles = await this.getProfiles(true)
profile = profiles.find(x => slug(x.name).toLowerCase() === this.config.store.terminal.profile) || profiles[0]
profile = profiles.find(x => slugify(x.name).toLowerCase() === this.config.store.terminal.profile) || profiles[0]
}
cwd = cwd || profile.sessionOptions.cwd

View File

@@ -1,5 +1,5 @@
import * as fs from 'mz/fs'
import slug from 'slug'
import slugify from 'slugify'
import { Injectable } from '@angular/core'
import { HostAppService, Platform } from 'terminus-core'
@@ -24,7 +24,7 @@ export class POSIXShellsProvider extends ShellProvider {
.map(x => x.trim())
.filter(x => x && !x.startsWith('#'))
.map(x => ({
id: slug(x),
id: slugify(x),
name: x.split('/')[2],
command: x,
args: ['-l'],

View File

@@ -1,5 +1,5 @@
import * as fs from 'mz/fs'
import slug from 'slug'
import slugify from 'slugify'
import { Injectable } from '@angular/core'
import { HostAppService, Platform, isWindowsBuild, WIN_BUILD_WSL_EXE_DISTRO_FLAG } from 'terminus-core'
@@ -90,7 +90,7 @@ export class WSLShellProvider extends ShellProvider {
}
const name = childKey.DistributionName.value
const shell: Shell = {
id: `wsl-${slug(name)}`,
id: `wsl-${slugify(name)}`,
name: `WSL / ${name}`,
command: wslPath,
args: ['-d', name],