fix
parent
68d0fb2ced
commit
a648865083
|
@ -24,6 +24,7 @@ public class CpuTemp extends CommandTemplate {
|
|||
|
||||
@Override
|
||||
public String executeCommandSpecificHost(String serverName) {
|
||||
try {
|
||||
Optional<SshServer> server = sshService.getAllSshServers()
|
||||
.stream()
|
||||
.filter(x -> x.getName().equals(serverName))
|
||||
|
@ -39,5 +40,10 @@ public class CpuTemp extends CommandTemplate {
|
|||
log.error("Ошибка при выполнении команды 'CPUtemp'. Искомый сервер ({}) не найден", serverName);
|
||||
return null;
|
||||
}
|
||||
} catch (NumberFormatException e) {
|
||||
log.error("Ошибка при выполнении команды 'CPUtemp'" ,e.getMessage());
|
||||
return "Сервер " + serverName + " не поддерживает команду 'CPUtemp'";
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -45,10 +45,9 @@ public class TelegramBotKeyboard implements UiFormer {
|
|||
private ArrayList<KeyboardRow> formKeyboard(User user) {
|
||||
Role role = user.getRole();
|
||||
Map<String, CommandTemplate> commands = applicationContext.getBeansOfType(CommandTemplate.class);
|
||||
if (List.of(ADMIN, USER).contains(role)) {
|
||||
commands.remove("/start");
|
||||
commands.remove("Not found");
|
||||
}
|
||||
commands.remove("firstUseCommand");
|
||||
commands.remove("switchToMainMenu");
|
||||
|
||||
int buttonOnLine = 3;
|
||||
|
||||
ArrayList<KeyboardRow> keyboardRows = new ArrayList<>();
|
||||
|
|
Loading…
Reference in New Issue