mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-08-28 05:27:24 +00:00
Fixes
This commit is contained in:
parent
1f4d688d94
commit
e58a722416
1 changed files with 21 additions and 13 deletions
|
|
@ -20,20 +20,28 @@ async function showMacOSNotification(options: NotificationOptions): Promise<void
|
|||
}
|
||||
|
||||
async function showWindowsNotification(options: NotificationOptions): Promise<void> {
|
||||
const { title, message } = options
|
||||
const duration = 6 // seconds
|
||||
const { subtitle, message } = options
|
||||
|
||||
const script = `
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
$balloon = New-Object System.Windows.Forms.NotifyIcon
|
||||
$balloon.BalloonTipIcon = [System.Windows.Forms.ToolTipIcon]::Info
|
||||
$balloon.BalloonTipTitle = '${title}'
|
||||
$balloon.BalloonTipText = '${message}'
|
||||
$balloon.Visible = $true
|
||||
$balloon.ShowBalloonTip(${duration * 1000})
|
||||
Start-Sleep -Seconds ${duration}
|
||||
$balloon.Visible = $false
|
||||
$balloon.Dispose()
|
||||
`
|
||||
[Windows.UI.Notifications.ToastNotificationManager, Windows.UI.Notifications, ContentType = WindowsRuntime] | Out-Null
|
||||
[Windows.Data.Xml.Dom.XmlDocument, Windows.Data.Xml.Dom.XmlDocument, ContentType = WindowsRuntime] | Out-Null
|
||||
|
||||
$template = @"
|
||||
<toast>
|
||||
<visual>
|
||||
<binding template="ToastText02">
|
||||
<text id="1">${subtitle}</text>
|
||||
<text id="2">${message}</text>
|
||||
</binding>
|
||||
</visual>
|
||||
</toast>
|
||||
"@
|
||||
|
||||
$xml = New-Object Windows.Data.Xml.Dom.XmlDocument
|
||||
$xml.LoadXml($template)
|
||||
$toast = [Windows.UI.Notifications.ToastNotification]::new($xml)
|
||||
[Windows.UI.Notifications.ToastNotificationManager]::CreateToastNotifier("Cline").Show($toast)
|
||||
`
|
||||
|
||||
try {
|
||||
await execa("powershell", ["-Command", script])
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue