feat: qwinsta/logoff buttons on events list and detail (0.20.4)
RDG flap actions were only on the dashboard; add shared composable and modal so operators can reset stuck sessions from События and event detail.
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
#Requires -Version 5.1
|
||||
<#
|
||||
.SYNOPSIS
|
||||
Удалённый sudo на SAC-сервере без интерактивного ввода.
|
||||
Пароль: Password из ssh-setup/local/kalinamall-sac.conf
|
||||
#>
|
||||
[CmdletBinding()]
|
||||
param(
|
||||
[string]$HostAlias = 'sac.kalinamall.ru',
|
||||
[Parameter(Mandatory = $true)]
|
||||
[string]$RemoteCommand,
|
||||
[string]$PasswordFile = (Join-Path $HOME 'Projects\Answer.and.other.shit\scripts\ssh-setup\local\kalinamall-sac.conf')
|
||||
)
|
||||
|
||||
Set-StrictMode -Version Latest
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
function Read-ConfigFile {
|
||||
param([string]$Path)
|
||||
$data = @{}
|
||||
if (-not (Test-Path -LiteralPath $Path)) { throw "Config not found: $Path" }
|
||||
Get-Content -LiteralPath $Path | ForEach-Object {
|
||||
if ($_ -match '^([^#=]+)=(.*)$') {
|
||||
$data[$Matches[1].Trim()] = $Matches[2].Trim()
|
||||
}
|
||||
}
|
||||
return $data
|
||||
}
|
||||
|
||||
$cfg = Read-ConfigFile -Path $PasswordFile
|
||||
$password = $cfg['Password']
|
||||
if (-not $password) {
|
||||
throw "Password not found in $PasswordFile"
|
||||
}
|
||||
|
||||
$inner = $RemoteCommand.Replace("'", "'\\''")
|
||||
$remote = "sudo -S -p '' bash -lc '$inner'"
|
||||
$password | & ssh -o BatchMode=yes -o ConnectTimeout=15 $HostAlias $remote
|
||||
Reference in New Issue
Block a user