init
BIN
Erstellen eines neuen Fensters.docx
Normal file
BIN
FS Admin Panel.exe
Normal file
61
GUIS/cleartmp.ps1
Normal file
@@ -0,0 +1,61 @@
|
||||
function Load_clrtmp {
|
||||
param ($root)
|
||||
[XML]$Form = @"
|
||||
<?xaml encoding="utf-8"?>
|
||||
<Window
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
|
||||
xmlns:winForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
|
||||
Name="Window" Title="Cleaner - Information" Height="440" Width="624" Icon="{Binding Icon}" ResizeMode="NoResize" WindowStyle="None">
|
||||
<Grid Background="#00344E">
|
||||
<TextBlock Name="text" Text="" HorizontalAlignment="Left" Margin="34,44,0,0" TextWrapping="Wrap" Foreground="White" Width="554" TextAlignment="Center" Height="360" VerticalAlignment="Top" FontSize="16"></TextBlock>
|
||||
<Button Name="btnok" Content="OK" HorizontalAlignment="Left" Margin="264,390,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Button.Style>
|
||||
<Style TargetType="Button">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="Red"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<Label Content="Information" HorizontalAlignment="Left" VerticalAlignment="Top" Width="624" HorizontalContentAlignment="Center" Foreground="White" FontSize="20" FontWeight="Bold"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
"@
|
||||
|
||||
# Lädt das Fenster
|
||||
$window=[Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $Form))
|
||||
$NR=(New-Object System.Xml.XmlNodeReader $Form)
|
||||
$window=[Windows.Markup.XamlReader]::Load($NR)
|
||||
|
||||
# Objekt - Variablen Verknüpfung
|
||||
|
||||
$text = $window.FindName("text")
|
||||
$Script:infook = $window.findName("btnok")
|
||||
|
||||
# Verknüpft feste Elemente
|
||||
$window.Title = $Script:Version
|
||||
$window.icon="$root/Source/Logo.png"
|
||||
$text.Text = "Der Speicherbedarf auf Gruppenlaufwerken, insbesondere aber auf persönlichen Home-Laufwerken steigt stetig. Daher muss jährlich ein hoher Betrag in die Erweiterung und die Erneuerung von Speichersystemen investiert werden.
|
||||
Gleichzeitig soll im BR die Zusammenarbeit durch das Teilen von Informationen, Dokumenten und Content verbessert werden. Persönliche und damit exklusive Inhalte und Daten sind dabei kontraproduktiv. Dies gilt vor allem für den produzierten Mediencontent.
|
||||
Mit diesem Werkzeug können Sie den zu löschenden oder zu verschiebenden Inhalt leichter identifizieren. `n`n$Script:Version `nCopyright Bayerischer Rundfunk (2022)`nAutor: Florian Späth `nDSGVO-konform"
|
||||
return $window
|
||||
}
|
||||
|
||||
$Script:info = Load_info $args[0] # Variable: $info
|
||||
|
||||
$info.Add_MouseLeftButtonDown({
|
||||
$info.DragMove()
|
||||
})
|
||||
|
||||
$infook.Add_Click({
|
||||
$info.Hide()
|
||||
})
|
||||
97
GUIS/confirm.ps1
Normal file
@@ -0,0 +1,97 @@
|
||||
function Load_confirm {
|
||||
param ($root)
|
||||
[XML]$Form = @"
|
||||
<?xaml encoding="utf-8"?>
|
||||
<Window
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Name="Window" Title="HDS Admin Panel - Confirm" Height="276" Width="509" Icon="{Binding Icon}" ResizeMode="NoResize" WindowStyle="None">
|
||||
<Grid Background="#00344E">
|
||||
<Button Name="btnstop" Content="BACK" HorizontalAlignment="Left" Margin="122,215,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="DarkGreen" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Button.Style>
|
||||
<Style TargetType="Button">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="Red"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<Label Content="Confirm" HorizontalAlignment="Left" VerticalAlignment="Top" Width="509" HorizontalContentAlignment="Center" Foreground="White" FontSize="20" FontWeight="Bold"/>
|
||||
<Label Name="choosen3" Content="Confirm the action and press the button again" HorizontalAlignment="Center" Margin="0,42,0,0" VerticalAlignment="Top" Width="270" Height="34" FontSize="12" FontWeight="Bold" Foreground="White"/>
|
||||
<TextBox Name="text" Text="TEXT" BorderThickness="0" HorizontalAlignment="Center" Height="113" TextWrapping="Wrap" VerticalAlignment="Center" Width="412" Background="#013C5A" HorizontalContentAlignment="Center" Foreground="White" FontSize="14" IsTabStop="False"/>
|
||||
<Button Name="btngo" Content="GO!" HorizontalAlignment="Left" Margin="286,215,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="DarkRed" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Button.Style>
|
||||
<Style TargetType="{x:Type Button}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="Red"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Window>
|
||||
"@
|
||||
|
||||
# Lädt das Fenster
|
||||
$window=[Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $Form))
|
||||
$NR=(New-Object System.Xml.XmlNodeReader $Form)
|
||||
$window=[Windows.Markup.XamlReader]::Load($NR)
|
||||
|
||||
# Objekt - Variablen Verknüpfung
|
||||
|
||||
$Script:confirmtext = $window.FindName("text")
|
||||
$Script:confirmok = $window.findName("btngo")
|
||||
$Script:confirmstop = $window.findName("btnstop")
|
||||
|
||||
# Verknüpft feste Elemente
|
||||
$window.Title = $Script:Version
|
||||
$window.icon="$root/Source/Logo.png"
|
||||
return $window
|
||||
}
|
||||
|
||||
function confirm {
|
||||
param (
|
||||
[String]$text
|
||||
)
|
||||
Write-Admin-Log "Confirm funkction triggered"
|
||||
if ($null -ne $text) {
|
||||
$Script:Confirmtext.text = $text
|
||||
$confirm.ShowDialog() | Out-Null
|
||||
if ($Script:GO) {
|
||||
return $true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$Script:confirm = Load_confirm $args[0] # Variable: $confirm
|
||||
|
||||
$confirmok.Add_Click({
|
||||
Write-Admin-Log "Confirm success"
|
||||
$Script:GO = $true
|
||||
$confirm.Hide()
|
||||
})
|
||||
|
||||
$confirm.Add_MouseLeftButtonDown({
|
||||
$confirm.DragMove()
|
||||
})
|
||||
|
||||
$confirmstop.Add_Click({
|
||||
Write-Admin-Log "Confirm denial"
|
||||
$Script:GO = $false
|
||||
$confirm.Hide()
|
||||
})
|
||||
|
||||
97
GUIS/gaming.ps1
Normal file
@@ -0,0 +1,97 @@
|
||||
function Load_gaming {
|
||||
param ($root)
|
||||
[XML]$Form = @"
|
||||
<?xaml encoding="utf-8"?>
|
||||
<Window
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Name="Window" Title="HDS Admin Panel - gaming Script" Height="171" Width="237" Icon="{Binding Icon}" ResizeMode="NoResize" WindowStyle="None">
|
||||
<Grid Background="#00344E">
|
||||
<Button Name="btnok" Content="Close" HorizontalAlignment="Center" Margin="0,120,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Button.Style>
|
||||
<Style TargetType="Button">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="Red"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<Label Content="Gaming" HorizontalAlignment="Left" VerticalAlignment="Top" Width="240" HorizontalContentAlignment="Center" Foreground="White" FontSize="20" FontWeight="Bold"/>
|
||||
<Label x:Name="l2" Content="MEG" HorizontalAlignment="Left" Margin="45,47,0,0" VerticalAlignment="Top" Width="36" Height="26" FontSize="12" Foreground="White"/>
|
||||
<Button TabIndex="4" x:Name="btnmeg" Content="Touch" ToolTip="aps the PowerButton of MEG" BorderThickness="0" HorizontalAlignment="Left" Margin="12,76,0,0" VerticalAlignment="Top" Width="102" Height="26" FontSize="13" Background="#00b8d4" Foreground="White" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Label x:Name="l2_Kopieren" Content="ITM" HorizontalAlignment="Left" Margin="157,45,0,0" VerticalAlignment="Top" Width="36" Height="26" FontSize="12" Foreground="White"/>
|
||||
<Button TabIndex="4" x:Name="btnitm" Content="Touch" ToolTip="Taps the PowerButton of ITM" BorderThickness="0" HorizontalAlignment="Left" Margin="124,76,0,0" VerticalAlignment="Top" Width="102" Height="26" FontSize="13" Background="#00b8d4" Foreground="White" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Window>
|
||||
"@
|
||||
|
||||
# Lädt das Fenster
|
||||
$window=[Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $Form))
|
||||
$NR=(New-Object System.Xml.XmlNodeReader $Form)
|
||||
$window=[Windows.Markup.XamlReader]::Load($NR)
|
||||
|
||||
# Objekt - Variablen Verknüpfung
|
||||
|
||||
$Script:gaming_btn_meg = $window.FindName("btnmeg")
|
||||
$Script:gaming_btn_itm = $window.findName("btnitm")
|
||||
$Script:gaming_ok = $window.findName("btnok")
|
||||
|
||||
# Verknüpft feste Elemente
|
||||
$window.Title = $Script:Version
|
||||
$window.icon="$root/Source/Logo.png"
|
||||
return $window
|
||||
}
|
||||
|
||||
$Script:gaming = Load_gaming $args[0] # Variable: $gaming
|
||||
|
||||
$gaming.Add_MouseLeftButtonDown({
|
||||
$gaming.DragMove()
|
||||
})
|
||||
|
||||
$gaming_btn_itm.Add_Click({
|
||||
$Password = "Ob>Q%T\;Cf(9\+T+-7lNQl*i*)(3;Egl"
|
||||
$servername = '192.168.178.4'
|
||||
$username = 'spaethf'
|
||||
Write-Admin-Log "BTN ITM pressed"
|
||||
if (confirm "Bei dem Server gaming Server ITM wird eine Power Aktion ausgeführt") {
|
||||
$command = 'python tap_itm.py'
|
||||
#Execute SSH command
|
||||
echo y | &($plinkpath + "\plink.exe") -pw $password $username@$servername $command
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
$gaming_btn_meg.Add_Click({
|
||||
$Password = "Ob>Q%T\;Cf(9\+T+-7lNQl*i*)(3;Egl"
|
||||
$servername = '192.168.178.4'
|
||||
$username = 'spaethf'
|
||||
Write-Admin-Log "BTN MEG pressed"
|
||||
if (confirm "Bei dem Server gaming Server MEG wird eine Power Aktion ausgeführt") {
|
||||
$command = 'python tap_meg.py'
|
||||
#Execute SSH command
|
||||
echo y | &($plinkpath + "\plink.exe") -pw $password $username@$servername $command
|
||||
}
|
||||
})
|
||||
|
||||
$gaming_ok.Add_Click({
|
||||
$gaming.Hide()
|
||||
})
|
||||
140
GUIS/getlogs.ps1
Normal file
@@ -0,0 +1,140 @@
|
||||
function Load_getlogs {
|
||||
param ($root)
|
||||
[XML]$Form = @"
|
||||
<?xaml encoding="utf-8"?>
|
||||
<Window
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
|
||||
xmlns:winForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
|
||||
Name="Window" Title="Cleaner - Information" Height="348" Width="406" Icon="{Binding Icon}" ResizeMode="NoResize" WindowStyle="None" Topmost="true">
|
||||
<Grid Background="#00344E">
|
||||
<Button Name="btnok" Content="OK" HorizontalAlignment="Left" Margin="165,294,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Button.Style>
|
||||
<Style TargetType="Button">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="Red"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<Label Content="Außer Betrieb" HorizontalAlignment="Center" VerticalAlignment="Top" Width="406" HorizontalContentAlignment="Center" Foreground="White" FontSize="20" FontWeight="Bold"/>
|
||||
<Button x:Name="btn_cert" Content="Certificate" HorizontalAlignment="Left" Margin="33,53,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Button.Style>
|
||||
<Style TargetType="{x:Type Button}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="Red"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<Button x:Name="btn_zeroconfig" Content="ZeroConfig" HorizontalAlignment="Left" Margin="33,100,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Button.Style>
|
||||
<Style TargetType="{x:Type Button}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="Red"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<Button x:Name="btn_zeroconfigcert" Content="ZeroConfig
Certtificate" HorizontalAlignment="Left" Margin="33,147,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Button.Style>
|
||||
<Style TargetType="{x:Type Button}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="Red"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<Button x:Name="btn_defudbu" Content="DEFU DB
 Update" HorizontalAlignment="Left" Margin="33,194,0,0" HorizontalContentAlignment="Center" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Button.Style>
|
||||
<Style TargetType="{x:Type Button}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="Red"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Window>
|
||||
"@
|
||||
|
||||
# Lädt das Fenster
|
||||
$window=[Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $Form))
|
||||
$NR=(New-Object System.Xml.XmlNodeReader $Form)
|
||||
$window=[Windows.Markup.XamlReader]::Load($NR)
|
||||
|
||||
# Objekt - Variablen Verknüpfung
|
||||
|
||||
$Script:getlog_btn_cert = $window.findName("btn_cert")
|
||||
$Script:getlog_btn_zeroconfig = $window.findName("btn_zeroconfig")
|
||||
$Script:getlog_btn_zeroconfigcert = $window.findName("btn_zeroconfigcert")
|
||||
$Script:getlog_btn_defudbu = $window.findName("btn_defudbu")
|
||||
$Script:getlog_btn_ok = $window.findName("btnok")
|
||||
|
||||
# Verknüpft feste Elemente
|
||||
$window.Title = $Script:Version
|
||||
$window.icon="$root/Source/Logo.png"
|
||||
return $window
|
||||
}
|
||||
|
||||
$Script:getlog = Load_getlogs $args[0] # Variable: $getlog
|
||||
|
||||
$getlog.Add_MouseLeftButtonDown({
|
||||
$getlog.DragMove()
|
||||
})
|
||||
|
||||
$getlog_btn_cert.Add_Click({
|
||||
ii $Script:cert_path
|
||||
})
|
||||
|
||||
$getlog_btn_zeroconfig.Add_Click({
|
||||
ii $Script:zero_config_path
|
||||
})
|
||||
|
||||
$getlog_btn_zeroconfigcert.Add_Click({
|
||||
ii $zero_config_path\Certs\update-idrac-cert
|
||||
})
|
||||
|
||||
$getlog_btn_defudbu.Add_Click({
|
||||
ii $defudbu_path\ProcessUpdatableDevices\LogFiles
|
||||
})
|
||||
|
||||
$getlog_btn_ok.Add_Click({
|
||||
$getlog.Hide()
|
||||
})
|
||||
61
GUIS/info.ps1
Normal file
@@ -0,0 +1,61 @@
|
||||
function Load_info {
|
||||
param ($root)
|
||||
[XML]$Form = @"
|
||||
<?xaml encoding="utf-8"?>
|
||||
<Window
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
|
||||
xmlns:winForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
|
||||
Name="Window" Title="Cleaner - Information" Height="440" Width="624" Icon="{Binding Icon}" ResizeMode="NoResize" WindowStyle="None">
|
||||
<Grid Background="#00344E">
|
||||
<TextBlock Name="text" Text="" HorizontalAlignment="Left" Margin="34,44,0,0" TextWrapping="Wrap" Foreground="White" Width="554" TextAlignment="Center" Height="360" VerticalAlignment="Top" FontSize="16"></TextBlock>
|
||||
<Button Name="btnok" Content="OK" HorizontalAlignment="Left" Margin="264,390,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Button.Style>
|
||||
<Style TargetType="Button">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="Red"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<Label Content="Information" HorizontalAlignment="Left" VerticalAlignment="Top" Width="624" HorizontalContentAlignment="Center" Foreground="White" FontSize="20" FontWeight="Bold"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
"@
|
||||
|
||||
# Lädt das Fenster
|
||||
$window=[Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $Form))
|
||||
$NR=(New-Object System.Xml.XmlNodeReader $Form)
|
||||
$window=[Windows.Markup.XamlReader]::Load($NR)
|
||||
|
||||
# Objekt - Variablen Verknüpfung
|
||||
|
||||
$text = $window.FindName("text")
|
||||
$Script:infook = $window.findName("btnok")
|
||||
|
||||
# Verknüpft feste Elemente
|
||||
$window.Title = $Script:Version
|
||||
$window.icon="$root/Source/Logo.png"
|
||||
$text.Text = "Das Admin Panel wurde geschaffen um Skripte welche von dem einzig waren Florian Spaeth entwickelt wurden in einer grafischen Oberfläche zu steuern.
|
||||
Die Anwendung wurde so entworfen das diese maximale Wartungsfreundlichkeit bietet und auch Usern mit wenig Powershell Erfahrung die Möglichkeit gibt, neue Fenster hinzu zu fügen.
|
||||
Im GitLab unter `"AllgemeineSkripte/examples`" kann Beispiel Code entnommen werden, wenn man sind in den BR hacken kann (: `n`nBugs in der GUI werden nicht aktiv verfolgt!`n`n$Script:Version `nCopyright bei Leiter (2024)`nAutor: Florian Spaeth `nDSGVO-Konform"
|
||||
return $window
|
||||
}
|
||||
|
||||
$Script:info = Load_info $args[0] # Variable: $info
|
||||
|
||||
$info.Add_MouseLeftButtonDown({
|
||||
$info.DragMove()
|
||||
})
|
||||
|
||||
$infook.Add_Click({
|
||||
$info.Hide()
|
||||
})
|
||||
266
GUIS/main.ps1
Normal file
@@ -0,0 +1,266 @@
|
||||
function Load_main {
|
||||
param ($root)
|
||||
|
||||
[XML]$Form = @"
|
||||
<?xaml encoding="utf-8"?>
|
||||
<Window
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Name="Window" Title="HDS Admin Panel - Hauptfenster" Height="454" Width="1020" Icon="{Binding Icon}" ResizeMode="NoResize" WindowStyle="None">
|
||||
<Window.Resources>
|
||||
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="#0082c6"/>
|
||||
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightTextBrushKey}" Color="#022335"/>
|
||||
</Window.Resources>
|
||||
<Grid Background="#00344E">
|
||||
<Image Name="Laufwerk" HorizontalAlignment="Left" Height="104" Margin="0,359,0,0" VerticalAlignment="Top" Width="110" Source="Binding" RenderTransformOrigin="0.409,0.857"/>
|
||||
<Label Name="version" Content="HDS Admin Panel" HorizontalAlignment="Left" Margin="87,379,0,0" VerticalAlignment="Top" Height="36" Width="186" FontSize="16" Foreground="White"/>
|
||||
<TextBox Name="tblaufwerkauslastung" BorderThickness="0" HorizontalAlignment="Left" Height="22" Margin="87,411,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="263" Background="#013C5A" Foreground="White" IsReadOnly="True" FontSize="14" IsTabStop="False"/>
|
||||
<Label Content="Log Admin Panel" HorizontalAlignment="Left" Margin="750,64,0,0" VerticalAlignment="Top" Height="369" Width="254" Background="#013C5A" Foreground="White" FontSize="16" FontWeight="Bold" HorizontalContentAlignment="Center"/>
|
||||
<Button TabIndex="4" Name="btnrefresh" Content="Clear Log" BorderThickness="0" HorizontalAlignment="Left" Margin="759,95,0,0" VerticalAlignment="Top" Width="237" Height="36" FontSize="13" Background="#00b8d4" Foreground="White" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" Name="btnScanner" Content="Very dark void" BorderThickness="0" HorizontalAlignment="Left" Margin="26,17,0,0" VerticalAlignment="Top" Width="218" Height="42" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Label Content="Administartion tool for the managing and manual handling of scripts created by Florian Spaeth.
It just needs to run! Nothing more or less. You understand me?!?. " HorizontalAlignment="Left" Margin="249,12,0,0" VerticalAlignment="Top" Width="755" Height="52" FontSize="15" Foreground="White"/>
|
||||
<Label Name="log" Content="" HorizontalAlignment="Left" Margin="759,138,0,0" VerticalAlignment="Top" Width="237" Height="284" FontSize="12" Foreground="White"/>
|
||||
<Button TabIndex="1" Name="btninfo" HorizontalAlignment="Left" Margin="971,22,0,0" VerticalAlignment="Top" Width="30" Height="30" Background="Transparent" ToolTip="Information" BorderThickness="0">
|
||||
<Image Name="imginfo" Source="{Binding}"/>
|
||||
<Button.Resources>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="CornerRadius" Value="5"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btnMEG" Content="Gaming" BorderThickness="0" HorizontalAlignment="Left" Margin="28,85,0,0" VerticalAlignment="Top" Width="118" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btnr710" Content="R710" BorderThickness="0" HorizontalAlignment="Left" Margin="172,85,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btnITM" Content="ITM" BorderThickness="0" HorizontalAlignment="Left" Margin="320,85,0,0" VerticalAlignment="Top" Width="118" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White" HorizontalContentAlignment="Center">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btnScanner_Kopieren3" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="464,85,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btnScanner_Kopieren4" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="610,85,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btnScanner_Kopieren5" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="28,159,0,0" VerticalAlignment="Top" Width="118" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btnScanner_Kopieren6" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="172,159,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btnScanner_Kopieren7" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="320,159,0,0" VerticalAlignment="Top" Width="118" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btnScanner_Kopieren8" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="464,159,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btnScanner_Kopieren9" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="610,159,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btnScanner_Kopieren10" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="28,231,0,0" VerticalAlignment="Top" Width="118" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btnScanner_Kopieren11" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="172,231,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btnScanner_Kopieren12" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="320,231,0,0" VerticalAlignment="Top" Width="118" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btnScanner_Kopieren13" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="464,231,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btnScanner_Kopieren14" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="610,231,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btnScanner_Kopieren15" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="28,307,0,0" VerticalAlignment="Top" Width="118" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btnScanner_Kopieren16" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="172,307,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btnScanner_Kopieren17" Content="Empty" BorderThickness="0" HorizontalAlignment="Left" Margin="320,307,0,0" VerticalAlignment="Top" Width="118" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btngetlogs" Content="Get Logs" BorderThickness="0" HorizontalAlignment="Left" Margin="464,307,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="0" x:Name="btnclrtmp" Content="Clear tmp" BorderThickness="0" HorizontalAlignment="Left" Margin="610,307,0,0" VerticalAlignment="Top" Width="120" Height="50" FontSize="16" FontWeight="Bold" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Label Content="" HorizontalAlignment="Left" Margin="1017,0,0,0" VerticalAlignment="Center" Height="454" Width="3" Background="DarkGray" Foreground="White" FontSize="16" FontWeight="Bold" HorizontalContentAlignment="Center"/>
|
||||
<Label Content="" HorizontalAlignment="Left" VerticalAlignment="Center" Height="454" Width="3" Background="DarkGray" Foreground="White" FontSize="16" FontWeight="Bold" HorizontalContentAlignment="Center"/>
|
||||
<Label Content="" HorizontalAlignment="Center" VerticalAlignment="Top" Height="3" Width="1020" Background="DarkGray" Foreground="White" FontSize="16" FontWeight="Bold" HorizontalContentAlignment="Center" Margin="0,451,0,0"/>
|
||||
<Label Content="" HorizontalAlignment="Center" VerticalAlignment="Top" Height="3" Width="1020" Background="DarkGray" Foreground="White" FontSize="16" FontWeight="Bold" HorizontalContentAlignment="Center"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
"@
|
||||
|
||||
# Lädt das Fenster
|
||||
$window=[Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $Form))
|
||||
$NR=(New-Object System.Xml.XmlNodeReader $Form)
|
||||
$window=[Windows.Markup.XamlReader]::Load($NR)
|
||||
|
||||
# Objekt - Variablen Verknüpfung
|
||||
$Laufwerk = $window.findName("Laufwerk")
|
||||
$Script:mainimgswitch = $window.findName("imgswitch")
|
||||
$imginfo = $window.findName("imginfo")
|
||||
$Script:bar = $window.findName("pbbar")
|
||||
$Script:last = $window.findName("tblaufwerkauslastung")
|
||||
$Script:mainscanner = $window.findName("btnScanner")
|
||||
$Script:maininfo = $window.findName("btninfo")
|
||||
$Script:mainloading = $window.findName("pbLoading")
|
||||
$Script:btn_logchange = $window.findName("btnfiltersw")
|
||||
$Script:btn_MEG = $window.findName("btnMEG")
|
||||
$Script:btn_itm = $window.findName("btnITM")
|
||||
$Script:btn_r710 = $window.findName("btnr710")
|
||||
$Script:btn_getlogs = $window.findName("btngetlogs")
|
||||
$Script:btn_logrefresh = $window.findName("btnrefresh")
|
||||
$Script:main_log = $window.findname("log")
|
||||
$Script:main_version = $window.findname("version")
|
||||
|
||||
# Verknüpft feste Elemente
|
||||
$window.Title = $Script:Version
|
||||
$window.icon="$root/Source/Logo.png"
|
||||
$Laufwerk.Source = "$root/Source/HDD1.png"
|
||||
$imginfo.Source = "$root/Source/info.png"
|
||||
$last.Text = "Current User: $Env:UserName"
|
||||
$main_version.Content = "$Script:Version"
|
||||
$btn_MEG.ToolTip = "Zero configuration Tool for DELL iDrac`nAccount _autcert needed"
|
||||
$btn_ITM.ToolTip = "Certificate distributor for DELL iDrac`nAccount _hardcon needed"
|
||||
$btn_R710.ToolTip = "Collection of Tools for DEFU Database`nAccount _DellFirmwareUpdates needed"
|
||||
$btn_getlogs.ToolTip = "Collection of all Logs known to this Script"
|
||||
|
||||
return $window
|
||||
}
|
||||
|
||||
$Script:main = Load_main $args[0] # Variable: $main
|
||||
|
||||
$btn_logrefresh.Add_Click({
|
||||
$main_log.content = ""
|
||||
Write-Admin-Log "Clear GUI Log"
|
||||
})
|
||||
|
||||
$mainscanner.Add_Click({
|
||||
$main.Hide()
|
||||
Write-Admin-Log "Seik"
|
||||
})
|
||||
|
||||
$btn_ITM.Add_Click({
|
||||
Write-Admin-Log "open cert windows"
|
||||
})
|
||||
|
||||
$btn_MEG.Add_Click({
|
||||
Write-Admin-Log "open Gaming window"
|
||||
$gaming.ShowDialog() | Out-Null
|
||||
})
|
||||
|
||||
$btn_R710.Add_Click({
|
||||
Write-Admin-Log "open R710 window"
|
||||
$r710.ShowDialog() | Out-Null
|
||||
})
|
||||
|
||||
$btn_getlogs.Add_Click({
|
||||
Write-Admin-Log "open get logs window"
|
||||
$getlog.ShowDialog() | Out-Null
|
||||
})
|
||||
|
||||
$maininfo.Add_Click({
|
||||
$info.ShowDialog() | Out-Null
|
||||
})
|
||||
|
||||
$main.Add_MouseLeftButtonDown({
|
||||
$main.DragMove()
|
||||
})
|
||||
133
GUIS/r710.ps1
Normal file
@@ -0,0 +1,133 @@
|
||||
function Load_r710 {
|
||||
param ($root)
|
||||
[XML]$Form = @"
|
||||
<?xaml encoding="utf-8"?>
|
||||
<Window
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Name="Window" Title="HDS Admin Panel - gaming Script" Height="404" Width="510" Icon="{Binding Icon}" ResizeMode="NoResize" WindowStyle="None">
|
||||
<Grid Background="#00344E">
|
||||
<Button Name="btnok" Content="Close" HorizontalAlignment="Left" Margin="11,358,0,0" VerticalAlignment="Top" Width="111" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Button.Style>
|
||||
<Style TargetType="Button">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="Red"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<Label Content="R710" HorizontalAlignment="Center" VerticalAlignment="Top" Width="377" HorizontalContentAlignment="Center" Foreground="White" FontSize="20" FontWeight="Bold" Margin="0,5,0,0"/>
|
||||
<Label x:Name="l2" Content="Power Status:" HorizontalAlignment="Left" Margin="11,148,0,0" VerticalAlignment="Top" Width="95" Height="26" FontSize="12" Foreground="White"/>
|
||||
<Button TabIndex="4" x:Name="btnstart" Content="Start" ToolTip="aps the PowerButton of MEG" BorderThickness="0" HorizontalAlignment="Left" Margin="11,55,0,0" VerticalAlignment="Top" Width="111" Height="26" FontSize="13" Background="#00b8d4" Foreground="White" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Label x:Name="l2_Kopieren" Content="" HorizontalAlignment="Left" Margin="150,50,0,0" VerticalAlignment="Top" Width="36" Height="26" FontSize="12" Foreground="White"/>
|
||||
<Button TabIndex="4" x:Name="btnstop" Content="Stop" ToolTip="Taps the PowerButton of ITM" BorderThickness="0" HorizontalAlignment="Left" Margin="11,86,0,0" VerticalAlignment="Top" Width="111" Height="26" FontSize="13" Background="#00b8d4" Foreground="White" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="4" x:Name="btninspect" Content="Inspect" ToolTip="Taps the PowerButton of ITM" BorderThickness="0" HorizontalAlignment="Left" Margin="11,117,0,0" VerticalAlignment="Top" Width="111" Height="26" FontSize="13" Background="#00b8d4" Foreground="White" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<TextBox Name="log" Text="" BorderThickness="0" HorizontalAlignment="Left" Height="340" Margin="133,54,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="369" HorizontalContentAlignment="Center" Background="#013C5A" Foreground="White" FontSize="14" IsTabStop="False"/>
|
||||
<Label x:Name="l2_Kopieren1" Content="FQDN:" HorizontalAlignment="Left" Margin="10,224,0,0" VerticalAlignment="Top" Width="73" Height="26" FontSize="12" Foreground="White"/>
|
||||
<Label x:Name="l2_Kopieren2" Content="BIOS Version:" HorizontalAlignment="Left" Margin="10,184,0,0" VerticalAlignment="Top" Width="84" Height="26" FontSize="12" Foreground="White"/>
|
||||
<TextBox x:Name="log_Power" Text="" BorderThickness="0" HorizontalAlignment="Left" Height="18" Margin="11,170,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="111" HorizontalContentAlignment="Center" Background="#013C5A" Foreground="White" FontSize="14" IsTabStop="False"/>
|
||||
<TextBox x:Name="log_BIOS" Text="" BorderThickness="0" HorizontalAlignment="Left" Height="18" Margin="11,208,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="111" HorizontalContentAlignment="Center" Background="#013C5A" Foreground="White" FontSize="14" IsTabStop="False"/>
|
||||
<TextBox x:Name="log_MAC" Text="" BorderThickness="0" HorizontalAlignment="Left" Height="18" Margin="10,248,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="112" HorizontalContentAlignment="Center" Background="#013C5A" Foreground="White" FontSize="14" IsTabStop="False"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
"@
|
||||
|
||||
# Lädt das Fenster
|
||||
$NR=(New-Object System.Xml.XmlNodeReader $Form)
|
||||
$window=[Windows.Markup.XamlReader]::Load($NR)
|
||||
|
||||
# Objekt - Variablen Verknüpfung
|
||||
|
||||
$Script:r710_btn_start = $window.FindName("btnstart")
|
||||
$Script:r710_btn_stop = $window.FindName("btnstop")
|
||||
$Script:r710_btn_inspect = $window.FindName("btninspect")
|
||||
$Script:r710ok = $window.findName("btnok")
|
||||
$Env:r710_log_power = $window.findName("log_Power")
|
||||
$Env:r710_log_bios = $window.findName("log_BIOS")
|
||||
$Env:r710_log_mac = $window.findName("log_MAC")
|
||||
$Script:r710_log = $window.findName("log")
|
||||
|
||||
# Verknüpft feste Elemente
|
||||
$window.Title = $Script:Version
|
||||
$window.icon="$root/Source/Logo.png"
|
||||
return $window
|
||||
}
|
||||
|
||||
$Script:r710 = Load_r710 $args[0] # Variable: $r710
|
||||
#$Script:Timestamp = get-date -format "yyyy-MM-dd HH:mm:ss"
|
||||
|
||||
|
||||
|
||||
$r710.Add_MouseLeftButtonDown({
|
||||
$r710.DragMove()
|
||||
})
|
||||
|
||||
$r710_btn_start.Add_Click({
|
||||
Write-Admin-Log "BTN r710 start pressed"
|
||||
if (confirm "Server R710 wird durch erneute betätigung gestartet") {
|
||||
cd $racpath
|
||||
$r710_log.Text += $(.\racadm.exe -r spaeth-bayern.de:5005 -u root -p "kt}y/6ZHF~.@" serveraction powerup)
|
||||
}
|
||||
})
|
||||
|
||||
$r710_btn_stop.Add_Click({
|
||||
Write-Admin-Log "BTN r710 stop pressed"
|
||||
if (confirm "Server R710 wird durch erneute betätigung gestopt`n`nSind alle Virtuelle Maschinen ausgeschaltet?") {
|
||||
cd $Script:racpath
|
||||
$r710_log.Text += $(.\racadm.exe -r spaeth-bayern.de:5005 -u root -p "kt}y/6ZHF~.@" serveraction powerdown)
|
||||
}
|
||||
})
|
||||
|
||||
$r710_btn_inspect.Add_Click({
|
||||
Write-Admin-Log "BTN r710 inspect pressed"
|
||||
if (confirm "Server R710 wird durch erneute betätigung gestopt`n`nSind alle Virtuelle Maschinen ausgeschaltet?") {
|
||||
cd $Script:racpath
|
||||
$collection = $(.\racadm.exe -r spaeth-bayern.de:5005 -u root -p "kt}y/6ZHF~.@" getsysinfo)
|
||||
foreach ($item in $collection) {
|
||||
if ($null -ne $item) {
|
||||
$r710_log.Text += "$item`n"
|
||||
if($item -match "DNS RAC Name"){
|
||||
$index = ($item.IndexOf("="))
|
||||
$Script:r710_log_mac.Text = $item.Substring($index+1)
|
||||
}
|
||||
if($item -match "Firmware Version"){
|
||||
$index = ($item.IndexOf("="))
|
||||
$Script:r710_log_bios.Text = $item.Substring($index+1)
|
||||
}
|
||||
if($item -match "Power Status"){
|
||||
$index = ($item.IndexOf("="))
|
||||
$Script:r710_log_power.Text = $item.Substring($index+1)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
$r710ok.Add_Click({
|
||||
$r710.Hide()
|
||||
})
|
||||
BIN
Source/Archiv.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
Source/Audio.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
Source/Bild.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
Source/Checked.png
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
Source/Container.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
Source/Datenbank.png
Normal file
|
After Width: | Height: | Size: 116 KiB |
BIN
Source/Folder.png
Normal file
|
After Width: | Height: | Size: 5.6 KiB |
BIN
Source/HDD1.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
Source/Internet.png
Normal file
|
After Width: | Height: | Size: 133 KiB |
BIN
Source/Konfig.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
Source/Logo-alt.PNG
Normal file
|
After Width: | Height: | Size: 2.1 KiB |
BIN
Source/Logo-cleaner.PNG
Normal file
|
After Width: | Height: | Size: 298 KiB |
BIN
Source/Logo.ico
Normal file
|
After Width: | Height: | Size: 188 KiB |
BIN
Source/Logo.png
Normal file
|
After Width: | Height: | Size: 124 KiB |
BIN
Source/Logowhite.png
Normal file
|
After Width: | Height: | Size: 15 KiB |
BIN
Source/Mail.png
Normal file
|
After Width: | Height: | Size: 5.9 KiB |
BIN
Source/Mails.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
Source/Office.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
Source/Softwareentwicklung.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
Source/Sonstiges.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
Source/Start.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
Source/Texte-Logs.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
Source/Thumbs.db
Normal file
BIN
Source/Unchecked.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
Source/Video.png
Normal file
|
After Width: | Height: | Size: 64 KiB |
BIN
Source/center.png
Normal file
|
After Width: | Height: | Size: 29 KiB |
BIN
Source/dash.png
Normal file
|
After Width: | Height: | Size: 53 KiB |
BIN
Source/hourglas.gif
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
Source/hourglas_original.gif
Normal file
|
After Width: | Height: | Size: 40 KiB |
BIN
Source/info.png
Normal file
|
After Width: | Height: | Size: 17 KiB |
BIN
Source/loading.gif
Normal file
|
After Width: | Height: | Size: 206 KiB |
BIN
Source/mainhourglas.gif
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
Source/marked.png
Normal file
|
After Width: | Height: | Size: 23 KiB |
BIN
Source/server.png
Normal file
|
After Width: | Height: | Size: 26 KiB |
BIN
Source/swfalse.png
Normal file
|
After Width: | Height: | Size: 10 KiB |
BIN
Source/swtrue.png
Normal file
|
After Width: | Height: | Size: 12 KiB |
46
center.ps1
Normal file
@@ -0,0 +1,46 @@
|
||||
# Autor: Florian Späth
|
||||
# v1.0.0
|
||||
$racadmpath = "C:\Program Files\Dell\SysMgt\rac5"
|
||||
$Password = "Ob>Q%T\;Cf(9\+T+-7lNQl*i*)(3;Egl"
|
||||
$servername = '192.168.178.4'
|
||||
$username = 'spaethf'
|
||||
$plinkpath = 'C:\Programme\PuTTY\'
|
||||
|
||||
function main{
|
||||
$whattodo = Read-Host "Was moechtest du tun? `n1 = R710 Server starten, 2 = R710 Server stoppen `n3 = R710 Systemzustand `n4 = Tap MEG, 5 = Tap ITM `n6 = EXIT"
|
||||
if ($whattodo -eq "1") {
|
||||
cd $racadmpath
|
||||
.\racadm.exe -r spaeth-bayern.de:5005 -u root -p "kt}y/6ZHF~.@" serveraction powerup
|
||||
Write-Host "Server startet! Dauer: ca. 5 min."
|
||||
main
|
||||
}elseif($whattodo -eq "2"){
|
||||
$confirmation = Read-Host "Sind alle VM ausgeschaltet? j/n"
|
||||
if ($confirmation -eq "j") {
|
||||
cd $racadmpath
|
||||
.\racadm.exe -r spaeth-bayern.de:5005 -u root -p "kt}y/6ZHF~.@" serveraction powerdown
|
||||
Write-Host "Server stoppt!"
|
||||
main
|
||||
}else{
|
||||
Write-Host "Schalte die VM über RDP aus"
|
||||
main
|
||||
}
|
||||
}elseif($whattodo -eq "3"){
|
||||
Write-host "Systeminfo:"
|
||||
cd $racadmpath
|
||||
.\racadm.exe -r spaeth-bayern.de:5005 -u root -p "kt}y/6ZHF~.@" getsysinfo
|
||||
main
|
||||
}elseif ($whattodo -eq "4") {
|
||||
$command = 'python tap_meg.py'
|
||||
#Execute SSH command
|
||||
echo y | &($plinkpath + "plink.exe") -pw $password $username@$servername $command
|
||||
main
|
||||
}elseif ($whattodo -eq "5") {
|
||||
$command = 'python tap_itm.py'
|
||||
#Execute SSH command
|
||||
echo y | &($plinkpath + "plink.exe") -pw $password $username@$servername $command
|
||||
main
|
||||
}elseif ($whattodo -eq "6") {
|
||||
exit
|
||||
}
|
||||
}
|
||||
main
|
||||
4
config.csv
Normal file
@@ -0,0 +1,4 @@
|
||||
ID, value
|
||||
plink_path, "C:\Program Files\PuTTY"
|
||||
racadm_path, "C:\Program Files\Dell\SysMgt\rac5"
|
||||
|
||||
|
776
extern710.ps1
Normal file
@@ -0,0 +1,776 @@
|
||||
$Script:Version = "FS Admin Panel v0.8 (extern)"
|
||||
#Ersteller: Florian Späth
|
||||
#Diese Software soll helfen die verschiedensten Anwendungen und Scripte der FG HDS zu administrieren.
|
||||
|
||||
Add-Type -AssemblyName PresentationFramework
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
[System.Reflection.Assembly]::LoadWithPartialName('System.Drawing') | Out-Null
|
||||
|
||||
### Variablen Definition ###
|
||||
# array = Settings ,
|
||||
$script:array=@($false,$true)
|
||||
|
||||
|
||||
function getValues($formTitle, $textTitle){
|
||||
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
|
||||
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
|
||||
|
||||
$objForm = New-Object System.Windows.Forms.Form
|
||||
$objForm.Text = $formTitle
|
||||
$objForm.Size = New-Object System.Drawing.Size(300,200)
|
||||
$objForm.StartPosition = "CenterScreen"
|
||||
|
||||
$objForm.KeyPreview = $True
|
||||
$objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter") {$x=$objTextBox.Text;$objForm.Close()}})
|
||||
$objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape") {$objForm.Close()}})
|
||||
|
||||
$OKButton = New-Object System.Windows.Forms.Button
|
||||
$OKButton.Location = New-Object System.Drawing.Size(75,120)
|
||||
$OKButton.Size = New-Object System.Drawing.Size(75,23)
|
||||
$OKButton.Text = "OK"
|
||||
$OKButton.Add_Click({$Script:userInput=$objTextBox.Text;$objForm.Close()})
|
||||
$objForm.Controls.Add($OKButton)
|
||||
|
||||
$CANCELButton = New-Object System.Windows.Forms.Button
|
||||
$CANCELButton.Location = New-Object System.Drawing.Size(150,120)
|
||||
$CANCELButton.Size = New-Object System.Drawing.Size(75,23)
|
||||
$CANCELButton.Text = "CANCEL"
|
||||
$CANCELButton.Add_Click({$objForm.Close()})
|
||||
$objForm.Controls.Add($CANCELButton)
|
||||
|
||||
$objLabel = New-Object System.Windows.Forms.Label
|
||||
$objLabel.Location = New-Object System.Drawing.Size(10,20)
|
||||
$objLabel.Size = New-Object System.Drawing.Size(280,30)
|
||||
$objLabel.Text = $textTitle
|
||||
$objForm.Controls.Add($objLabel)
|
||||
|
||||
$objTextBox = New-Object System.Windows.Forms.TextBox
|
||||
$objTextBox.Location = New-Object System.Drawing.Size(10,50)
|
||||
$objTextBox.Size = New-Object System.Drawing.Size(260,20)
|
||||
$objForm.Controls.Add($objTextBox)
|
||||
|
||||
$objForm.Topmost = $True
|
||||
|
||||
$objForm.Add_Shown({$objForm.Activate()})
|
||||
|
||||
[void] $objForm.ShowDialog()
|
||||
|
||||
return $userInput
|
||||
}
|
||||
|
||||
Function Select-FolderDialog{
|
||||
param([string]$Description="RACADM Speicherort wählen",[string]$RootFolder="Desktop")
|
||||
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") |Out-Null
|
||||
$objForm = New-Object System.Windows.Forms.FolderBrowserDialog
|
||||
$objForm.Rootfolder = $RootFolder
|
||||
$objForm.Description = $Description
|
||||
$Show = $objForm.ShowDialog()
|
||||
If ($Show -eq "OK"){
|
||||
Return $objForm.SelectedPath
|
||||
}else{
|
||||
Return $false
|
||||
}
|
||||
}
|
||||
|
||||
### $schema = getValues "Database Schema" "Enter database schema"
|
||||
|
||||
|
||||
#### Lädt Scripte ####
|
||||
|
||||
|
||||
function Load_info {
|
||||
[XML]$Form = @"
|
||||
<?xaml encoding="utf-8"?>
|
||||
<Window
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"
|
||||
xmlns:winForms="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
|
||||
Name="Window" Title="Cleaner - Information" Height="440" Width="624" Icon="{Binding Icon}" ResizeMode="NoResize" WindowStyle="None">
|
||||
<Grid Background="#00344E">
|
||||
<TextBlock Name="text" Text="" HorizontalAlignment="Left" Margin="34,44,0,0" TextWrapping="Wrap" Foreground="White" Width="554" TextAlignment="Center" Height="360" VerticalAlignment="Top" FontSize="16"></TextBlock>
|
||||
<Button Name="btnok" Content="OK" HorizontalAlignment="Left" Margin="264,390,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="#00b8d4" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Button.Style>
|
||||
<Style TargetType="Button">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="Red"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<Label Content="Information" HorizontalAlignment="Left" VerticalAlignment="Top" Width="624" HorizontalContentAlignment="Center" Foreground="White" FontSize="20" FontWeight="Bold"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
"@
|
||||
|
||||
# Lädt das Fenster
|
||||
$window=[Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $Form))
|
||||
$NR=(New-Object System.Xml.XmlNodeReader $Form)
|
||||
$window=[Windows.Markup.XamlReader]::Load($NR)
|
||||
|
||||
# Objekt - Variablen Verknüpfung
|
||||
|
||||
$text = $window.FindName("text")
|
||||
$Script:infook = $window.findName("btnok")
|
||||
|
||||
# Verknüpft feste Elemente
|
||||
$window.Title = $Script:Version
|
||||
$window.icon="C:\FSAP/Source/Logo.png"
|
||||
$text.Text = "Das Admin Panel wurde geschaffen um Skripte welche von dem einzig waren Florian Spaeth entwickelt wurden in einer grafischen Oberfläche zu steuern.
|
||||
Die Anwendung wurde so entworfen das diese maximale Wartungsfreundlichkeit bietet und auch Usern mit wenig Powershell Erfahrung die Möglichkeit gibt, neue Fenster hinzu zu fügen.
|
||||
Im GitLab unter `"AllgemeineSkripte/examples`" kann Beispiel Code entnommen werden, wenn man sind in den BR hacken kann (: `n`nBugs in der GUI werden nicht aktiv verfolgt!`n`n$Script:Version `nCopyright bei Leiter (2024)`nAutor: Florian Spaeth `nDSGVO-Konform"
|
||||
return $window
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function Load_confirm {
|
||||
[XML]$Form = @"
|
||||
<?xaml encoding="utf-8"?>
|
||||
<Window
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Name="Window" Title="HDS Admin Panel - Confirm" Height="276" Width="509" Icon="{Binding Icon}" ResizeMode="NoResize" WindowStyle="None">
|
||||
<Grid Background="#00344E">
|
||||
<Button Name="btnstop" Content="BACK" HorizontalAlignment="Left" Margin="122,215,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="DarkGreen" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Button.Style>
|
||||
<Style TargetType="Button">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="Red"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
<Label Content="Confirm" HorizontalAlignment="Left" VerticalAlignment="Top" Width="509" HorizontalContentAlignment="Center" Foreground="White" FontSize="20" FontWeight="Bold"/>
|
||||
<Label Name="choosen3" Content="Confirm the action and press the button again" HorizontalAlignment="Center" Margin="0,42,0,0" VerticalAlignment="Top" Width="270" Height="34" FontSize="12" FontWeight="Bold" Foreground="White"/>
|
||||
<TextBox Name="text" Text="TEXT" BorderThickness="0" HorizontalAlignment="Center" Height="113" TextWrapping="Wrap" VerticalAlignment="Center" Width="412" Background="#013C5A" HorizontalContentAlignment="Center" Foreground="White" FontSize="14" IsTabStop="False"/>
|
||||
<Button Name="btngo" Content="GO!" HorizontalAlignment="Left" Margin="286,215,0,0" VerticalAlignment="Top" Width="100" Height="36" BorderThickness="0" Background="DarkRed" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Button.Style>
|
||||
<Style TargetType="{x:Type Button}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="Red"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Button.Style>
|
||||
</Button>
|
||||
</Grid>
|
||||
</Window>
|
||||
"@
|
||||
|
||||
# Lädt das Fenster
|
||||
$window=[Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $Form))
|
||||
$NR=(New-Object System.Xml.XmlNodeReader $Form)
|
||||
$window=[Windows.Markup.XamlReader]::Load($NR)
|
||||
|
||||
# Objekt - Variablen Verknüpfung
|
||||
|
||||
$Script:confirmtext = $window.FindName("text")
|
||||
$Script:confirmok = $window.findName("btngo")
|
||||
$Script:confirmstop = $window.findName("btnstop")
|
||||
|
||||
# Verknüpft feste Elemente
|
||||
$window.Title = $Script:Version
|
||||
$window.icon="C:\FSAP/Source/Logo.png"
|
||||
return $window
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function Load_main {
|
||||
[XML]$Form = @"
|
||||
<?xaml encoding="utf-8"?>
|
||||
<Window
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WpfApp1"
|
||||
Title="MainWindow" Height="770" Width="932" Background="#1a1a1a" ResizeMode="NoResize">
|
||||
<Grid>
|
||||
<Label HorizontalAlignment="Left" VerticalAlignment="Top" Width="108" Height="731" FontSize="12" BorderBrush="Gray" Background="#0a0a0a" Foreground="White" Margin="1,10,0,0"/>
|
||||
<Label HorizontalAlignment="Center" VerticalAlignment="Top" Width="1442" Height="76" FontSize="12" BorderBrush="Gray" Background="#0a0a0a" Foreground="White"/>
|
||||
<Button TabIndex="1" Name="menu1" BorderThickness="0" HorizontalAlignment="Left" Margin="20,101,0,0" VerticalAlignment="Top" Width="70" Height="70" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img1" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="menu2" BorderThickness="0" HorizontalAlignment="Left" Margin="20,191,0,0" VerticalAlignment="Top" Width="70" Height="70" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img2" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="menu3" BorderThickness="0" HorizontalAlignment="Left" Margin="20,281,0,0" VerticalAlignment="Top" Width="70" Height="70" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img3" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="menu4" BorderThickness="0" HorizontalAlignment="Left" Margin="20,374,0,0" VerticalAlignment="Top" Width="70" Height="70" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img4" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="menu5" BorderThickness="0" HorizontalAlignment="Left" Margin="20,467,0,0" VerticalAlignment="Top" Width="70" Height="70" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img5" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="menu6" BorderThickness="0" HorizontalAlignment="Left" Margin="20,559,0,0" VerticalAlignment="Top" Width="70" Height="70" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img6" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button Name="btninfo" HorizontalAlignment="Left" Margin="31,664,0,0" VerticalAlignment="Top" Width="48" Height="48" BorderThickness="0" Background="#292929" FontSize="40" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="imginfo" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="4" x:Name="btnsettings" BorderThickness="0" HorizontalAlignment="Left" Margin="834,653,0,0" VerticalAlignment="Top" Width="67" Height="70" FontSize="40" Background="#292929" Foreground="White" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="imgsettings" Source="{Binding}"/>
|
||||
</Button>
|
||||
<TextBox Name="log" Text="" BorderThickness="0" HorizontalAlignment="Left" Height="465" Margin="505,101,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="396" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="14" IsTabStop="False"/>
|
||||
<Label Name="l1" Content="" HorizontalAlignment="Left" VerticalAlignment="Top" Width="599" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White" FontSize="22" FontWeight="Medium" Margin="152,37,0,0" Height="44"/>
|
||||
<TextBlock Name="work" Text="" HorizontalAlignment="Left" Margin="1314,10,0,0" TextWrapping="Wrap" Foreground="White" Background="Darkgreen" IsEnabled="false" Width="44" TextAlignment="Center" Height="52" VerticalAlignment="Top" FontSize="16"/>
|
||||
|
||||
<Button TabIndex="1" x:Name="btn_settings" Content="Settings" BorderThickness="0" HorizontalAlignment="Left" Margin="738,478,0,0" Visibility = "Hidden" VerticalAlignment="Top" Width="163" Height="35" FontSize="13" Foreground="LightGray" Background="#292929" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_standby" Content="Standby" BorderThickness="0" HorizontalAlignment="Left" Margin="738,519,0,0" Visibility = "Hidden" VerticalAlignment="Top" Width="163" Height="35" FontSize="13" Foreground="LightGray" Background="#292929" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_shutdown" Content="Shutdown" BorderThickness="0" HorizontalAlignment="Left" Margin="738,561,0,0" Visibility = "Hidden" VerticalAlignment="Top" Width="163" Height="35" FontSize="13" Foreground="LightGray" Background="#292929" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_close" Content="Close" BorderThickness="0" HorizontalAlignment="Left" Margin="738,602,0,0" Visibility = "Hidden" VerticalAlignment="Top" Width="163" Height="35" FontSize="13" Foreground="LightGray" Background="#292929" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
|
||||
|
||||
|
||||
<Button TabIndex="1" x:Name="btn_r710_stop" BorderThickness="0" HorizontalAlignment="Left" Margin="268,316,0,0" VerticalAlignment="Top" Width="100" Height="100" FontSize="13" Background="DarkRed" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_r710_m2" BorderThickness="0" HorizontalAlignment="Left" Margin="268,431,0,0" VerticalAlignment="Top" Width="99" Height="100" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_r710_m1" BorderThickness="0" HorizontalAlignment="Left" Margin="379,431,0,0" VerticalAlignment="Top" Width="99" Height="100" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_r710_info" BorderThickness="0" HorizontalAlignment="Left" Margin="137,316,0,0" VerticalAlignment="Top" Width="100" Height="100" FontSize="13" Background="DarkOrange" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" Name="btn_r710_start" BorderThickness="0" HorizontalAlignment="Left" Margin="379,316,0,0" VerticalAlignment="Top" Width="99" Height="100" FontSize="13" Background="DarkGreen" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Label Name="l1_R710" HorizontalAlignment="Left" Content="Power:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="124,100,0,0"/>
|
||||
<TextBox x:Name="tb_r710_power" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="260,100,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
<Label Name="l2_R710" HorizontalAlignment="Left" Content="MAC:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="124,139,0,0"/>
|
||||
<TextBox x:Name="tb_r710_mac" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="260,139,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
<Label Name="l3_R710" HorizontalAlignment="Left" Content="IP:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="124,178,0,0"/>
|
||||
<TextBox x:Name="tb_r710_ip" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="260,178,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
<Label Name="l4_R710" HorizontalAlignment="Left" Content="BIOS:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="124,217,0,0"/>
|
||||
<TextBox x:Name="tb_r710_bios" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="260,217,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
<Label Name="l5_R710" HorizontalAlignment="Left" Content="RAC Name:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="124,256,0,0"/>
|
||||
<TextBox x:Name="tb_r710_name" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="260,256,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
"@
|
||||
|
||||
# Lädt das Fenster
|
||||
$window=[Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $Form))
|
||||
|
||||
# Objekt - Variablen Verknüpfung
|
||||
#Main
|
||||
$Script:menu1 = $window.findName("menu1")
|
||||
$Script:menu2 = $window.findName("menu2")
|
||||
$Script:menu3 = $window.findName("menu3")
|
||||
$Script:menu4 = $window.findName("menu4")
|
||||
$Script:menu5 = $window.findName("menu5")
|
||||
$Script:menu6 = $window.findName("menu6")
|
||||
$Script:img1 = $window.findName("img1")
|
||||
$Script:img2 = $window.findName("img2")
|
||||
$Script:img3 = $window.findName("img3")
|
||||
$Script:img4 = $window.findName("img4")
|
||||
$Script:img5 = $window.findName("img5")
|
||||
$Script:img6 = $window.findName("img6")
|
||||
$Script:btn_info = $window.findName("btninfo")
|
||||
$Script:settings = $window.findName("btnsettings")
|
||||
$Script:imginfo = $window.findName("imginfo")
|
||||
$Script:imgsettings = $window.findName("imgsettings")
|
||||
$Script:l1 = $window.findName("l1")
|
||||
$Script:log = $window.findName("log")
|
||||
$Script:work = $window.findName("work")
|
||||
$Script:btn_standby = $window.findName("btn_standby")
|
||||
$Script:btn_shutdown = $window.findName("btn_shutdown")
|
||||
$Script:btn_settings = $window.findName("btn_settings")
|
||||
$Script:btn_close = $window.findName("btn_close")
|
||||
|
||||
#Dashboard
|
||||
$Script:Dashboard = $window.findName("Dashboard")
|
||||
|
||||
#R710
|
||||
$Script:btn_r710_stop = $window.findName("btn_r710_stop")
|
||||
$Script:btn_r710_start = $window.findName("btn_r710_start")
|
||||
$Script:btn_r710_info = $window.findName("btn_r710_info")
|
||||
$Script:btn_r710_m1 = $window.findname("btn_r710_m1")
|
||||
$Script:btn_r710_m2 = $window.findname("btn_r710_m2")
|
||||
|
||||
$Script:tb_r710_power = $window.findname("tb_r710_power")
|
||||
$Script:tb_r710_mac = $window.findname("tb_r710_mac")
|
||||
$Script:tb_r710_ip = $window.findname("tb_r710_ip")
|
||||
$Script:tb_r710_bios = $window.findname("tb_r710_bios")
|
||||
$Script:tb_r710_name = $window.findname("tb_r710_name")
|
||||
|
||||
$Script:l1_r710 = $window.findname("l1_R710")
|
||||
$Script:l2_r710 = $window.findname("l2_R710")
|
||||
$Script:l3_r710 = $window.findname("l3_R710")
|
||||
$Script:l4_r710 = $window.findname("l4_R710")
|
||||
$Script:l5_r710 = $window.findname("l5_R710")
|
||||
|
||||
# Fensterwahl
|
||||
#if (condition) {
|
||||
#$window.Height="912"
|
||||
#$window.Width="1370"
|
||||
#$window.WindowStyle="None"
|
||||
#$window.WindowState="Maximized"
|
||||
|
||||
#$window.Height="912"
|
||||
#$window.Width="1370"
|
||||
#$window.WindowStyle="SingleBorderWindow"
|
||||
#$window.WindowState="Normal"
|
||||
#}
|
||||
|
||||
# Verknüpft feste Elemente
|
||||
$window.Title = $Script:Version
|
||||
$window.icon="C:\FSAP\Source\Logo.png"
|
||||
$imginfo.Source = "C:\FSAP\Source\info.png"
|
||||
$imgsettings.Source = "C:\FSAP/Source/Konfig.png"
|
||||
$img1.Source = "C:\FSAP/Source/Dash.png"
|
||||
$img2.Source = "C:\FSAP/Source/Server.png"
|
||||
$img3.Source = "C:\FSAP/Source/center.png"
|
||||
return $window
|
||||
}
|
||||
|
||||
$Script:main = Load_main # Variable: $main
|
||||
$Script:confirm = Load_confirm # Variable: $confirm
|
||||
$Script:info = Load_info # Variable: $info
|
||||
|
||||
|
||||
#### Definition globaler Variablen ####
|
||||
|
||||
## Die GO variable kann nach aufruf der confirm funktion abgefragt werden, um eine 2. Bestätigung der eingabe zu erhalten. (Aufruf: confirm $text)
|
||||
[boolean]$Script:GO = $false
|
||||
|
||||
$Script:ScriptRoot = "C:\FSAP"
|
||||
$Script:iconpath = "C:\FSAP\icons"
|
||||
$Script:config = Import-CSV -Path "C:\FSAP\config.csv"
|
||||
$Script:RACpath = ($config | where{$_.ID -eq "racadm_path"}).value
|
||||
$Script:plinkpath = ($config | where{$_.ID -eq "plink_path"}).value
|
||||
$Script:idracuser = ($config | where{$_.ID -eq "idracuser"}).value
|
||||
$Script:idracpass = ($config | where{$_.ID -eq "idracpass"}).value
|
||||
$Script:remoteuser = ($config | where{$_.ID -eq "remoteuser"}).value
|
||||
$Script:remotepass = ($config | where{$_.ID -eq "remotepass"}).value
|
||||
$idracpassenc = "$Script:idracpass"|ConvertTo-SecureString
|
||||
$Script:idracpass = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($idracpassenc))
|
||||
$remotepassenc = "$Script:remotepass"|ConvertTo-SecureString
|
||||
$Script:remotepass = [Runtime.InteropServices.Marshal]::PtrToStringAuto([Runtime.InteropServices.Marshal]::SecureStringToBSTR($remotepassenc))
|
||||
|
||||
|
||||
|
||||
#$Script:cert_path = ($config | where{$_.ID -eq "some"}).value
|
||||
#$Script:defudbu_path = ($config | where{$_.ID -eq "some"}).value
|
||||
$logfile = "C:\FSAP\log.txt"
|
||||
|
||||
### Farb Variablen ###
|
||||
|
||||
$Script:Standardbtncolor = "#00b8d4"
|
||||
$Script:Delcolor = "#d50000"
|
||||
$Script:BackgroundMovecolor = "#FFFFEB9C"
|
||||
$Script:ForegroundMovecolor = "#FF9C6500"
|
||||
$Script:Foregroundgrey = "#FF7A7A7A"
|
||||
$Script:Backgroundgrey = "#FFC5C5C5"
|
||||
|
||||
#### Funktionen ####
|
||||
### Global ###
|
||||
|
||||
function Write-Admin-Log{
|
||||
Param($text)
|
||||
"$(get-date -format "yyyy-MM-dd HH:mm:ss"): $($text)" | out-file $logfile -Append
|
||||
$Script:log.text += "$text `n"
|
||||
}
|
||||
|
||||
function Resolve-DnsName {
|
||||
param (
|
||||
[Parameter(Mandatory)][string]$ComputerName
|
||||
)
|
||||
try {
|
||||
[System.Net.Dns]::GetHostAddresses($ComputerName).IPAddressToString
|
||||
return ([System.Net.Dns]::GetHostAddresses($ComputerName).IPAddressToString)
|
||||
}
|
||||
catch {
|
||||
Write-Log "IP not found for $ComputerName!"
|
||||
}
|
||||
}
|
||||
|
||||
function working {
|
||||
param (
|
||||
$status
|
||||
)
|
||||
if ($status) {
|
||||
$Script:work.Background="Darkred"
|
||||
}else {
|
||||
$Script:work.Background="Darkgreen"
|
||||
}
|
||||
}
|
||||
|
||||
function confirm {
|
||||
param (
|
||||
[String]$text
|
||||
)
|
||||
Write-Admin-Log "Confirm funkction triggered"
|
||||
if ($null -ne $text) {
|
||||
$Script:Confirmtext.text = $text
|
||||
$confirm.ShowDialog() | Out-Null
|
||||
if ($Script:GO) {
|
||||
return $true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$confirmok.Add_Click({
|
||||
Write-Admin-Log "Confirm success"
|
||||
$Script:GO = $true
|
||||
$confirm.Hide()
|
||||
})
|
||||
|
||||
$confirm.Add_MouseLeftButtonDown({
|
||||
$confirm.DragMove()
|
||||
})
|
||||
|
||||
$confirmstop.Add_Click({
|
||||
Write-Admin-Log "Confirm denial"
|
||||
$Script:GO = $false
|
||||
$confirm.Hide()
|
||||
})
|
||||
|
||||
|
||||
#### Startet die Anwendung ####
|
||||
|
||||
### Initialisieren ###
|
||||
|
||||
$Script:btn_info.Add_Click({
|
||||
$Script:info.ShowDialog()
|
||||
})
|
||||
|
||||
### Settings ###
|
||||
|
||||
$settings.Add_Click({
|
||||
if ($Script:array[0]) {
|
||||
$Script:btn_settings.Visibility = "Hidden"
|
||||
$Script:btn_standby.Visibility = "Hidden"
|
||||
$Script:btn_shutdown.Visibility = "Hidden"
|
||||
$Script:btn_close.Visibility = "Hidden"
|
||||
$Script:array[0]=$false
|
||||
}else {
|
||||
$Script:btn_settings.Visibility = "Visible"
|
||||
$Script:btn_standby.Visibility = "Visible"
|
||||
$Script:btn_shutdown.Visibility = "Visible"
|
||||
$Script:btn_close.Visibility = "Visible"
|
||||
$Script:array[0]=$true
|
||||
}
|
||||
})
|
||||
|
||||
$Script:btn_settings.Add_Click({
|
||||
$return = Select-FolderDialog
|
||||
if($return){
|
||||
$Script:racpath = $return
|
||||
$NewLine = "racadm_path, $racpath" -f
|
||||
$NewLine | add-content -path "C:\FSAP\config.csv"
|
||||
}
|
||||
$Script:idracuser = getValues "IDRAC Configurator" "Enter idrac user"
|
||||
$Script:idracpass = getValues "IDRAC Configurator" "Enter idrac password"
|
||||
|
||||
$Script:remoteuser = getValues "IDRAC Configurator" "Enter remote user"
|
||||
$Script:remotepass = getValues "IDRAC Configurator" "Enter remote password"
|
||||
|
||||
$NewLine = "idracuser, $idracuser" -f
|
||||
$NewLine | add-content -path "C:\FSAP\config.csv"
|
||||
$secidracpass = "$idracpass" | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString
|
||||
$NewLine = "idracpass, $secidracpass" -f
|
||||
$NewLine | add-content -path "C:\FSAP\config.csv"
|
||||
|
||||
|
||||
$NewLine = "remoteuser, $remoteuser" -f
|
||||
$NewLine | add-content -path "C:\FSAP\config.csv"
|
||||
$secremotepass = "$remotepass" | ConvertTo-SecureString -AsPlainText -Force | ConvertFrom-SecureString
|
||||
$NewLine = "remotepass, $secremotepass" -f
|
||||
$NewLine | add-content -path "C:\FSAP\config.csv"
|
||||
write-host $Script:remoteuser
|
||||
Write-host $Script:remotepass
|
||||
})
|
||||
$Script:btn_standby.Add_Click({
|
||||
if (confirm "Wanna SUSPEND the System?") {
|
||||
$PowerState = [System.Windows.Forms.PowerState]::Suspend
|
||||
$Force = $false
|
||||
$DisableWake = $false
|
||||
[System.Windows.Forms.Application]::SetSuspendState($PowerState, $Force, $DisableWake)
|
||||
}
|
||||
})
|
||||
$Script:btn_shutdown.Add_Click({
|
||||
if (confirm "Wanna SHUTDOWN the System?") {
|
||||
$PowerState = [System.Windows.Forms.PowerState]::Shutdown
|
||||
$Force = $false
|
||||
$DisableWake = $false
|
||||
[System.Windows.Forms.Application]::SetSuspendState($PowerState, $Force, $DisableWake)
|
||||
}
|
||||
})
|
||||
$Script:btn_close.Add_Click({
|
||||
$main.Hide()
|
||||
})
|
||||
|
||||
$info.Add_MouseLeftButtonDown({
|
||||
$info.DragMove()
|
||||
})
|
||||
|
||||
$infook.Add_Click({
|
||||
$Script:info.Hide()
|
||||
})
|
||||
|
||||
### Menu ###
|
||||
|
||||
function clearGUI {
|
||||
|
||||
#R710
|
||||
|
||||
$Script:btn_r710_stop.Visibility = "Hidden"
|
||||
$Script:btn_r710_start.Visibility = "Hidden"
|
||||
$Script:btn_r710_info.Visibility = "Hidden"
|
||||
$Script:btn_r710_m1.Visibility = "Hidden"
|
||||
$Script:btn_r710_m2.Visibility = "Hidden"
|
||||
|
||||
$Script:tb_r710_power.Visibility = "Hidden"
|
||||
$Script:tb_r710_mac.Visibility = "Hidden"
|
||||
$Script:tb_r710_ip.Visibility = "Hidden"
|
||||
$Script:tb_r710_bios.Visibility = "Hidden"
|
||||
$Script:tb_r710_name.Visibility = "Hidden"
|
||||
|
||||
$Script:l1_r710.Visibility = "Hidden"
|
||||
$Script:l2_r710.Visibility = "Hidden"
|
||||
$Script:l3_r710.Visibility = "Hidden"
|
||||
$Script:l4_r710.Visibility = "Hidden"
|
||||
$Script:l5_r710.Visibility = "Hidden"
|
||||
}
|
||||
|
||||
function SwitchGUI {
|
||||
param (
|
||||
$menu
|
||||
)
|
||||
if ($menu -match "m1") {
|
||||
clearGUI
|
||||
}elseif ($menu -match "m2") {
|
||||
clearGUI
|
||||
$Script:btn_r710_stop.Visibility = "Visible"
|
||||
$Script:btn_r710_start.Visibility = "Visible"
|
||||
$Script:btn_r710_info.Visibility = "Visible"
|
||||
$Script:btn_r710_m1.Visibility = "Visible"
|
||||
$Script:btn_r710_m2.Visibility = "Visible"
|
||||
|
||||
$Script:tb_r710_power.Visibility = "Visible"
|
||||
$Script:tb_r710_mac.Visibility = "Visible"
|
||||
$Script:tb_r710_ip.Visibility = "Visible"
|
||||
$Script:tb_r710_bios.Visibility = "Visible"
|
||||
$Script:tb_r710_name.Visibility = "Visible"
|
||||
|
||||
$Script:l1_r710.Visibility = "Visible"
|
||||
$Script:l2_r710.Visibility = "Visible"
|
||||
$Script:l3_r710.Visibility = "Visible"
|
||||
$Script:l4_r710.Visibility = "Visible"
|
||||
$Script:l5_r710.Visibility = "Visible"
|
||||
}elseif ($menu -match "m3") {
|
||||
clearGUI
|
||||
}elseif ($menu -match "m4") {
|
||||
clearGUI
|
||||
}elseif ($menu -match "m5") {
|
||||
clearGUI
|
||||
}elseif ($menu -match "m6") {
|
||||
clearGUI
|
||||
}
|
||||
}
|
||||
|
||||
$Script:menu1.Add_Click({
|
||||
switchGUI -menu "m1"
|
||||
$Script:l1.Content = "Dashboard"
|
||||
})
|
||||
$Script:menu2.Add_Click({
|
||||
switchGUI -menu "m2"
|
||||
$Script:l1.Content = "R710 Control"
|
||||
})
|
||||
$Script:menu3.Add_Click({
|
||||
switchGUI -menu "m3"
|
||||
$Script:l1.Content = "Gaming Control"
|
||||
})
|
||||
$Script:menu4.Add_Click({
|
||||
switchGUI -menu "m4"
|
||||
})
|
||||
$Script:menu5.Add_Click({
|
||||
switchGUI -menu "m5"
|
||||
})
|
||||
$Script:menu6.Add_Click({
|
||||
switchGUI -menu "m6"
|
||||
})
|
||||
|
||||
### R710 ###
|
||||
|
||||
function get_r710_stats {
|
||||
working $true
|
||||
cd $Script:racpath
|
||||
$collection = $(.\racadm.exe -r spaeth-bayern.de:5005 -u $Script:idracuser -p $Script:idracpass getsysinfo)
|
||||
foreach ($item in $collection) {
|
||||
if ($null -ne $item) {
|
||||
$log.Text += "$item`n"
|
||||
if($item -match "DNS RAC Name"){
|
||||
$index = ($item.IndexOf("="))
|
||||
$Script:tb_r710_name.Text = $item.Substring($index+1)
|
||||
}
|
||||
if($item -match "Firmware Version"){
|
||||
$index = ($item.IndexOf("="))
|
||||
$Script:tb_r710_bios.Text = $item.Substring($index+1)
|
||||
}
|
||||
if($item -match "Power Status"){
|
||||
$index = ($item.IndexOf("="))
|
||||
$Script:tb_r710_power.Text = $item.Substring($index+1)
|
||||
}
|
||||
if($item -match "MAC Address"){
|
||||
$index = ($item.IndexOf("="))
|
||||
$Script:tb_r710_mac.Text = $item.Substring($index+1)
|
||||
}
|
||||
if($item -match "Power Status"){
|
||||
$index = ($item.IndexOf("="))
|
||||
$Script:tb_r710_power.Text = $item.Substring($index+1)
|
||||
}
|
||||
}
|
||||
}
|
||||
cd C:\FSAP
|
||||
working $false
|
||||
}
|
||||
|
||||
$btn_r710_start.Add_Click({
|
||||
Write-Admin-Log "BTN r710 start pressed"
|
||||
if (confirm "Server R710 wird durch erneute betätigung gestartet") {
|
||||
cd $racpath
|
||||
$r710_log.Text += $(.\racadm.exe -r spaeth-bayern.de:5005 -u $Script:idracuser -p $Script:idracpass serveraction powerup)
|
||||
}
|
||||
})
|
||||
|
||||
$btn_r710_stop.Add_Click({
|
||||
Write-Admin-Log "BTN r710 stop pressed"
|
||||
if (confirm "Server R710 wird durch erneute betätigung gestopt`n`nIST DER SERVER HERUNTERGEFAHREN (/STOP IN DIE MINECRAFT CONSOLE)?") {
|
||||
$command = './stop_proxmox.sh'
|
||||
#Execute SSH command
|
||||
echo y | &($plinkpath + "\plink.exe") -pw "$Script:remotepass" "$Script:remoteuser@spaeth-bayern.de" $command
|
||||
#cd $Script:racpath
|
||||
#$r710_log.Text += $(.\racadm.exe -r spaeth-bayern.de:5005 -u $Script:idracuser -p $Script:idracpass serveraction powerdown)
|
||||
}
|
||||
})
|
||||
|
||||
$btn_r710_info.Add_Click({
|
||||
Write-Admin-Log "BTN r710 inspect pressed"
|
||||
if (confirm "Server R710 wird nach grundlegenden Infromationen abgefragt.`n`nDie Abfrage kann bis zu 2 min. dauern.") {
|
||||
get_r710_stats
|
||||
}
|
||||
})
|
||||
|
||||
### Öffnet erstes Fenster ###
|
||||
Write-Admin-Log "##### OPEN MAIN WINDOW #####"
|
||||
clearGUI
|
||||
switchGUI "m1"
|
||||
Write-Host $remotepass
|
||||
$main.ShowDialog() | Out-Null
|
||||
13
mc_shutdown.sh
Normal file
@@ -0,0 +1,13 @@
|
||||
sudo sshpass -p 'passwd' ssh -tt root@192.168.178.211<<EOT
|
||||
shutdown
|
||||
exit
|
||||
EOT
|
||||
echo "Done with first one"
|
||||
sleep 60
|
||||
echo "60s passed"
|
||||
sleep 60
|
||||
echo "Second one starts now"
|
||||
sudo sshpass -p 'passwd' ssh -tt root@192.168.178.202<<EOT
|
||||
shutdown
|
||||
exit
|
||||
EOT
|
||||
841
new_GUI.ps1
Normal file
@@ -0,0 +1,841 @@
|
||||
$Script:Version = "FS Admin Panel v0.8"
|
||||
#Ersteller: Florian Späth
|
||||
#Diese Software soll helfen die verschiedensten Anwendungen und Scripte der FG HDS zu administrieren.
|
||||
|
||||
Add-Type -AssemblyName PresentationFramework
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
[System.Reflection.Assembly]::LoadWithPartialName('System.Drawing') | Out-Null
|
||||
|
||||
### Variablen Definition ###
|
||||
# array = Settings ,
|
||||
$script:array=@($false,$true)
|
||||
|
||||
|
||||
function getValues($formTitle, $textTitle){
|
||||
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing")
|
||||
[void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms")
|
||||
|
||||
$objForm = New-Object System.Windows.Forms.Form
|
||||
$objForm.Text = $formTitle
|
||||
$objForm.Size = New-Object System.Drawing.Size(300,200)
|
||||
$objForm.StartPosition = "CenterScreen"
|
||||
|
||||
$objForm.KeyPreview = $True
|
||||
$objForm.Add_KeyDown({if ($_.KeyCode -eq "Enter") {$x=$objTextBox.Text;$objForm.Close()}})
|
||||
$objForm.Add_KeyDown({if ($_.KeyCode -eq "Escape") {$objForm.Close()}})
|
||||
|
||||
$OKButton = New-Object System.Windows.Forms.Button
|
||||
$OKButton.Location = New-Object System.Drawing.Size(75,120)
|
||||
$OKButton.Size = New-Object System.Drawing.Size(75,23)
|
||||
$OKButton.Text = "OK"
|
||||
$OKButton.Add_Click({$Script:userInput=$objTextBox.Text;$objForm.Close()})
|
||||
$objForm.Controls.Add($OKButton)
|
||||
|
||||
$CANCELButton = New-Object System.Windows.Forms.Button
|
||||
$CANCELButton.Location = New-Object System.Drawing.Size(150,120)
|
||||
$CANCELButton.Size = New-Object System.Drawing.Size(75,23)
|
||||
$CANCELButton.Text = "CANCEL"
|
||||
$CANCELButton.Add_Click({$objForm.Close()})
|
||||
$objForm.Controls.Add($CANCELButton)
|
||||
|
||||
$objLabel = New-Object System.Windows.Forms.Label
|
||||
$objLabel.Location = New-Object System.Drawing.Size(10,20)
|
||||
$objLabel.Size = New-Object System.Drawing.Size(280,30)
|
||||
$objLabel.Text = $textTitle
|
||||
$objForm.Controls.Add($objLabel)
|
||||
|
||||
$objTextBox = New-Object System.Windows.Forms.TextBox
|
||||
$objTextBox.Location = New-Object System.Drawing.Size(10,50)
|
||||
$objTextBox.Size = New-Object System.Drawing.Size(260,20)
|
||||
$objForm.Controls.Add($objTextBox)
|
||||
|
||||
$objForm.Topmost = $True
|
||||
|
||||
$objForm.Add_Shown({$objForm.Activate()})
|
||||
|
||||
[void] $objForm.ShowDialog()
|
||||
|
||||
return $userInput
|
||||
}
|
||||
|
||||
### $schema = getValues "Database Schema" "Enter database schema"
|
||||
|
||||
|
||||
#### Lädt Scripte ####
|
||||
|
||||
function Load_main {
|
||||
[XML]$Form = @"
|
||||
<?xaml encoding="utf-8"?>
|
||||
<Window
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WpfApp1"
|
||||
Title="MainWindow" Height="960" Width="1442" Background="#1a1a1a" ResizeMode="NoResize" WindowStyle="None">
|
||||
<Grid>
|
||||
<Border BorderBrush="Gray" BorderThickness="0.5,0.5,0.5,0.5" Height="93" VerticalAlignment="Top" Margin="10,821,0,0"/>
|
||||
<Label HorizontalAlignment="Left" VerticalAlignment="Top" Width="108" Height="950" FontSize="12" BorderBrush="Gray" Background="#0a0a0a" Foreground="White" Margin="1,10,0,0"/>
|
||||
<Label HorizontalAlignment="Center" VerticalAlignment="Top" Width="1442" Height="76" FontSize="12" BorderBrush="Gray" Background="#0a0a0a" Foreground="White"/>
|
||||
<Border BorderBrush="Gray" BorderThickness="0.5,0.5,0.5,0.5" Height="914" VerticalAlignment="Top" Margin="1372,0,0,0"/>
|
||||
<Button TabIndex="1" Name="menu1" BorderThickness="0" HorizontalAlignment="Left" Margin="20,109,0,0" VerticalAlignment="Top" Width="70" Height="70" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img1" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="menu2" BorderThickness="0" HorizontalAlignment="Left" Margin="20,199,0,0" VerticalAlignment="Top" Width="70" Height="70" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img2" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="menu3" BorderThickness="0" HorizontalAlignment="Left" Margin="20,289,0,0" VerticalAlignment="Top" Width="70" Height="70" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img3" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="menu4" BorderThickness="0" HorizontalAlignment="Left" Margin="20,382,0,0" VerticalAlignment="Top" Width="70" Height="70" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img4" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="menu5" BorderThickness="0" HorizontalAlignment="Left" Margin="20,475,0,0" VerticalAlignment="Top" Width="70" Height="70" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img5" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="menu6" BorderThickness="0" HorizontalAlignment="Left" Margin="20,567,0,0" VerticalAlignment="Top" Width="70" Height="70" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img6" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button Name="btninfo" HorizontalAlignment="Left" Margin="31,844,0,0" VerticalAlignment="Top" Width="48" Height="48" BorderThickness="0" Background="#292929" FontSize="40" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="imginfo" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="4" x:Name="btnsettings" BorderThickness="0" HorizontalAlignment="Left" Margin="1291,833,0,0" VerticalAlignment="Top" Width="67" Height="70" FontSize="40" Background="#292929" Foreground="White" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="imgsettings" Source="{Binding}"/>
|
||||
</Button>
|
||||
<TextBox Name="log" Text="" BorderThickness="0" HorizontalAlignment="Left" Height="465" Margin="962,100,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="396" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="14" IsTabStop="False"/>
|
||||
<Label Name="l1" Content="" HorizontalAlignment="Left" VerticalAlignment="Top" Width="599" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White" FontSize="22" FontWeight="Medium" Margin="152,37,0,0" Height="44"/>
|
||||
<TextBlock Name="work" Text="" HorizontalAlignment="Left" Margin="1314,10,0,0" TextWrapping="Wrap" Foreground="White" Background="Darkgreen" IsEnabled="false" Width="44" TextAlignment="Center" Height="52" VerticalAlignment="Top" FontSize="16"/>
|
||||
|
||||
<Button TabIndex="1" x:Name="btn_settings" Content="Standby" BorderThickness="0" HorizontalAlignment="Left" Visibility = "Hidden" Margin="1248,697,0,0" VerticalAlignment="Top" Width="119" Height="26" FontSize="13" Foreground="LightGray" Background="#292929" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_standby" Content="Standby" BorderThickness="0" HorizontalAlignment="Left" Visibility = "Hidden" Margin="1248,728,0,0" VerticalAlignment="Top" Width="119" Height="26" FontSize="13" Foreground="LightGray" Background="#292929" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_shutdown" Content="Shutdown" BorderThickness="0" HorizontalAlignment="Left" Visibility = "Hidden" Margin="1248,759,0,0" VerticalAlignment="Top" Width="119" Height="26" FontSize="13" Foreground="LightGray" Background="#292929" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_close" Content="Close" BorderThickness="0" HorizontalAlignment="Left" Visibility = "Hidden" Margin="1248,790,0,0" VerticalAlignment="Top" Width="119" Height="26" FontSize="13" Foreground="LightGray" Background="#292929" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
|
||||
|
||||
<TextBox x:Name="chatwithme_output" Text="" BorderThickness="0" HorizontalAlignment="Left" Height="654" Margin="138,100,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="794" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="14" IsTabStop="False"/>
|
||||
<TextBox TabIndex="1" x:Name="chatwithme_input" Text="" BorderThickness="0" HorizontalAlignment="Left" Height="44" Margin="138,765,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="794" IsEnabled="true" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="14" IsTabStop="False"/>
|
||||
<Button TabIndex="2" x:Name="chatwithme_send" Content="Send" BorderThickness="0" HorizontalAlignment="Left" Margin="962,765,0,0" VerticalAlignment="Top" Width="100" Height="44" FontSize="20" Background="#292929" Foreground="White" FontWeight="Medium" RenderTransformOrigin="0.5,0.5"/>
|
||||
|
||||
<Button TabIndex="1" x:Name="btn_r710_stop" BorderThickness="0" HorizontalAlignment="Left" Margin="725,100,0,0" VerticalAlignment="Top" Width="100" Height="100" FontSize="13" Background="DarkRed" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_r710_m2" BorderThickness="0" HorizontalAlignment="Left" Margin="725,215,0,0" VerticalAlignment="Top" Width="99" Height="100" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_r710_m1" BorderThickness="0" HorizontalAlignment="Left" Margin="836,215,0,0" VerticalAlignment="Top" Width="99" Height="100" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_r710_info" BorderThickness="0" HorizontalAlignment="Left" Margin="594,100,0,0" VerticalAlignment="Top" Width="100" Height="100" FontSize="13" Background="DarkOrange" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" Name="btn_r710_start" BorderThickness="0" HorizontalAlignment="Left" Margin="836,100,0,0" VerticalAlignment="Top" Width="99" Height="100" FontSize="13" Background="DarkGreen" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img_r710_start" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Label Name="l1_R710" HorizontalAlignment="Left" Content="Power:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="206,98,0,0"/>
|
||||
<TextBox x:Name="tb_r710_power" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="340,98,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
<Label Name="l2_R710" HorizontalAlignment="Left" Content="MAC:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="206,137,0,0"/>
|
||||
<TextBox x:Name="tb_r710_mac" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="342,137,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
<Label Name="l3_R710" HorizontalAlignment="Left" Content="IP:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="206,176,0,0"/>
|
||||
<TextBox x:Name="tb_r710_ip" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="342,176,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
<Label Name="l4_R710" HorizontalAlignment="Left" Content="BIOS:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="206,215,0,0"/>
|
||||
<TextBox x:Name="tb_r710_bios" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="342,215,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
<Label Name="l5_R710" HorizontalAlignment="Left" Content="RAC Name:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="206,254,0,0"/>
|
||||
<TextBox x:Name="tb_r710_name" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="342,254,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
|
||||
|
||||
|
||||
|
||||
<Button TabIndex="1" x:Name="btn_center_megstop" BorderThickness="0" HorizontalAlignment="Left" Margin="725,100,0,0" VerticalAlignment="Top" Width="100" Height="100" FontSize="13" Background="DarkRed" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_center_m2" BorderThickness="0" HorizontalAlignment="Left" Margin="725,332,0,0" VerticalAlignment="Top" Width="99" Height="100" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_center_m1" BorderThickness="0" HorizontalAlignment="Left" Margin="836,332,0,0" VerticalAlignment="Top" Width="99" Height="100" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_center_info" BorderThickness="0" HorizontalAlignment="Left" Margin="836,445,0,0" VerticalAlignment="Top" Width="100" Height="100" FontSize="13" Background="DarkOrange" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" Name="btn_center_megstart" BorderThickness="0" HorizontalAlignment="Left" Margin="836,100,0,0" VerticalAlignment="Top" Width="99" Height="100" FontSize="13" Background="DarkGreen" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img_center_megstart" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_center_itmstop" BorderThickness="0" HorizontalAlignment="Left" Margin="725,217,0,0" VerticalAlignment="Top" Width="100" Height="100" FontSize="13" Background="DarkRed" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_center_itmstart" BorderThickness="0" HorizontalAlignment="Left" Margin="836,217,0,0" VerticalAlignment="Top" Width="99" Height="100" FontSize="13" Background="DarkGreen" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img_center_itmstart" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Label Name="l1_center" HorizontalAlignment="Left" Content="Power MEG:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="127,100,0,0"/>
|
||||
<TextBox x:Name="tb1_center" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="261,100,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
<Label Name="l2_center" HorizontalAlignment="Left" Content="Power ITM:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="127,139,0,0"/>
|
||||
<TextBox x:Name="tb2_center" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="263,139,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
<Label Name="l3_center" HorizontalAlignment="Left" Content="Power PiHole:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="127,178,0,0"/>
|
||||
<TextBox x:Name="tb3_center" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="263,178,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
<Label Name="l4_center" HorizontalAlignment="Left" Content="Power RPi4:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="127,217,0,0"/>
|
||||
<TextBox x:Name="tb4_center" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="263,217,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
<Label Name="l5_center" HorizontalAlignment="Left" Content="RAC Name:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="127,256,0,0"/>
|
||||
<TextBox x:Name="tb5_center" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="263,256,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
<Label x:Name="l6_center" HorizontalAlignment="Left" Content="MEG Control:
Ryzen 7 3800X
32GB RAM
4TB M.2 SSD" HorizontalContentAlignment="Center" VerticalAlignment="Top" Visibility="Visible" Width="197" Height="100" FontSize="16" BorderBrush="Gray" Foreground="White" Margin="502,100,0,0"/>
|
||||
<Label x:Name="l7_center" HorizontalAlignment="Left" Content="ITM Control:
I9 ???
16GB RAM
1TB SSD" HorizontalContentAlignment="Center" VerticalAlignment="Top" Visibility="Visible" Width="197" Height="100" FontSize="16" BorderBrush="Gray" Foreground="White" Margin="502,217,0,0"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
"@
|
||||
|
||||
# Lädt das Fenster
|
||||
$window=[Windows.Markup.XamlReader]::Load((New-Object System.Xml.XmlNodeReader $Form))
|
||||
|
||||
# Objekt - Variablen Verknüpfung
|
||||
#Main
|
||||
$Script:menu1 = $window.findName("menu1")
|
||||
$Script:menu2 = $window.findName("menu2")
|
||||
$Script:menu3 = $window.findName("menu3")
|
||||
$Script:menu4 = $window.findName("menu4")
|
||||
$Script:menu5 = $window.findName("menu5")
|
||||
$Script:menu6 = $window.findName("menu6")
|
||||
$Script:img1 = $window.findName("img1")
|
||||
$Script:img2 = $window.findName("img2")
|
||||
$Script:img3 = $window.findName("img3")
|
||||
$Script:img4 = $window.findName("img4")
|
||||
$Script:img5 = $window.findName("img5")
|
||||
$Script:img6 = $window.findName("img6")
|
||||
$Script:btn_info = $window.findName("btninfo")
|
||||
$Script:settings = $window.findName("btnsettings")
|
||||
$Script:imginfo = $window.findName("imginfo")
|
||||
$Script:imgsettings = $window.findName("imgsettings")
|
||||
$Script:l1 = $window.findName("l1")
|
||||
$Script:log = $window.findName("log")
|
||||
$Script:work = $window.findName("work")
|
||||
$Script:btn_standby = $window.findName("btn_standby")
|
||||
$Script:btn_shutdown = $window.findName("btn_shutdown")
|
||||
$Script:btn_settings = $window.findName("btn_settings")
|
||||
$Script:btn_close = $window.findName("btn_close")
|
||||
|
||||
#KI Endpoint
|
||||
$Script:chatwithme_output = $window.findName("chatwithme_output")
|
||||
$Script:chatwithme_input = $window.findName("chatwithme_input")
|
||||
$Script:chatwithme_send = $window.findName("chatwithme_send")
|
||||
|
||||
#R710
|
||||
$Script:btn_r710_stop = $window.findName("btn_r710_stop")
|
||||
$Script:btn_r710_start = $window.findName("btn_r710_start")
|
||||
$Script:img_r710_start = $window.findName("img_r710_start")
|
||||
$Script:btn_r710_info = $window.findName("btn_r710_info")
|
||||
$Script:btn_r710_m1 = $window.findname("btn_r710_m1")
|
||||
$Script:btn_r710_m2 = $window.findname("btn_r710_m2")
|
||||
|
||||
$Script:tb_r710_power = $window.findname("tb_r710_power")
|
||||
$Script:tb_r710_mac = $window.findname("tb_r710_mac")
|
||||
$Script:tb_r710_ip = $window.findname("tb_r710_ip")
|
||||
$Script:tb_r710_bios = $window.findname("tb_r710_bios")
|
||||
$Script:tb_r710_name = $window.findname("tb_r710_name")
|
||||
|
||||
$Script:l1_r710 = $window.findname("l1_R710")
|
||||
$Script:l2_r710 = $window.findname("l2_R710")
|
||||
$Script:l3_r710 = $window.findname("l3_R710")
|
||||
$Script:l4_r710 = $window.findname("l4_R710")
|
||||
$Script:l5_r710 = $window.findname("l5_R710")
|
||||
|
||||
#Center
|
||||
$Script:btn_center_megstop = $window.findName("btn_center_megstop")
|
||||
$Script:btn_center_megstart = $window.findName("btn_center_megstart")
|
||||
$Script:img_center_megstart = $window.findName("img_center_megstart")
|
||||
$Script:btn_center_info = $window.findName("btn_center_info")
|
||||
$Script:btn_center_itmstop = $window.findName("btn_center_itmstop")
|
||||
$Script:btn_center_itmstart = $window.findName("btn_center_itmstart")
|
||||
$Script:img_center_itmstart = $window.findName("img_center_itmstart")
|
||||
$Script:btn_center_m1 = $window.findname("btn_center_m1")
|
||||
$Script:btn_center_m2 = $window.findname("btn_center_m2")
|
||||
|
||||
$Script:tb1_center = $window.findname("tb1_center")
|
||||
$Script:tb2_center = $window.findname("tb2_center")
|
||||
$Script:tb3_center = $window.findname("tb3_center")
|
||||
$Script:tb4_center = $window.findname("tb4_center")
|
||||
$Script:tb5_center = $window.findname("tb5_center")
|
||||
|
||||
$Script:l1_center = $window.findname("l1_center")
|
||||
$Script:l2_center = $window.findname("l2_center")
|
||||
$Script:l3_center = $window.findname("l3_center")
|
||||
$Script:l4_center = $window.findname("l4_center")
|
||||
$Script:l5_center = $window.findname("l5_center")
|
||||
$Script:l6_center = $window.findname("l6_center")
|
||||
$Script:l7_center = $window.findname("l7_center")
|
||||
|
||||
# Fensterwahl
|
||||
#if (condition) {
|
||||
#$window.Height="912"
|
||||
#$window.Width="1370"
|
||||
#$window.WindowStyle="None"
|
||||
#$window.WindowState="Maximized"
|
||||
|
||||
#$window.Height="912"
|
||||
#$window.Width="1370"
|
||||
#$window.WindowStyle="SingleBorderWindow"
|
||||
#$window.WindowState="Normal"
|
||||
#}
|
||||
|
||||
# Verknüpft feste Elemente
|
||||
$window.Title = $Script:Version
|
||||
$window.icon="$PSScriptroot/Source/Logo.png"
|
||||
$imginfo.Source = "$PSScriptroot/Source/info.png"
|
||||
$imgsettings.Source = "$PSScriptroot/Source/Konfig.png"
|
||||
$img1.Source = "$PSScriptroot/Source/Dash.png"
|
||||
$img2.Source = "$PSScriptroot/Source/Server.png"
|
||||
$img3.Source = "$PSScriptroot/Source/center.png"
|
||||
$img_center_megstart.Source ="$PSScriptroot/Source/Start.png"
|
||||
$img_center_itmstart.Source ="$PSScriptroot/Source/Start.png"
|
||||
$img_r710_start.Source ="$PSScriptroot/Source/Start.png"
|
||||
return $window
|
||||
}
|
||||
|
||||
$Script:main = Load_main # Variable: $main
|
||||
|
||||
. $PSScriptRoot\GUIS\info.ps1 $PSSCriptRoot
|
||||
. $PSSCriptRoot\GUIS\confirm.ps1 $PSScriptRoot
|
||||
|
||||
#### Definition globaler Variablen ####
|
||||
|
||||
## Die GO variable kann nach aufruf der confirm funktion abgefragt werden, um eine 2. Bestätigung der eingabe zu erhalten. (Aufruf: confirm $text)
|
||||
[boolean]$Script:GO = $false
|
||||
|
||||
$Script:ScriptRoot = $PSScriptRoot
|
||||
$Script:iconpath = "$PSScriptRoot\icons"
|
||||
$Script:config = Import-CSV -Path "$PSScriptRoot\config.csv"
|
||||
$Script:RACpath = ($config | where{$_.ID -eq "racadm_path"}).value
|
||||
$Script:plinkpath = ($config | where{$_.ID -eq "plink_path"}).value
|
||||
$Script:idracuser = ($config | where{$_.ID -eq "idracuser"}).value
|
||||
$Script:idracpass = ($config | where{$_.ID -eq "idracpass"}).value
|
||||
if($Script:idracpass -eq ""){
|
||||
$idracuser = getValues "IDRAC Configurator" "Enter idrac user"
|
||||
$idracpass = getValues "IDRAC Configurator" "Enter idrac password"
|
||||
$NewLine = "idracuser, $idracuser" -f
|
||||
$NewLine | add-content -path "$PSScriptRoot\config.csv"
|
||||
$NewLine = "idracpass, $idracpass" -f
|
||||
$NewLine | add-content -path "$PSScriptRoot\config.csv"
|
||||
}
|
||||
write-host $Script:idracuser
|
||||
Write-host $Script:idracpass
|
||||
|
||||
#$Script:cert_path = ($config | where{$_.ID -eq "some"}).value
|
||||
#$Script:defudbu_path = ($config | where{$_.ID -eq "some"}).value
|
||||
$logfile = "$PSScriptRoot\log.txt"
|
||||
|
||||
### Farb Variablen ###
|
||||
|
||||
$Script:Standardbtncolor = "#00b8d4"
|
||||
$Script:Delcolor = "#d50000"
|
||||
$Script:BackgroundMovecolor = "#FFFFEB9C"
|
||||
$Script:ForegroundMovecolor = "#FF9C6500"
|
||||
$Script:Foregroundgrey = "#FF7A7A7A"
|
||||
$Script:Backgroundgrey = "#FFC5C5C5"
|
||||
|
||||
#### Funktionen ####
|
||||
### Global ###
|
||||
|
||||
function Write-Admin-Log{
|
||||
Param($text)
|
||||
"$(get-date -format "yyyy-MM-dd HH:mm:ss"): $($text)" | out-file $logfile -Append
|
||||
$log.content += "$text `n"
|
||||
}
|
||||
|
||||
function Resolve-DnsName {
|
||||
param (
|
||||
[Parameter(Mandatory)][string]$ComputerName
|
||||
)
|
||||
try {
|
||||
[System.Net.Dns]::GetHostAddresses($ComputerName).IPAddressToString
|
||||
return ([System.Net.Dns]::GetHostAddresses($ComputerName).IPAddressToString)
|
||||
}
|
||||
catch {
|
||||
Write-Log "IP not found for $ComputerName!"
|
||||
}
|
||||
}
|
||||
|
||||
Function Select-FolderDialog{
|
||||
param([string]$Description="Zielverzeichnis wählen",[string]$RootFolder="Desktop")
|
||||
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") |Out-Null
|
||||
$objForm = New-Object System.Windows.Forms.FolderBrowserDialog
|
||||
$objForm.Rootfolder = $RootFolder
|
||||
$objForm.Description = $Description
|
||||
$Show = $objForm.ShowDialog()
|
||||
If ($Show -eq "OK"){
|
||||
Return $objForm.SelectedPath
|
||||
}else{
|
||||
Return $false
|
||||
}
|
||||
}
|
||||
|
||||
function working {
|
||||
param (
|
||||
$status
|
||||
)
|
||||
if ($status) {
|
||||
$Script:work.Background="Darkred"
|
||||
}else {
|
||||
$Script:work.Background="Darkgreen"
|
||||
}
|
||||
}
|
||||
|
||||
#### Startet die Anwendung ####
|
||||
|
||||
### Initialisieren ###
|
||||
|
||||
$Script:btn_info.Add_Click({
|
||||
$Script:info.ShowDialog()
|
||||
})
|
||||
|
||||
### Settings ###
|
||||
|
||||
$settings.Add_Click({
|
||||
if ($Script:array[0]) {
|
||||
$Script:btn_settings.Visibility = "Hidden"
|
||||
$Script:btn_standby.Visibility = "Hidden"
|
||||
$Script:btn_shutdown.Visibility = "Hidden"
|
||||
$Script:btn_close.Visibility = "Hidden"
|
||||
$Script:array[0]=$false
|
||||
}else {
|
||||
$Script:btn_settings.Visibility = "Visible"
|
||||
$Script:btn_standby.Visibility = "Visible"
|
||||
$Script:btn_shutdown.Visibility = "Visible"
|
||||
$Script:btn_close.Visibility = "Visible"
|
||||
$Script:array[0]=$true
|
||||
}
|
||||
})
|
||||
|
||||
$Script:btn_settings.Add_Click({
|
||||
|
||||
|
||||
})
|
||||
$Script:btn_standby.Add_Click({
|
||||
if (confirm "Wanna SUSPEND the System?") {
|
||||
$PowerState = [System.Windows.Forms.PowerState]::Suspend
|
||||
$Force = $false
|
||||
$DisableWake = $false
|
||||
[System.Windows.Forms.Application]::SetSuspendState($PowerState, $Force, $DisableWake)
|
||||
}
|
||||
})
|
||||
$Script:btn_shutdown.Add_Click({
|
||||
if (confirm "Wanna SHUTDOWN the System?") {
|
||||
$PowerState = [System.Windows.Forms.PowerState]::Shutdown
|
||||
$Force = $false
|
||||
$DisableWake = $false
|
||||
[System.Windows.Forms.Application]::SetSuspendState($PowerState, $Force, $DisableWake)
|
||||
}
|
||||
})
|
||||
$Script:btn_close.Add_Click({
|
||||
$main.Hide()
|
||||
})
|
||||
|
||||
### Menu ###
|
||||
|
||||
function clearGUI {
|
||||
#KI
|
||||
$Script:chatwithme_output.Visibility = "Hidden"
|
||||
$Script:chatwithme_input.Visibility = "Hidden"
|
||||
$Script:chatwithme_send.Visibility = "Hidden"
|
||||
|
||||
#R710
|
||||
|
||||
$Script:btn_r710_stop.Visibility = "Hidden"
|
||||
$Script:btn_r710_start.Visibility = "Hidden"
|
||||
$Script:btn_r710_info.Visibility = "Hidden"
|
||||
$Script:btn_r710_m1.Visibility = "Hidden"
|
||||
$Script:btn_r710_m2.Visibility = "Hidden"
|
||||
|
||||
$Script:tb_r710_power.Visibility = "Hidden"
|
||||
$Script:tb_r710_mac.Visibility = "Hidden"
|
||||
$Script:tb_r710_ip.Visibility = "Hidden"
|
||||
$Script:tb_r710_bios.Visibility = "Hidden"
|
||||
$Script:tb_r710_name.Visibility = "Hidden"
|
||||
|
||||
$Script:l1_r710.Visibility = "Hidden"
|
||||
$Script:l2_r710.Visibility = "Hidden"
|
||||
$Script:l3_r710.Visibility = "Hidden"
|
||||
$Script:l4_r710.Visibility = "Hidden"
|
||||
$Script:l5_r710.Visibility = "Hidden"
|
||||
|
||||
#Center
|
||||
|
||||
$Script:btn_center_megstop.Visibility = "Hidden"
|
||||
$Script:btn_center_megstart.Visibility = "Hidden"
|
||||
$Script:btn_center_info.Visibility = "Hidden"
|
||||
$Script:btn_center_itmstop.Visibility = "Hidden"
|
||||
$Script:btn_center_itmstart.Visibility = "Hidden"
|
||||
$Script:btn_center_m1.Visibility = "Hidden"
|
||||
$Script:btn_center_m2.Visibility = "Hidden"
|
||||
|
||||
$Script:tb1_center.Visibility = "Hidden"
|
||||
$Script:tb2_center.Visibility = "Hidden"
|
||||
$Script:tb3_center.Visibility = "Hidden"
|
||||
$Script:tb4_center.Visibility = "Hidden"
|
||||
$Script:tb5_center.Visibility = "Hidden"
|
||||
|
||||
$Script:l1_center.Visibility = "Hidden"
|
||||
$Script:l2_center.Visibility = "Hidden"
|
||||
$Script:l3_center.Visibility = "Hidden"
|
||||
$Script:l4_center.Visibility = "Hidden"
|
||||
$Script:l5_center.Visibility = "Hidden"
|
||||
$Script:l6_center.Visibility = "Hidden"
|
||||
$Script:l7_center.Visibility = "Hidden"
|
||||
}
|
||||
|
||||
function SwitchGUI {
|
||||
param (
|
||||
$menu
|
||||
)
|
||||
if ($menu -match "m1") {
|
||||
clearGUI
|
||||
$Script:chatwithme_output.Visibility = "Visible"
|
||||
$Script:chatwithme_input.Visibility = "Visible"
|
||||
$Script:chatwithme_send.Visibility = "Visible"
|
||||
}elseif ($menu -match "m2") {
|
||||
clearGUI
|
||||
$Script:btn_r710_stop.Visibility = "Visible"
|
||||
$Script:btn_r710_start.Visibility = "Visible"
|
||||
$Script:btn_r710_info.Visibility = "Visible"
|
||||
$Script:btn_r710_m1.Visibility = "Visible"
|
||||
$Script:btn_r710_m2.Visibility = "Visible"
|
||||
|
||||
$Script:tb_r710_power.Visibility = "Visible"
|
||||
$Script:tb_r710_mac.Visibility = "Visible"
|
||||
$Script:tb_r710_ip.Visibility = "Visible"
|
||||
$Script:tb_r710_bios.Visibility = "Visible"
|
||||
$Script:tb_r710_name.Visibility = "Visible"
|
||||
|
||||
$Script:l1_r710.Visibility = "Visible"
|
||||
$Script:l2_r710.Visibility = "Visible"
|
||||
$Script:l3_r710.Visibility = "Visible"
|
||||
$Script:l4_r710.Visibility = "Visible"
|
||||
$Script:l5_r710.Visibility = "Visible"
|
||||
}elseif ($menu -match "m3") {
|
||||
clearGUI
|
||||
$Script:btn_center_megstop.Visibility = "Visible"
|
||||
$Script:btn_center_megstart.Visibility = "Visible"
|
||||
$Script:btn_center_info.Visibility = "Visible"
|
||||
$Script:btn_center_itmstop.Visibility = "Visible"
|
||||
$Script:btn_center_itmstart.Visibility = "Visible"
|
||||
$Script:btn_center_m1.Visibility = "Visible"
|
||||
$Script:btn_center_m2.Visibility = "Visible"
|
||||
|
||||
$Script:tb1_center.Visibility = "Visible"
|
||||
$Script:tb2_center.Visibility = "Visible"
|
||||
$Script:tb3_center.Visibility = "Visible"
|
||||
$Script:tb4_center.Visibility = "Visible"
|
||||
$Script:tb5_center.Visibility = "Visible"
|
||||
|
||||
$Script:l1_center.Visibility = "Visible"
|
||||
$Script:l2_center.Visibility = "Visible"
|
||||
$Script:l3_center.Visibility = "Visible"
|
||||
$Script:l4_center.Visibility = "Visible"
|
||||
$Script:l5_center.Visibility = "Visible"
|
||||
$Script:l6_center.Visibility = "Visible"
|
||||
$Script:l7_center.Visibility = "Visible"
|
||||
}elseif ($menu -match "m4") {
|
||||
clearGUI
|
||||
}elseif ($menu -match "m5") {
|
||||
clearGUI
|
||||
}elseif ($menu -match "m6") {
|
||||
clearGUI
|
||||
}
|
||||
}
|
||||
|
||||
$Script:menu1.Add_Click({
|
||||
switchGUI -menu "m1"
|
||||
$Script:l1.Content = "Local LLM"
|
||||
})
|
||||
$Script:menu2.Add_Click({
|
||||
switchGUI -menu "m2"
|
||||
$Script:l1.Content = "R710 Control"
|
||||
})
|
||||
$Script:menu3.Add_Click({
|
||||
switchGUI -menu "m3"
|
||||
$Script:l1.Content = "Gaming Control"
|
||||
})
|
||||
$Script:menu4.Add_Click({
|
||||
switchGUI -menu "m4"
|
||||
})
|
||||
$Script:menu5.Add_Click({
|
||||
switchGUI -menu "m5"
|
||||
})
|
||||
$Script:menu6.Add_Click({
|
||||
switchGUI -menu "m6"
|
||||
})
|
||||
|
||||
### ChatWithMe ###
|
||||
|
||||
$Script:chatwithme_input.Add_KeyDown({
|
||||
if ($_.Key -eq "Enter") {
|
||||
$payload = @{
|
||||
model="Mini Orca (Small)"
|
||||
messages = @(@{
|
||||
role = "user"
|
||||
content = "$($Script:chatwithme_input.text)"
|
||||
}
|
||||
)
|
||||
max_tokens = 2048
|
||||
temperature = 0.7
|
||||
}
|
||||
|
||||
$json = ($payload | ConvertTo-Json -Depth 6 -compress)
|
||||
$response = (Invoke-WebRequest -URI http://192.168.178.182:4891/v1/chat/completions -Method POST -ContentType application/json -Body $json)
|
||||
$content = $response.Content
|
||||
$index = ($content.IndexOf("content"))+10
|
||||
$second_index = $content.Substring($index).IndexOf("role")-3
|
||||
$cutdown= $content.Substring($index, $second_index)
|
||||
$Script:chatwithme_output.Text = $cutdown.replace("/n", "
")
|
||||
}
|
||||
})
|
||||
|
||||
$Script:chatwithme_send.Add_Click({
|
||||
$payload = @{
|
||||
model="Mini Orca (Small)"
|
||||
messages = @(@{
|
||||
role = "user"
|
||||
content = "$($Script:chatwithme_input.text)"
|
||||
}
|
||||
)
|
||||
max_tokens = 2048
|
||||
temperature = 0.7
|
||||
}
|
||||
|
||||
$json = ($payload | ConvertTo-Json -Depth 6 -compress)
|
||||
$response = (Invoke-WebRequest -URI http://192.168.178.182:4891/v1/chat/completions -Method POST -ContentType application/json -Body $json)
|
||||
$content = $response.Content
|
||||
$index = ($content.IndexOf("content"))+10
|
||||
$second_index = $content.Substring($index).IndexOf("role")-3
|
||||
$cutdown= $content.Substring($index, $second_index)
|
||||
$Script:chatwithme_output.Text = $cutdown.replace("/n", "
")
|
||||
})
|
||||
|
||||
### R710 ###
|
||||
|
||||
function get_r710_stats {
|
||||
working $true
|
||||
cd $Script:racpath
|
||||
$collection = $(.\racadm.exe -r spaeth-bayern.de:5005 -u root -p "kt}y/6ZHF~.@" getsysinfo)
|
||||
foreach ($item in $collection) {
|
||||
if ($null -ne $item) {
|
||||
$log.Text += "$item`n"
|
||||
if($item -match "DNS RAC Name"){
|
||||
$index = ($item.IndexOf("="))
|
||||
$Script:tb_r710_name.Text = $item.Substring($index+1)
|
||||
}
|
||||
if($item -match "Firmware Version"){
|
||||
$index = ($item.IndexOf("="))
|
||||
$Script:tb_r710_bios.Text = $item.Substring($index+1)
|
||||
}
|
||||
if($item -match "Power Status"){
|
||||
$index = ($item.IndexOf("="))
|
||||
$Script:tb_r710_power.Text = $item.Substring($index+1)
|
||||
}
|
||||
if($item -match "MAC Address"){
|
||||
$index = ($item.IndexOf("="))
|
||||
$Script:tb_r710_mac.Text = $item.Substring($index+1)
|
||||
}
|
||||
if($item -match "Power Status"){
|
||||
$index = ($item.IndexOf("="))
|
||||
$Script:tb_r710_power.Text = $item.Substring($index+1)
|
||||
}
|
||||
}
|
||||
}
|
||||
cd $PSSCriptRoot
|
||||
working $false
|
||||
}
|
||||
|
||||
$btn_r710_start.Add_Click({
|
||||
Write-Admin-Log "BTN r710 start pressed"
|
||||
if (confirm "Server R710 wird durch erneute betätigung gestartet") {
|
||||
cd $racpath
|
||||
$r710_log.Text += $(.\racadm.exe -r spaeth-bayern.de:5005 -u root -p "kt}y/6ZHF~.@" serveraction powerup)
|
||||
}
|
||||
})
|
||||
|
||||
$btn_r710_stop.Add_Click({
|
||||
Write-Admin-Log "BTN r710 stop pressed"
|
||||
if (confirm "Server R710 wird durch erneute betätigung gestopt`n`nSind alle Virtuelle Maschinen ausgeschaltet?") {
|
||||
cd $Script:racpath
|
||||
$r710_log.Text += $(.\racadm.exe -r spaeth-bayern.de:5005 -u root -p "kt}y/6ZHF~.@" serveraction powerdown)
|
||||
}
|
||||
})
|
||||
|
||||
$btn_r710_info.Add_Click({
|
||||
Write-Admin-Log "BTN r710 inspect pressed"
|
||||
get_r710_stats
|
||||
})
|
||||
|
||||
#Center
|
||||
|
||||
$Script:btn_center_itmstart.Add_Click({
|
||||
$Password = "Ob>Q%T\;Cf(9\+T+-7lNQl*i*)(3;Egl"
|
||||
$servername = '192.168.178.4'
|
||||
$username = 'spaethf'
|
||||
Write-Admin-Log "BTN ITM pressed"
|
||||
if (confirm "Bei dem Server gaming Server ITM wird eine Power Aktion ausgeführt") {
|
||||
$command = 'python tap_itm.py'
|
||||
#Execute SSH command
|
||||
echo y | &($plinkpath + "\plink.exe") -pw $password $username@$servername $command
|
||||
}
|
||||
})
|
||||
|
||||
$Script:btn_center_itmstop.Add_Click({
|
||||
$Password = "Ob>Q%T\;Cf(9\+T+-7lNQl*i*)(3;Egl"
|
||||
$servername = '192.168.178.4'
|
||||
$username = 'spaethf'
|
||||
Write-Admin-Log "BTN ITM pressed"
|
||||
if (confirm "Bei dem Server gaming Server ITM wird eine Power Aktion ausgeführt") {
|
||||
$command = 'python tap_itm.py'
|
||||
#Execute SSH command
|
||||
echo y | &($plinkpath + "\plink.exe") -pw $password $username@$servername $command
|
||||
}
|
||||
})
|
||||
|
||||
|
||||
$Script:btn_center_megstart.Add_Click({
|
||||
$Password = "Ob>Q%T\;Cf(9\+T+-7lNQl*i*)(3;Egl"
|
||||
$servername = '192.168.178.4'
|
||||
$username = 'spaethf'
|
||||
Write-Admin-Log "BTN MEG pressed"
|
||||
if (confirm "Bei dem Server gaming Server MEG wird eine Power Aktion ausgeführt") {
|
||||
$command = 'python tap_meg.py'
|
||||
#Execute SSH command
|
||||
echo y | &($plinkpath + "\plink.exe") -pw $password $username@$servername $command
|
||||
}
|
||||
})
|
||||
|
||||
$Script:btn_center_megstop.Add_Click({
|
||||
$Password = "Ob>Q%T\;Cf(9\+T+-7lNQl*i*)(3;Egl"
|
||||
$servername = '192.168.178.4'
|
||||
$username = 'spaethf'
|
||||
Write-Admin-Log "BTN MEG pressed"
|
||||
if (confirm "Bei dem Server gaming Server MEG wird eine Power Aktion ausgeführt") {
|
||||
$command = 'python tap_meg.py'
|
||||
#Execute SSH command
|
||||
echo y | &($plinkpath + "\plink.exe") -pw $password $username@$servername $command
|
||||
}
|
||||
})
|
||||
|
||||
### Öffnet erstes Fenster ###
|
||||
Write-Admin-Log "##### OPEN MAIN WINDOW #####"
|
||||
clearGUI
|
||||
switchGUI "m1"
|
||||
$main.ShowDialog() | Out-Null
|
||||
165
new_GUI.xaml
Normal file
@@ -0,0 +1,165 @@
|
||||
<?xaml encoding="utf-8"?>
|
||||
<Window
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:local="clr-namespace:WpfApp1"
|
||||
Title="MainWindow" Height="960" Width="1442" Background="#1a1a1a" ResizeMode="NoResize" WindowStyle="None">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Border BorderBrush="Gray" BorderThickness="0.5,0.5,0.5,0.5" Height="93" VerticalAlignment="Top" Margin="2,821,-2,0"/>
|
||||
<Label VerticalAlignment="Center" Height="996" FontSize="12" Background="#0a0a0a" Foreground="White" BorderBrush="Gray" Margin="0,0,1256,0"/>
|
||||
<Label HorizontalAlignment="Center" VerticalAlignment="Top" Width="1442" Height="76" FontSize="12" BorderBrush="Gray" Background="#0a0a0a" Foreground="White"/>
|
||||
<Border BorderBrush="Gray" BorderThickness="0.5,0.5,0.5,0.5" Height="914" VerticalAlignment="Top" Margin="1372,0,0,0"/>
|
||||
<Button TabIndex="1" Name="menu1" BorderThickness="0" HorizontalAlignment="Left" Margin="20,109,0,0" VerticalAlignment="Top" Width="70" Height="70" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img1" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="menu2" BorderThickness="0" HorizontalAlignment="Left" Margin="20,199,0,0" VerticalAlignment="Top" Width="70" Height="70" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img2" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="menu3" BorderThickness="0" HorizontalAlignment="Left" Margin="20,289,0,0" VerticalAlignment="Top" Width="70" Height="70" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img3" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="menu4" BorderThickness="0" HorizontalAlignment="Left" Margin="20,382,0,0" VerticalAlignment="Top" Width="70" Height="70" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img4" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="menu5" BorderThickness="0" HorizontalAlignment="Left" Margin="20,475,0,0" VerticalAlignment="Top" Width="70" Height="70" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img5" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="menu6" BorderThickness="0" HorizontalAlignment="Left" Margin="20,567,0,0" VerticalAlignment="Top" Width="70" Height="70" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="img6" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button Name="btninfo" HorizontalAlignment="Left" Margin="31,844,0,0" VerticalAlignment="Top" Width="48" Height="48" BorderThickness="0" Background="#292929" FontSize="40" Foreground="White">
|
||||
<Button.Resources>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="imginfo" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="4" x:Name="btnsettings" BorderThickness="0" HorizontalAlignment="Left" Margin="1291,833,0,0" VerticalAlignment="Top" Width="67" Height="70" FontSize="40" Background="#292929" Foreground="White" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="2"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="imgsettings" Source="{Binding}"/>
|
||||
</Button>
|
||||
<TextBox Name="log" Text="" BorderThickness="0" HorizontalAlignment="Left" Height="465" Margin="962,100,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="396" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="14" IsTabStop="False"/>
|
||||
<Label Name="l1" Content="" HorizontalAlignment="Left" VerticalAlignment="Top" Width="599" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" Foreground="White" FontSize="12" FontWeight="Medium" Margin="152,37,0,0" Height="44"/>
|
||||
<TextBlock Name="work" Text="" HorizontalAlignment="Left" Margin="1314,10,0,0" TextWrapping="Wrap" Foreground="White" Background="Darkgreen" IsEnabled="false" Width="44" TextAlignment="Center" Height="52" VerticalAlignment="Top" FontSize="16"/>
|
||||
|
||||
<Button TabIndex="1" x:Name="btn_settings" Content="Standby" BorderThickness="0" HorizontalAlignment="Left" Visibility = "Hidden" Margin="1248,697,0,0" VerticalAlignment="Top" Width="119" Height="26" FontSize="13" Foreground="LightGray" Background="#292929" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_standby" Content="Standby" BorderThickness="0" HorizontalAlignment="Left" Visibility = "Hidden" Margin="1248,728,0,0" VerticalAlignment="Top" Width="119" Height="26" FontSize="13" Foreground="LightGray" Background="#292929" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_shutdown" Content="Shutdown" BorderThickness="0" HorizontalAlignment="Left" Visibility = "Hidden" Margin="1248,759,0,0" VerticalAlignment="Top" Width="119" Height="26" FontSize="13" Foreground="LightGray" Background="#292929" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_close" Content="Close" BorderThickness="0" HorizontalAlignment="Left" Visibility = "Hidden" Margin="1248,790,0,0" VerticalAlignment="Top" Width="119" Height="26" FontSize="13" Foreground="LightGray" Background="#292929" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
|
||||
|
||||
<Button TabIndex="1" x:Name="btn_r710_stop" BorderThickness="0" HorizontalAlignment="Left" Margin="725,100,0,0" VerticalAlignment="Top" Width="100" Height="100" FontSize="13" Background="DarkRed" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="imgm7" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_r710_m2" BorderThickness="0" HorizontalAlignment="Left" Margin="725,215,0,0" VerticalAlignment="Top" Width="99" Height="100" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
<Image x:Name="imgm8" Source="{Binding}"/>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_r710_m1" BorderThickness="0" HorizontalAlignment="Left" Margin="836,215,0,0" VerticalAlignment="Top" Width="99" Height="100" FontSize="13" Background="Gray" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" x:Name="btn_r710_info" BorderThickness="0" HorizontalAlignment="Left" Margin="594,100,0,0" VerticalAlignment="Top" Width="100" Height="100" FontSize="13" Background="DarkOrange" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Button TabIndex="1" Name="btn_r710_start" BorderThickness="0" HorizontalAlignment="Left" Margin="836,100,0,0" VerticalAlignment="Top" Width="99" Height="100" FontSize="13" Background="DarkGreen" FontWeight="Medium">
|
||||
<Button.Resources>
|
||||
<Style TargetType="{x:Type Border}">
|
||||
<Setter Property="CornerRadius" Value="0"/>
|
||||
</Style>
|
||||
</Button.Resources>
|
||||
</Button>
|
||||
<Label Name="l1_R710" HorizontalAlignment="Left" Content="Power:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="206,98,0,0"/>
|
||||
<TextBox x:Name="tb_r710_power" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="340,98,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
<Label Name="l2_R710" HorizontalAlignment="Left" Content="MAC:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="206,137,0,0"/>
|
||||
<TextBox x:Name="tb_r710_mac" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="342,137,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
<Label Name="l3_R710" HorizontalAlignment="Left" Content="IP:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="206,176,0,0"/>
|
||||
<TextBox x:Name="tb_r710_ip" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="342,176,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
<Label Name="l4_R710" HorizontalAlignment="Left" Content="BIOS:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="206,215,0,0"/>
|
||||
<TextBox x:Name="tb_r710_bios" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="342,215,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
<Label Name="l5_R710" HorizontalAlignment="Left" Content="RAC Name:" VerticalAlignment="Top" Visibility="Visible" Width="128" Height="34" FontSize="18" BorderBrush="Gray" Foreground="White" Margin="206,254,0,0"/>
|
||||
<TextBox x:Name="tb_r710_name" Text="" BorderThickness="0" VerticalContentAlignment="Center" HorizontalAlignment="Left" Height="34" Margin="342,254,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="220" IsEnabled="false" HorizontalContentAlignment="Center" Background="#292929" Foreground="White" FontSize="16" IsTabStop="False"/>
|
||||
|
||||
|
||||
|
||||
</Grid>
|
||||
</Window>
|
||||
86
root.ps1
Normal file
@@ -0,0 +1,86 @@
|
||||
$Script:Version = "FS Admin Panel v0.8"
|
||||
#Ersteller: Florian Späth
|
||||
#Diese Software soll helfen die verschiedensten Anwendungen und Scripte der FG HDS zu administrieren.
|
||||
|
||||
Add-Type -AssemblyName PresentationFramework
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
[System.Reflection.Assembly]::LoadWithPartialName('System.Drawing') | Out-Null
|
||||
|
||||
#### Lädt Scripte ####
|
||||
|
||||
. $PSScriptRoot\GUIS\main.ps1 $PSSCriptRoot
|
||||
. $PSScriptRoot\GUIS\info.ps1 $PSSCriptRoot
|
||||
. $PSScriptRoot\GUIS\gaming.ps1 $PSSCriptRoot
|
||||
. $PSScriptRoot\GUIS\r710.ps1 $PSSCriptRoot
|
||||
. $PSScriptRoot\GUIS\confirm.ps1 $PSSCriptRoot
|
||||
. $PSScriptRoot\GUIS\cleartmp.ps1 $PSSCriptRoot
|
||||
. $PSScriptRoot\GUIS\getlogs.ps1 $PSSCriptRoot
|
||||
|
||||
. $PSSCriptRoot\GUIS\confirm.ps1 $PSScriptRoot
|
||||
|
||||
#### Definition globaler Variablen ####
|
||||
|
||||
## Die GO variable kann nach aufruf der confirm funktion abgefragt werden, um eine 2. Bestätigung der eingabe zu erhalten. (Aufruf: confirm $text)
|
||||
[boolean]$Script:GO = $false
|
||||
|
||||
$Script:ScriptRoot = $PSScriptRoot
|
||||
$Script:iconpath = "$PSScriptRoot\icons"
|
||||
$Script:config = Import-CSV -Path "$PSScriptRoot\config.csv"
|
||||
$Script:RACpath = ($config | where{$_.ID -eq "racadm_path"}).value
|
||||
$Script:plinkpath = ($config | where{$_.ID -eq "plink_path"}).value
|
||||
#$Script:cert_path = ($config | where{$_.ID -eq "some"}).value
|
||||
#$Script:defudbu_path = ($config | where{$_.ID -eq "some"}).value
|
||||
$logfile = "$PSScriptRoot\log.txt"
|
||||
|
||||
### Farb Variablen ###
|
||||
|
||||
$Script:Standardbtncolor = "#00b8d4"
|
||||
$Script:Delcolor = "#d50000"
|
||||
$Script:BackgroundMovecolor = "#FFFFEB9C"
|
||||
$Script:ForegroundMovecolor = "#FF9C6500"
|
||||
$Script:Foregroundgrey = "#FF7A7A7A"
|
||||
$Script:Backgroundgrey = "#FFC5C5C5"
|
||||
|
||||
#### Funktionen ####
|
||||
### Global ###
|
||||
|
||||
function Write-Admin-Log{
|
||||
Param($text)
|
||||
"$(get-date -format "yyyy-MM-dd HH:mm:ss"): $($text)" | out-file $logfile -Append
|
||||
$main_log.content += "$text `n"
|
||||
}
|
||||
|
||||
function Resolve-DnsName {
|
||||
param (
|
||||
[Parameter(Mandatory)][string]$ComputerName
|
||||
)
|
||||
try {
|
||||
[System.Net.Dns]::GetHostAddresses($ComputerName).IPAddressToString
|
||||
return ([System.Net.Dns]::GetHostAddresses($ComputerName).IPAddressToString)
|
||||
}
|
||||
catch {
|
||||
Write-Log "IP not found for $ComputerName!"
|
||||
}
|
||||
}
|
||||
|
||||
Function Select-FolderDialog{
|
||||
param([string]$Description="Zielverzeichnis wählen",[string]$RootFolder="Desktop")
|
||||
[System.Reflection.Assembly]::LoadWithPartialName("System.windows.forms") |Out-Null
|
||||
$objForm = New-Object System.Windows.Forms.FolderBrowserDialog
|
||||
$objForm.Rootfolder = $RootFolder
|
||||
$objForm.Description = $Description
|
||||
$Show = $objForm.ShowDialog()
|
||||
If ($Show -eq "OK"){
|
||||
Return $objForm.SelectedPath
|
||||
}else{
|
||||
Return $false
|
||||
}
|
||||
}
|
||||
|
||||
#### Startet die Anwendung ####
|
||||
|
||||
### Initialisieren ###
|
||||
|
||||
### Öffnet erstes Fenster ###
|
||||
Write-Admin-Log "##### OPEN MAIN WINDOW #####"
|
||||
$main.ShowDialog() | Out-Null
|
||||
33
zeitgeber.ps1
Normal file
@@ -0,0 +1,33 @@
|
||||
#$env:getjob
|
||||
#$env:setjob
|
||||
|
||||
|
||||
|
||||
#do {
|
||||
if ($env:setjob) {
|
||||
$command = $env:setjob
|
||||
$env:setjob = $false
|
||||
}
|
||||
cd "C:\Program Files\Dell\SysMgt\rac5"
|
||||
$collection = $(.\racadm.exe -r "spaeth-bayern.de:5005" -u root -p "kt}y/6ZHF~.@" getsysinfo)
|
||||
foreach ($item in $collection) {
|
||||
if ($null -ne $item) {
|
||||
$r710_log.Text += "$item`n"
|
||||
if($item -match "DNS RAC Name"){
|
||||
$index = ($item.IndexOf("="))
|
||||
$env:r710_log_mac.Text = $item.Substring($index+1)
|
||||
}
|
||||
if($item -match "Firmware Version"){
|
||||
$index = ($item.IndexOf("="))
|
||||
$env:r710_log_bios.Text = $item.Substring($index+1)
|
||||
}
|
||||
if($item -match "Power Status"){
|
||||
$index = ($item.IndexOf("="))
|
||||
$env:r710_log_power.Text = $item.Substring($index+1)
|
||||
}
|
||||
}
|
||||
}
|
||||
Start-Sleep -milliseconds 50
|
||||
#} until (
|
||||
# $quit
|
||||
#)
|
||||