Skip to content

Commit

Permalink
Web App will always now print automatically command result, because f…
Browse files Browse the repository at this point in the history
…ew commands missed confirmation and were confusing users
  • Loading branch information
openshwprojects committed Feb 18, 2023
1 parent 5107961 commit 30f818a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/cmnds/cmd_public.h
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ void CMD_StartTCPCommandLine();
// cmd_script.c
int CMD_GetCountActiveScriptThreads();

const char *CMD_GetResultString(commandResult_t r);

void SVM_RunThreads(int deltaMS);
void CMD_InitScripting();
byte* LFS_ReadFile(const char* fname);
Expand Down
8 changes: 6 additions & 2 deletions src/httpserver/rest_interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -1563,8 +1563,12 @@ static int http_rest_post_channels(http_request_t* request) {


static int http_rest_post_cmd(http_request_t* request) {
char* cmd = request->bodystart;
CMD_ExecuteCommand(cmd, COMMAND_FLAG_SOURCE_CONSOLE);
commandResult_t res;
const char* cmd = request->bodystart;
res = CMD_ExecuteCommand(cmd, COMMAND_FLAG_SOURCE_CONSOLE);
if (1) {
addLogAdv(LOG_INFO, LOG_FEATURE_CMD, "[WebApp Cmd '%s' Result] %s", cmd, CMD_GetResultString(res));
}
return http_rest_error(request, 200, "OK");
}

0 comments on commit 30f818a

Please sign in to comment.