Update samy.ps1

This commit is contained in:
2025-12-01 04:41:13 -05:00
parent 1810543c10
commit d3d6d7e6f4

View File

@@ -9,7 +9,8 @@ Last changes made should fix the issues we had wen running thi in Windows 11 25H
Install-DattoRMM is the core helper that handles credential retrieval (webhook or direct), OAuth token management, Install-DattoRMM is the core helper that handles credential retrieval (webhook or direct), OAuth token management,
site list fetching/persistence, registry variable pushes, agent downloads/installs, and optional installer archiving. site list fetching/persistence, registry variable pushes, agent downloads/installs, and optional installer archiving.
The UI exposes all tasks as checkboxes with select-all helpers, and each action is wrapped in detailed logging plus The UI exposes all tasks as checkboxes with select-all helpers, and each action is wrapped in detailed logging plus
HTTP responders so callers can see success or failure. HTTP responders so callers can see success or failure.$jsContent = Get-RemoteText -Url $Script:SamyJsUrl
Key features: Key features:
- Credential retrieval - securely fetches ApiUrl, ApiKey, and ApiSecretKey from a webhook when requested. - Credential retrieval - securely fetches ApiUrl, ApiKey, and ApiSecretKey from a webhook when requested.
@@ -232,7 +233,13 @@ $ConfirmPreference = 'None'
$Script:SamyBranch = 'beta' # or 'main' $Script:SamyBranch = 'beta' # or 'main'
$Script:SamyRepoBase = 'https://git.svstools.ca/SVS_Public_Repo/SAMY/raw/branch' $Script:SamyRepoBase = 'https://git.svstools.ca/SVS_Public_Repo/SAMY/raw/branch'
$Script:SamyLogoUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SVS_logo.svg"
# Top-left corner logo (SVS)
$Script:SamyTopLogoUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SVS_logo.svg"
# Background SAMY image used in CSS
$Script:SamyBgLogoUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SAMY.png"
$Script:SamyFaviconUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SVS_Favicon.ico" $Script:SamyFaviconUrl = "$Script:SamyRepoBase/$Script:SamyBranch/SVS_Favicon.ico"
$Script:SamyCssUrl = "$Script:SamyRepoBase/$Script:SamyBranch/samy.css?raw=1" $Script:SamyCssUrl = "$Script:SamyRepoBase/$Script:SamyBranch/samy.css?raw=1"
$Script:SamyJsUrl = "$Script:SamyRepoBase/$Script:SamyBranch/samy.js?raw=1" $Script:SamyJsUrl = "$Script:SamyRepoBase/$Script:SamyBranch/samy.js?raw=1"
@@ -1052,12 +1059,11 @@ function Get-UIHtml {
$cssContent = Get-RemoteText -Url $Script:SamyCssUrl $cssContent = Get-RemoteText -Url $Script:SamyCssUrl
$jsContent = Get-RemoteText -Url $Script:SamyJsUrl $jsContent = Get-RemoteText -Url $Script:SamyJsUrl
# Make the CSS background-image follow $Script:SamyLogoUrl # Make the CSS background-image follow $Script:SamyBgLogoUrl
if ($cssContent) { if ($cssContent) {
$cssContent = $cssContent.Replace( $pattern = 'background-image:\s*url\("SAMY\.png"\);?' # matches with or without extra spaces/semicolon
'background-image: url("SAMY.png");', $replacement = "background-image: url('$Script:SamyBgLogoUrl');"
"background-image: url(`"$Script:SamyLogoUrl`");" $cssContent = [regex]::Replace($cssContent, $pattern, $replacement)
)
} }
@@ -1081,7 +1087,7 @@ $cssContent
<div class="logo-container"> <div class="logo-container">
<!-- SVS Logo (left) --> <!-- SVS Logo (left) -->
<div class="logo-left"> <div class="logo-left">
<img src="$Script:SamyLogoUrl" alt="SVS Logo"> <img src="$Script:SamyTopLogoUrl" alt="SVS Logo">
{{moduleVersion}} {{moduleVersion}}
</div> </div>