fix bug in test shell and bug in front -a mode
This commit is contained in:
@@ -1114,7 +1114,7 @@ void execute_bash_debug(string fun,string ip,string type,int proindex)
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
char command[256];
|
||||
snprintf(command, sizeof(command), "%s %s %s %s &", script, param1, param2, param3,param4);
|
||||
snprintf(command, sizeof(command), "%s %s %s %s %s &", script, param1, param2, param3,param4);
|
||||
|
||||
std::cout << "command:" << command <<std::endl;
|
||||
|
||||
@@ -1243,6 +1243,8 @@ void parse_set(const std::string& json_str) {
|
||||
proindex = index_item->valueint;
|
||||
}
|
||||
|
||||
std::cout << "proindex is :" << proindex <<std::endl;
|
||||
|
||||
//У<><D0A3><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if((fun == "start" || fun == "delete") &&
|
||||
isValidIP(ip) &&
|
||||
|
||||
@@ -355,11 +355,15 @@ private slots:
|
||||
continue;
|
||||
}
|
||||
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>̶<EFBFBD>Ϊ "> "<22><><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ2
|
||||
const int promptLength = 2;
|
||||
|
||||
// 4) <20>˸<EFBFBD><CBB8><EFBFBD>
|
||||
if (c == '\x7f' || c == '\b') {
|
||||
if (!currentCommand.isEmpty()) {
|
||||
// <20><><EFBFBD><EFBFBD> currentCommand <20>ij<EFBFBD><C4B3>ȴ<EFBFBD><C8B4><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD>ַ<EFBFBD>
|
||||
if (currentCommand.length() > promptLength) {
|
||||
currentCommand.chop(1);
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>˸<EFBFBD>
|
||||
// <20><><EFBFBD><EFBFBD><EFBFBD>˸<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> "\b \b" <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD>һ<EFBFBD><D2BB><EFBFBD>ַ<EFBFBD>
|
||||
clientSocket->write("\b \b");
|
||||
clientSocket->flush();
|
||||
}
|
||||
@@ -396,8 +400,7 @@ private:
|
||||
*/
|
||||
void printPrompt(QTcpSocket *clientSocket)
|
||||
{
|
||||
//clientSocket->write("\r\n> ");
|
||||
clientSocket->write("\r\x1B[K> ");
|
||||
clientSocket->write("\n\r\x1B[K> ");
|
||||
clientSocket->flush();
|
||||
}
|
||||
|
||||
@@ -420,7 +423,7 @@ private:
|
||||
helpText += "log - Execute rocketmq_test_log\r\n";
|
||||
helpText += "ledger <id> - Execute ledger with optional terminal_id\r\n";
|
||||
helpText += "viewlog <level> - View logs (ERROR, WARN, NORMAL, DEBUG)\r\n";
|
||||
helpText += "value <valuename> - Execute value print with valuename\r\n";
|
||||
helpText += "value <valuename> - Execute value print with valuename : frontindex remtable iedcount frontfun log init\r\n";
|
||||
helpText += "exit - Exit the shell\r\n";
|
||||
helpText += "help - Show this help message\r\n";
|
||||
clientSocket->write("\r\x1B[K");
|
||||
@@ -488,10 +491,10 @@ private:
|
||||
else if (cmd.startsWith("value")) {
|
||||
QStringList parts = cmd.split(" ");
|
||||
if (parts.size() > 1) {
|
||||
QString variableName = parts[1];
|
||||
value_print(variableName.toStdString().c_str(), clientSocket);
|
||||
QString variableName = parts[1];
|
||||
clientSocket->write("\r\x1B[K");
|
||||
clientSocket->write("Executed value with variable name: " + variableName.toUtf8() + "\r\n");
|
||||
value_print(variableName.toStdString().c_str(), clientSocket);
|
||||
} else {
|
||||
clientSocket->write("\r\x1B[K");
|
||||
clientSocket->write("Please provide a variable name\r\n");
|
||||
|
||||
Reference in New Issue
Block a user