anycmd 4 年之前
父节点
当前提交
f44bfc271b

+ 9 - 3
src/AppViews0/MinerStudio/Views/MinerClientsWindow.xaml

@@ -244,9 +244,15 @@
                         </StackPanel>
                         <uc:MinerClients Grid.Row="1">
                         </uc:MinerClients>
-                        <uc:MinerClientsPagging Grid.Row="2">
-                        </uc:MinerClientsPagging>
-                        <TextBlock Grid.Row="2" Margin="0 0 4 0" HorizontalAlignment="Right" VerticalAlignment="Center" Foreground="{StaticResource LableColor}">小提示:鼠标配合ctrl和shift可以多选、反选矿机。</TextBlock>
+                        <Grid Grid.Row="2">
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition Width="Auto"></ColumnDefinition>
+                                <ColumnDefinition Width="*"></ColumnDefinition>
+                            </Grid.ColumnDefinitions>
+                            <uc:MinerClientsPagging>
+                            </uc:MinerClientsPagging>
+                            <TextBlock Grid.Column="1" HorizontalAlignment="Right" VerticalAlignment="Center" Foreground="{StaticResource LableColor}">小提示:鼠标配合ctrl和shift可以多选、反选矿机。</TextBlock>
+                        </Grid>
                     </Grid>
                     <GridSplitter 
                         Height="6" 

+ 9 - 7
src/AppViews0/MinerStudio/Views/Ucs/MinerClientsPagging.xaml

@@ -84,17 +84,19 @@
                 </WrapPanel>
             </controls:KbButton>
             <controls:KbButton
-				Width="26" 
                 ToolTip="定制列分组"
                 Background="Transparent"
                 BorderThickness="0"
 				Command="{Binding ColumnsShow.Edit}">
-                <Path 
-					Width="14"
-					Height="14"
-					Stretch="Fill"
-					Fill="{StaticResource BtnBackground}"
-					Data="{StaticResource Icon_Edit}"></Path>
+                <WrapPanel>
+                    <Path 
+					    Width="14"
+					    Height="14"
+					    Stretch="Fill"
+					    Fill="{StaticResource BtnBackground}"
+					    Data="{StaticResource Icon_Edit}"></Path>
+                    <TextBlock Padding="2" Foreground="{StaticResource LableColor}">隐藏的列可在定制列分组中找回</TextBlock>
+                </WrapPanel>
             </controls:KbButton>
             <Popup 
                 x:Name="PopupColumnsShow" 

+ 1 - 1
src/AppViews0/MinerStudio/Views/Ucs/WsServerNodePage.xaml

@@ -10,7 +10,7 @@
 	xmlns:vm="clr-namespace:NTMiner.MinerStudio.Vms;assembly=AppModels"
     Background="White"
 	mc:Ignorable="d" 
-    d:DesignHeight="400" 
+    d:DesignHeight="450" 
     d:DesignWidth="1590"
     d:DataContext="{d:DesignData Source=../Design/WsServerNodePageViewModel.xaml}">
     <UserControl.Resources>

+ 1 - 1
src/AppViews0/MinerStudio/Views/Ucs/WsServerNodePage.xaml.cs

