fix: firmware/installer Windows support (label, badge, install cmd)
This commit is contained in:
parent
fabc518bb8
commit
f7bbe3e4b1
@ -231,7 +231,9 @@ export default function Firmware() {
|
||||
<div>
|
||||
<div className="flex items-center gap-2">
|
||||
<Package className="w-4 h-4 text-orange-400" />
|
||||
<span className="text-white text-sm font-medium">{inst.platform === 'linux' ? 'Linux' : 'OPNsense / FreeBSD'}</span>
|
||||
<span className="text-white text-sm font-medium">
|
||||
{inst.platform === 'linux' ? 'Linux' : inst.platform === 'windows' ? 'Windows' : 'OPNsense / FreeBSD'}
|
||||
</span>
|
||||
</div>
|
||||
<div className="text-xs text-gray-500 mt-1">
|
||||
{inst.filename} — {formatSize(inst.size)} — {new Date(inst.uploaded_at).toLocaleString('de-DE')}
|
||||
@ -261,6 +263,23 @@ export default function Firmware() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{installerData?.installers?.some(i => i.platform === 'windows') && (
|
||||
<div className="mb-4 bg-gray-950 rounded p-3 relative">
|
||||
<div className="text-[10px] text-gray-500 mb-1">Installationsbefehl (Windows, als Admin in PowerShell):</div>
|
||||
<pre className="text-xs font-mono text-sky-300 whitespace-pre-wrap">{`[Net.ServicePointManager]::ServerCertificateValidationCallback={$true}; $wc=New-Object Net.WebClient; $wc.Headers["X-API-Key"]="YOUR_AGENT_KEY"; $wc.DownloadFile("${BACKEND_URL}/api/v1/installer/download?platform=windows","C:\\rmm-install.zip"); Expand-Archive -Path C:\\rmm-install.zip -DestinationPath C:\\rmm-install -Force; Set-ExecutionPolicy Bypass -Scope Process -Force; C:\\rmm-install\\install.ps1 -BackendURL "${BACKEND_URL}" -APIKey "YOUR_AGENT_KEY" -AgentName "PC-NAME"`}</pre>
|
||||
<button
|
||||
onClick={() => {
|
||||
copyToClipboard(`[Net.ServicePointManager]::ServerCertificateValidationCallback={$true}; $wc=New-Object Net.WebClient; $wc.Headers["X-API-Key"]="YOUR_AGENT_KEY"; $wc.DownloadFile("${BACKEND_URL}/api/v1/installer/download?platform=windows","C:\\rmm-install.zip"); Expand-Archive -Path C:\\rmm-install.zip -DestinationPath C:\\rmm-install -Force; Set-ExecutionPolicy Bypass -Scope Process -Force; C:\\rmm-install\\install.ps1 -BackendURL "${BACKEND_URL}" -APIKey "YOUR_AGENT_KEY" -AgentName "PC-NAME"`)
|
||||
setCopied(true)
|
||||
setTimeout(() => setCopied(false), 2000)
|
||||
}}
|
||||
className="absolute top-2 right-2 text-gray-600 hover:text-sky-400 transition-colors"
|
||||
>
|
||||
{copied ? <Check className="w-4 h-4 text-green-400" /> : <Copy className="w-4 h-4" />}
|
||||
</button>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Upload */}
|
||||
<div className="flex flex-wrap gap-3 items-end">
|
||||
<select
|
||||
@ -270,6 +289,7 @@ export default function Firmware() {
|
||||
>
|
||||
<option value="freebsd">OPNsense / FreeBSD</option>
|
||||
<option value="linux">Linux</option>
|
||||
<option value="windows">Windows</option>
|
||||
</select>
|
||||
<input
|
||||
type="file"
|
||||
@ -350,6 +370,13 @@ export default function Firmware() {
|
||||
const agentPlatform = agent.platform || 'freebsd'
|
||||
const fw = getFwForAgent(agent)
|
||||
const isLinux = agentPlatform === 'linux'
|
||||
const isWindows = agentPlatform === 'windows'
|
||||
const platformLabel = isWindows ? 'WIN' : isLinux ? 'LNX' : 'BSD'
|
||||
const platformColor = isWindows
|
||||
? 'text-sky-400 bg-sky-900/30'
|
||||
: isLinux
|
||||
? 'text-blue-400 bg-blue-900/30'
|
||||
: 'text-orange-400 bg-orange-900/30'
|
||||
return (
|
||||
<div key={agent.id} className="px-4 py-1.5 flex items-center gap-2.5 hover:bg-gray-800/30 border-b border-gray-800/30 last:border-0">
|
||||
<span className={`w-1.5 h-1.5 rounded-full flex-shrink-0 ${
|
||||
@ -357,10 +384,8 @@ export default function Firmware() {
|
||||
agent.status === 'stale' ? 'bg-yellow-400' : 'bg-gray-600'
|
||||
}`} />
|
||||
<span className="text-xs text-gray-300 flex-1 min-w-0 truncate">{agent.name}</span>
|
||||
<span className={`text-[10px] px-1 py-0.5 rounded flex-shrink-0 ${
|
||||
isLinux ? 'text-blue-400 bg-blue-900/30' : 'text-orange-400 bg-orange-900/30'
|
||||
}`}>
|
||||
{isLinux ? 'Linux' : 'BSD'}
|
||||
<span className={`text-[10px] px-1 py-0.5 rounded flex-shrink-0 ${platformColor}`}>
|
||||
{platformLabel}
|
||||
</span>
|
||||
<span className={`text-[10px] font-mono flex-shrink-0 ${outdated ? 'text-yellow-400' : 'text-gray-600'}`}>
|
||||
v{agent.agent_version || '—'}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user