|
@@ -77,7 +77,6 @@ public partial class DeviceDetailsWindow : Window
|
|
|
NewGatewayTextBox.Text = string.Empty;
|
|
NewGatewayTextBox.Text = string.Empty;
|
|
|
NewDnsTextBox.Text = string.Empty;
|
|
NewDnsTextBox.Text = string.Empty;
|
|
|
ConfigValidationTextBlock.Text = "点击 1/2/3 按顺序操作:先读取当前配置,再校验,最后应用。";
|
|
ConfigValidationTextBlock.Text = "点击 1/2/3 按顺序操作:先读取当前配置,再校验,最后应用。";
|
|
|
- ApplyTaskStatusTextBlock.Text = "尚未提交配置任务。";
|
|
|
|
|
_configValidated = false;
|
|
_configValidated = false;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -117,7 +116,6 @@ public partial class DeviceDetailsWindow : Window
|
|
|
_suppressConfigChangeHandling = false;
|
|
_suppressConfigChangeHandling = false;
|
|
|
_configValidated = false;
|
|
_configValidated = false;
|
|
|
ConfigValidationTextBlock.Text = "已回填目标接口当前配置,可直接修改后校验。";
|
|
ConfigValidationTextBlock.Text = "已回填目标接口当前配置,可直接修改后校验。";
|
|
|
- ApplyTaskStatusTextBlock.Text = "尚未提交配置任务。";
|
|
|
|
|
UpdateButtonStates();
|
|
UpdateButtonStates();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -155,7 +153,7 @@ public partial class DeviceDetailsWindow : Window
|
|
|
ConfigValidationTextBlock.Text = $"校验失败:{result.Message}";
|
|
ConfigValidationTextBlock.Text = $"校验失败:{result.Message}";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- ApplyTaskStatusTextBlock.Text = _configValidated ? "配置已通过校验,可提交应用。" : "当前配置尚未通过校验。";
|
|
|
|
|
|
|
+ ConfigValidationTextBlock.Text = _configValidated ? "配置已通过校验,可提交应用。" : "当前配置尚未通过校验。";
|
|
|
UpdateButtonStates();
|
|
UpdateButtonStates();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -185,11 +183,11 @@ public partial class DeviceDetailsWindow : Window
|
|
|
var applyResult = await _agentApiService.ApplyInterfaceConfigAsync(_baseAddress, _password, _localIPv4, request);
|
|
var applyResult = await _agentApiService.ApplyInterfaceConfigAsync(_baseAddress, _password, _localIPv4, request);
|
|
|
if (!applyResult.Success || applyResult.Data is null)
|
|
if (!applyResult.Success || applyResult.Data is null)
|
|
|
{
|
|
{
|
|
|
- ApplyTaskStatusTextBlock.Text = $"提交配置任务失败:{applyResult.Message}";
|
|
|
|
|
|
|
+ ConfigValidationTextBlock.Text = $"提交配置任务失败:{applyResult.Message}";
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- ApplyTaskStatusTextBlock.Text = $"配置任务已提交:{applyResult.Data.TaskId},正在轮询状态。";
|
|
|
|
|
|
|
+ ConfigValidationTextBlock.Text = $"配置任务已提交:{applyResult.Data.TaskId},正在轮询状态。";
|
|
|
await PollTaskAsync(applyResult.Data.TaskId);
|
|
await PollTaskAsync(applyResult.Data.TaskId);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -205,17 +203,17 @@ public partial class DeviceDetailsWindow : Window
|
|
|
if (result.StatusCode is null)
|
|
if (result.StatusCode is null)
|
|
|
{
|
|
{
|
|
|
transientFailureCount++;
|
|
transientFailureCount++;
|
|
|
- ApplyTaskStatusTextBlock.Text = $"任务 {taskId} 轮询中,检测到短暂断连,正在重试({transientFailureCount})。";
|
|
|
|
|
|
|
+ ConfigValidationTextBlock.Text = $"任务 {taskId} 轮询中,检测到短暂断连,正在重试({transientFailureCount})。";
|
|
|
continue;
|
|
continue;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- ApplyTaskStatusTextBlock.Text = $"读取任务状态失败:{result.Message}";
|
|
|
|
|
|
|
+ ConfigValidationTextBlock.Text = $"读取任务状态失败:{result.Message}";
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
transientFailureCount = 0;
|
|
transientFailureCount = 0;
|
|
|
var task = result.Data;
|
|
var task = result.Data;
|
|
|
- ApplyTaskStatusTextBlock.Text = $"任务 {task.TaskId} / {task.Status} / {task.Step} / {task.Detail}";
|
|
|
|
|
|
|
+ ConfigValidationTextBlock.Text = $"任务 {task.TaskId} / {task.Status} / {task.Step} / {task.Detail}";
|
|
|
if (task.Status is "success" or "failed" or "rolled_back")
|
|
if (task.Status is "success" or "failed" or "rolled_back")
|
|
|
{
|
|
{
|
|
|
if (RemoteTargetInterfaceComboBox.SelectedItem is RemoteInterfaceInfo selected)
|
|
if (RemoteTargetInterfaceComboBox.SelectedItem is RemoteInterfaceInfo selected)
|
|
@@ -227,7 +225,7 @@ public partial class DeviceDetailsWindow : Window
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- ApplyTaskStatusTextBlock.Text = $"任务 {taskId} 轮询超时,请稍后手动刷新。";
|
|
|
|
|
|
|
+ ConfigValidationTextBlock.Text = $"任务 {taskId} 轮询超时,请稍后手动刷新。";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private async void RebootButton_OnClick(object sender, RoutedEventArgs e)
|
|
private async void RebootButton_OnClick(object sender, RoutedEventArgs e)
|
|
@@ -256,11 +254,11 @@ public partial class DeviceDetailsWindow : Window
|
|
|
var result = await action();
|
|
var result = await action();
|
|
|
if (!result.Success || result.Data is null)
|
|
if (!result.Success || result.Data is null)
|
|
|
{
|
|
{
|
|
|
- ApplyTaskStatusTextBlock.Text = $"{title}失败:{result.Message}";
|
|
|
|
|
|
|
+ ConfigValidationTextBlock.Text = $"{title}失败:{result.Message}";
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- ApplyTaskStatusTextBlock.Text = $"{title}任务已提交:{result.Data.TaskId}。命令已发出,设备可能立即断开。";
|
|
|
|
|
|
|
+ ConfigValidationTextBlock.Text = $"{title}任务已提交:{result.Data.TaskId}。命令已发出,设备可能立即断开。";
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
private RemoteInterfaceConfig? BuildConfigRequest(string interfaceName)
|
|
private RemoteInterfaceConfig? BuildConfigRequest(string interfaceName)
|
|
@@ -355,7 +353,6 @@ public partial class DeviceDetailsWindow : Window
|
|
|
|
|
|
|
|
_configValidated = false;
|
|
_configValidated = false;
|
|
|
ConfigValidationTextBlock.Text = "配置内容已变更,请重新点击“2. 校验配置”。";
|
|
ConfigValidationTextBlock.Text = "配置内容已变更,请重新点击“2. 校验配置”。";
|
|
|
- ApplyTaskStatusTextBlock.Text = "当前配置尚未通过校验。";
|
|
|
|
|
UpdateButtonStates();
|
|
UpdateButtonStates();
|
|
|
}
|
|
}
|
|
|
|
|
|