только админу дается возможность использовать больше 14 ядер
This commit is contained in:
@@ -26,7 +26,8 @@ public class TestingBar extends VisualiserMenuBar {
|
||||
add(sKernels = new JSpinner());
|
||||
sKernels.setPreferredSize(new Dimension(60, 26));
|
||||
sKernels.setMaximumSize(new Dimension(60, 26));
|
||||
sKernels.setModel(new SpinnerNumberModel(Global.properties.TestingKernels, 1, 64, 1));
|
||||
sKernels.setModel(new SpinnerNumberModel(Global.properties.TestingKernels, 1,
|
||||
Utils.getTestingMaxKernels(), 1));
|
||||
sKernels.setValue(Global.properties.TestingKernels);
|
||||
UI.MakeSpinnerRapid(sKernels, e -> {
|
||||
Global.properties.updateField("TestingKernels", sKernels.getValue());
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package Common.Utils;
|
||||
import Common.Constants;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import ProjectData.Files.DBProjectFile;
|
||||
@@ -1039,5 +1040,11 @@ public class Utils {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
public static int getTestingMaxKernels() {
|
||||
if (Current.HasAccount()) {
|
||||
return (Current.getAccount().isAdmin()) ? 64 : 14;
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user