@@ -11,7 +11,7 @@ namespace NTMiner.MinerStudio.Views.Ucs {
                 Title = "外网群控websocket服务器节点",
                 IconName = "Icon_Server",
                 Width = 1590,
-                Height = 400,
+                Height = 450,
                 IsMaskTheParent = false,
                 IsChildWindow = true,
                 CloseVisible = Visibility.Visible,

+ 2 - 0
src/NTMinerClient/Mine/DualMineContext.cs

@@ -23,6 +23,8 @@ namespace NTMiner.Mine {
                 mineContext.CoinKernel,
                 mineContext.MainCoinWallet,
                 mineContext.CommandLine,
+                mineContext.IsTestWallet,
+                mineContext.IsTestUserName,
                 parameters,
                 fragments,
                 fileWriters,

+ 2 - 0
src/NTMinerClient/Mine/IMineContext.cs

@@ -31,5 +31,7 @@ namespace NTMiner.Mine {
         IKernelOutput KernelOutput { get; }
         string CommandLine { get; }
         Process KernelProcess { get; }
+        bool IsTestWallet { get; }
+        bool IsTestUserName { get; }
     }
 }

+ 13 - 0
src/NTMinerClient/Mine/MineContext.cs

@@ -26,6 +26,8 @@ namespace NTMiner.Mine {
             ICoinKernel coinKernel,
             string mainCoinWallet,
             string commandLine,
+            bool isTestWallet,
+            bool isTestUserName,
             Dictionary<string, string> parameters,
             Dictionary<Guid, string> fragments,
             Dictionary<Guid, string> fileWriters,
@@ -49,6 +51,8 @@ namespace NTMiner.Mine {
             this.UseDevices = useDevices;
             this.KernelInput = kernelInput;
             this.KernelOutput = kernelOutput;
+            this.IsTestWallet = isTestWallet;
+            this.IsTestUserName = isTestUserName;
 
             this.NewLogFileName();
         }
@@ -134,6 +138,9 @@ namespace NTMiner.Mine {
 
         public DateTime ProcessCreatedOn { get; private set; }
 
+        public bool IsTestWallet { get; private set; }
+        public bool IsTestUserName { get; private set; }
+
         public Dictionary<string, string> Parameters { get; private set; }
 
         public Dictionary<Guid, string> Fragments { get; private set; }
@@ -195,6 +202,12 @@ namespace NTMiner.Mine {
                     try {
                         // 清理除当前外的Temp/Kernel
                         Cleaner.Instance.Clear();
+                        if (IsTestUserName) {
+                            NTMinerConsole.UserWarn($"您正在使用开源矿工的测试账号挖矿,正常挖矿时请确保使用您自己的账号挖矿。");
+                        }
+                        if (IsTestWallet) {
+                            NTMinerConsole.UserWarn($"您正在使用开源矿工的测试钱包地址挖矿,正常挖矿时请确保使用您自己的钱包地址挖矿。");
+                        }
                         NTMinerConsole.UserOk("场地打扫完毕");
                         // 应用超频
                         if (NTMinerContext.Instance.GpuProfileSet.IsOverClockEnabled(MainCoin.GetId())) {

+ 8 - 0
src/NTMinerClient/Mine/MineContextFactory.cs

@@ -44,6 +44,8 @@ namespace NTMiner.Mine {
             string userName = string.Empty;
             string password = NTKeyword.PasswordDefaultValue;
             string wallet = mainCoinProfile.Wallet;
+            bool isTestWallet = false;
+            bool isTestUserName = false;
             IPoolProfile poolProfile = minerProfile.GetPoolProfile(mainCoinPool.GetId());
             if (mainCoinPool.IsUserMode) {
                 password = poolProfile.Password;
@@ -52,9 +54,11 @@ namespace NTMiner.Mine {
                 }
                 userName = poolProfile.UserName;
                 wallet = poolProfile.UserName;
+                isTestUserName = serverContext.PoolSet.TryGetPool(poolProfile.PoolId, out IPool pool) && userName == pool.UserName;
             }
             else {
                 userName = wallet;
+                isTestWallet = serverContext.CoinSet.TryGetCoin(mainCoinProfile.CoinId, out ICoin coin) && wallet == coin.TestWallet;
             }
             parameters.Add(NTKeyword.UserNameParameterName, userName);
             parameters.Add(NTKeyword.PasswordParameterName, password);
@@ -175,6 +179,8 @@ namespace NTMiner.Mine {
                                     mainCoinKernel,
                                     wallet,
                                     dualSb.ToString(),
+                                    isTestWallet,
+                                    isTestUserName,
                                     parameters,
                                     fragments,
                                     fileWriters,
@@ -224,6 +230,8 @@ namespace NTMiner.Mine {
                 mainCoinKernel,
                 wallet,
                 sb.ToString(),
+                isTestWallet,
+                isTestUserName,
                 parameters,
                 fragments,
                 fileWriters,

+ 0 - 1
src/NTMinerDataSchemas/ServerNode/WebApiServerState.cs

@@ -11,7 +11,6 @@ namespace NTMiner.ServerNode {
         }
 
         public string Address { get; set; }
-
         public string Description { get; set; }
 
         public List<WsServerNodeState> WsServerNodes { get; set; }

+ 8 - 1
src/NTMinerServer/Core/IHostConfig.cs

@@ -1,5 +1,12 @@
-namespace NTMiner.Core {
+using System;
+
+namespace NTMiner.Core {
     public interface IHostConfig {
+        /// <summary>
+        /// 没有什么用,只是因为持久层需要一个Id
+        /// </summary>
+        Guid Id { get; }
+        string Description { get; }
         string OssAccessKeyId { get; }
         string OssAccessKeySecret { get; }
         string OssEndpoint { get; }

+ 4 - 0
src/NTMinerServer/Core/Impl/HostConfigData.cs

@@ -5,7 +5,11 @@ namespace NTMiner.Core.Impl {
         public HostConfigData() {
         }
 
+        /// <summary>
+        /// <see cref="IHostConfig.Id"/>
+        /// </summary>
         public Guid Id { get; set; }
+        public string Description { get; set; }
         public string OssAccessKeyId { get; set; }
         public string OssAccessKeySecret { get; set; }
         public string OssEndpoint { get; set; }

+ 1 - 1
src/WebApiServer/AppRoot.cs

@@ -266,7 +266,7 @@ namespace NTMiner {
             return new WebApiServerState {
                 WsServerNodes = wsServerNodes.OrderBy(a => a.Address).ToList(),
                 Address = ServerRoot.HostConfig.ThisServerAddress,
-                Description = string.Empty,
+                Description = ServerRoot.HostConfig.Description,
                 AvailablePhysicalMemory = ram.AvailablePhysicalMemory,
                 TotalPhysicalMemory = ram.TotalPhysicalMemory,
                 Cpu = cpu.ToData(),

+ 1 - 1
src/WsServer/Core/Impl/WsServerNodeAddressSet.cs

@@ -37,7 +37,7 @@ namespace NTMiner.Core.Impl {
                     var cpu = Windows.Cpu.Instance;
                     nodeState = new WsServerNodeState {
                         Address = ServerRoot.HostConfig.ThisServerAddress,
-                        Description = string.Empty,
+                        Description = ServerRoot.HostConfig.Description,
                         MinerClientSessionCount = AppRoot.MinerClientSessionSet.Count,
                         MinerStudioSessionCount = AppRoot.MinerStudioSessionSet.Count,
                         MinerClientWsSessionCount = minerClientWsSessionCount,