Slices W-A/W-B/W-C und L-A aus UMSETZUNGSPLAN-Watchdog-LicenseLabrador-Integration. Watchdog (Dead-Man's-Switch, externer Server): - WatchdogHeartbeatService als BackgroundService + DI-Singleton; jeder Sendeversuch gekapselt, ein Ausfall des Watchdogs beeintraechtigt PolyTrader nie. - Eigene Implementierung statt Test-Client des Fremdprojekts: TLS-Pruefung bleibt aktiv, http:// nur fuer localhost (Agent-Token nicht im Klartext ins Netz). - Status aus dem App-Log abgeleitet (Error mit 5-Minuten-Sticky-Fenster, entprellt), Lifecycle-Events started/stopping. - Konfiguration in ServerSettings; Agent-Token [Browsable(false)] mit maskierter Eingabe + Statusanzeige, bei gesetztem Master-Key verschluesselt (enc:v1:). Lizenz (LicenseLabrador, Ed25519): - LicenseGate.RunStartupGate prueft beim Start; bei ungueltiger Lizenz wird die Modulliste leer gebaut, sodass nur die Core-Shell (Terminal/Einstellungen) startet. Bewusst kein Environment.Exit - ein Trading-Bot darf nicht mitten im Lauf hart sterben. TamperSuspected gilt als nicht nutzbar. - LicenseDialog (partial + .Designer.cs) fuer Start- und Verwalten-Modus, mit Hardware-ID zum Kopieren; Smoke-UI konstruiert beide Modi headless. - Master-Key wird jetzt VOR dem Host-Build geladen, da auch der Lizenzschluessel entschluesselt werden muss; derselbe TerminalLogger wird als Singleton weitergereicht, damit die Startmeldungen im Terminal-Fenster erscheinen. Der Lizenz-SDK-Client wird per Cross-Repo-Projektreferenz auf ..\..\LicenseLabrador eingebunden, damit SDK-Fixes ohne Kopie einfliessen. 484 Zeilen Tests fuer den Heartbeat; Suite gruen (438 Tests). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
251 lines
11 KiB
C#
251 lines
11 KiB
C#
namespace PolyTraderSharp.Ui.Views
|
|
{
|
|
partial class SettingsView
|
|
{
|
|
private System.ComponentModel.IContainer components = null;
|
|
|
|
protected override void Dispose(bool disposing)
|
|
{
|
|
if (disposing && (components != null))
|
|
{
|
|
components.Dispose();
|
|
}
|
|
base.Dispose(disposing);
|
|
}
|
|
|
|
#region Vom Komponenten-Designer generierter Code
|
|
|
|
private void InitializeComponent()
|
|
{
|
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SettingsView));
|
|
propertyGrid = new PropertyGrid();
|
|
tabControl1 = new TabControl();
|
|
tabPage1 = new TabPage();
|
|
toolStrip2 = new ToolStrip();
|
|
btn_save = new ToolStripButton();
|
|
btn_loadsettings = new ToolStripButton();
|
|
btnGenMasterKey = new ToolStripButton();
|
|
btnSetOpenRouterKey = new ToolStripButton();
|
|
btnSetWatchdogToken = new ToolStripButton();
|
|
btnTestWatchdog = new ToolStripButton();
|
|
btnSetLicenseKey = new ToolStripButton();
|
|
tabPage2 = new TabPage();
|
|
pgAccount = new PropertyGrid();
|
|
dgvAccounts = new DataGridView();
|
|
toolStripAccounts = new ToolStrip();
|
|
btnAccNew = new ToolStripButton();
|
|
btnAccDelete = new ToolStripButton();
|
|
tabControl1.SuspendLayout();
|
|
tabPage1.SuspendLayout();
|
|
toolStrip2.SuspendLayout();
|
|
tabPage2.SuspendLayout();
|
|
((System.ComponentModel.ISupportInitialize)dgvAccounts).BeginInit();
|
|
toolStripAccounts.SuspendLayout();
|
|
SuspendLayout();
|
|
//
|
|
// propertyGrid
|
|
//
|
|
propertyGrid.Dock = DockStyle.Fill;
|
|
propertyGrid.Location = new Point(3, 37);
|
|
propertyGrid.Name = "propertyGrid";
|
|
propertyGrid.Size = new Size(1171, 742);
|
|
propertyGrid.TabIndex = 1;
|
|
//
|
|
// tabControl1
|
|
//
|
|
tabControl1.Controls.Add(tabPage1);
|
|
tabControl1.Controls.Add(tabPage2);
|
|
tabControl1.Dock = DockStyle.Fill;
|
|
tabControl1.Location = new Point(0, 0);
|
|
tabControl1.Name = "tabControl1";
|
|
tabControl1.SelectedIndex = 0;
|
|
tabControl1.Size = new Size(1185, 820);
|
|
tabControl1.TabIndex = 3;
|
|
//
|
|
// tabPage1
|
|
//
|
|
tabPage1.Controls.Add(propertyGrid);
|
|
tabPage1.Controls.Add(toolStrip2);
|
|
tabPage1.Location = new Point(4, 34);
|
|
tabPage1.Name = "tabPage1";
|
|
tabPage1.Padding = new Padding(3);
|
|
tabPage1.Size = new Size(1177, 782);
|
|
tabPage1.TabIndex = 0;
|
|
tabPage1.Text = "General Settings";
|
|
tabPage1.UseVisualStyleBackColor = true;
|
|
//
|
|
// toolStrip2
|
|
//
|
|
toolStrip2.ImageScalingSize = new Size(24, 24);
|
|
toolStrip2.Items.AddRange(new ToolStripItem[] { btn_save, btn_loadsettings, btnGenMasterKey, btnSetOpenRouterKey, btnSetWatchdogToken, btnTestWatchdog, btnSetLicenseKey });
|
|
toolStrip2.Location = new Point(3, 3);
|
|
toolStrip2.Name = "toolStrip2";
|
|
toolStrip2.Size = new Size(1171, 34);
|
|
toolStrip2.TabIndex = 0;
|
|
toolStrip2.Text = "toolStrip2";
|
|
//
|
|
// btn_save
|
|
//
|
|
btn_save.Image = Properties.Resources.diskette;
|
|
btn_save.ImageTransparentColor = Color.Magenta;
|
|
btn_save.Name = "btn_save";
|
|
btn_save.Size = new Size(150, 29);
|
|
btn_save.Text = "Save Changes";
|
|
//
|
|
// btn_loadsettings
|
|
//
|
|
btn_loadsettings.Image = Properties.Resources.token_quantifier;
|
|
btn_loadsettings.ImageTransparentColor = Color.Magenta;
|
|
btn_loadsettings.Name = "btn_loadsettings";
|
|
btn_loadsettings.Size = new Size(223, 29);
|
|
btn_loadsettings.Text = "Load Settings from File";
|
|
//
|
|
// btnGenMasterKey
|
|
//
|
|
btnGenMasterKey.DisplayStyle = ToolStripItemDisplayStyle.Text;
|
|
btnGenMasterKey.Name = "btnGenMasterKey";
|
|
btnGenMasterKey.Size = new Size(182, 29);
|
|
btnGenMasterKey.Text = "Master-Key erzeugen";
|
|
btnGenMasterKey.ToolTipText = "Erzeugt einen zufälligen AES-Master-Key (nur wenn noch keiner existiert).";
|
|
//
|
|
// btnSetOpenRouterKey
|
|
//
|
|
btnSetOpenRouterKey.DisplayStyle = ToolStripItemDisplayStyle.Text;
|
|
btnSetOpenRouterKey.Name = "btnSetOpenRouterKey";
|
|
btnSetOpenRouterKey.Size = new Size(220, 29);
|
|
btnSetOpenRouterKey.Text = "OpenRouter-Key setzen …";
|
|
btnSetOpenRouterKey.ToolTipText = "Speichert den OpenRouter-API-Key für den Supervisor (gitignorierte Datei openrouter.key).";
|
|
//
|
|
// btnSetWatchdogToken
|
|
//
|
|
btnSetWatchdogToken.DisplayStyle = ToolStripItemDisplayStyle.Text;
|
|
btnSetWatchdogToken.Name = "btnSetWatchdogToken";
|
|
btnSetWatchdogToken.Size = new Size(220, 29);
|
|
btnSetWatchdogToken.Text = "Watchdog-Token setzen …";
|
|
btnSetWatchdogToken.ToolTipText = "Speichert den Watchdog-Agent-Token (maskierte Eingabe, bei gesetztem Master-Key verschlüsselt).";
|
|
//
|
|
// btnTestWatchdog
|
|
//
|
|
btnTestWatchdog.DisplayStyle = ToolStripItemDisplayStyle.Text;
|
|
btnTestWatchdog.Name = "btnTestWatchdog";
|
|
btnTestWatchdog.Size = new Size(210, 29);
|
|
btnTestWatchdog.Text = "Test-Heartbeat senden";
|
|
btnTestWatchdog.ToolTipText = "Sendet sofort einen Heartbeat an den konfigurierten Watchdog-Server und meldet das Ergebnis.";
|
|
//
|
|
// btnSetLicenseKey
|
|
//
|
|
btnSetLicenseKey.DisplayStyle = ToolStripItemDisplayStyle.Text;
|
|
btnSetLicenseKey.Name = "btnSetLicenseKey";
|
|
btnSetLicenseKey.Size = new Size(210, 29);
|
|
btnSetLicenseKey.Text = "Lizenz prüfen / setzen …";
|
|
btnSetLicenseKey.ToolTipText = "Öffnet den Lizenzdialog (Hardware-ID + Server-Validierung). Gültiger Schlüssel wird gespeichert (bei Master-Key verschlüsselt).";
|
|
//
|
|
// tabPage2
|
|
//
|
|
tabPage2.Controls.Add(pgAccount);
|
|
tabPage2.Controls.Add(dgvAccounts);
|
|
tabPage2.Controls.Add(toolStripAccounts);
|
|
tabPage2.Location = new Point(4, 34);
|
|
tabPage2.Name = "tabPage2";
|
|
tabPage2.Padding = new Padding(3);
|
|
tabPage2.Size = new Size(1177, 762);
|
|
tabPage2.TabIndex = 1;
|
|
tabPage2.Text = "Polymarket Accounts";
|
|
tabPage2.UseVisualStyleBackColor = true;
|
|
//
|
|
// pgAccount
|
|
//
|
|
pgAccount.Dock = DockStyle.Fill;
|
|
pgAccount.Location = new Point(623, 37);
|
|
pgAccount.Name = "pgAccount";
|
|
pgAccount.Size = new Size(551, 722);
|
|
pgAccount.TabIndex = 2;
|
|
//
|
|
// dgvAccounts
|
|
//
|
|
dgvAccounts.AllowUserToAddRows = false;
|
|
dgvAccounts.AllowUserToDeleteRows = false;
|
|
dgvAccounts.ColumnHeadersHeightSizeMode = DataGridViewColumnHeadersHeightSizeMode.AutoSize;
|
|
dgvAccounts.Dock = DockStyle.Left;
|
|
dgvAccounts.Location = new Point(3, 37);
|
|
dgvAccounts.MultiSelect = false;
|
|
dgvAccounts.Name = "dgvAccounts";
|
|
dgvAccounts.ReadOnly = true;
|
|
dgvAccounts.RowHeadersVisible = false;
|
|
dgvAccounts.RowHeadersWidth = 62;
|
|
dgvAccounts.SelectionMode = DataGridViewSelectionMode.FullRowSelect;
|
|
dgvAccounts.Size = new Size(620, 722);
|
|
dgvAccounts.TabIndex = 1;
|
|
//
|
|
// toolStripAccounts
|
|
//
|
|
toolStripAccounts.ImageScalingSize = new Size(24, 24);
|
|
toolStripAccounts.Items.AddRange(new ToolStripItem[] { btnAccNew, btnAccDelete });
|
|
toolStripAccounts.Location = new Point(3, 3);
|
|
toolStripAccounts.Name = "toolStripAccounts";
|
|
toolStripAccounts.Size = new Size(1171, 34);
|
|
toolStripAccounts.TabIndex = 0;
|
|
//
|
|
// btnAccNew
|
|
//
|
|
btnAccNew.Image = Properties.Resources.add;
|
|
btnAccNew.Name = "btnAccNew";
|
|
btnAccNew.Size = new Size(157, 29);
|
|
btnAccNew.Text = "Neuer Account";
|
|
//
|
|
// btnAccDelete
|
|
//
|
|
btnAccDelete.Image = Properties.Resources.cancel;
|
|
btnAccDelete.Name = "btnAccDelete";
|
|
btnAccDelete.Size = new Size(104, 29);
|
|
btnAccDelete.Text = "Löschen";
|
|
//
|
|
// SettingsView
|
|
//
|
|
AutoScaleDimensions = new SizeF(10F, 25F);
|
|
AutoScaleMode = AutoScaleMode.Font;
|
|
ClientSize = new Size(1185, 820);
|
|
Controls.Add(tabControl1);
|
|
Icon = (Icon)resources.GetObject("$this.Icon");
|
|
Margin = new Padding(4, 5, 4, 5);
|
|
Name = "SettingsView";
|
|
Text = "Server Settings";
|
|
tabControl1.ResumeLayout(false);
|
|
tabPage1.ResumeLayout(false);
|
|
tabPage1.PerformLayout();
|
|
toolStrip2.ResumeLayout(false);
|
|
toolStrip2.PerformLayout();
|
|
tabPage2.ResumeLayout(false);
|
|
tabPage2.PerformLayout();
|
|
((System.ComponentModel.ISupportInitialize)dgvAccounts).EndInit();
|
|
toolStripAccounts.ResumeLayout(false);
|
|
toolStripAccounts.PerformLayout();
|
|
ResumeLayout(false);
|
|
}
|
|
|
|
#endregion
|
|
|
|
private System.Windows.Forms.PropertyGrid propertyGrid;
|
|
private TabControl tabControl1;
|
|
private TabPage tabPage1;
|
|
private ToolStrip toolStrip2;
|
|
private TabPage tabPage2;
|
|
private ToolStripButton btn_save;
|
|
private ToolStripButton btn_loadsettings;
|
|
private ToolStripButton btnGenMasterKey;
|
|
private ToolStripButton btnSetOpenRouterKey;
|
|
private ToolStripButton btnSetWatchdogToken;
|
|
private ToolStripButton btnTestWatchdog;
|
|
private ToolStripButton btnSetLicenseKey;
|
|
private ToolStrip toolStripAccounts;
|
|
private ToolStripButton btnAccNew;
|
|
private ToolStripButton btnAccDelete;
|
|
private DataGridView dgvAccounts;
|
|
private DataGridViewTextBoxColumn colAccName;
|
|
private DataGridViewTextBoxColumn colAccWallet;
|
|
private DataGridViewCheckBoxColumn colAccDemo;
|
|
private DataGridViewCheckBoxColumn colAccActive;
|
|
private PropertyGrid pgAccount;
|
|
}
|
|
}
|