-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #296 from Z-Bolt/2.7.3-dev
2.7.3 dev into master
- Loading branch information
Showing
34 changed files
with
353 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,7 @@ import ( | |
) | ||
|
||
type IPanel interface { | ||
Name() string | ||
Grid() *gtk.Grid | ||
PreShow() | ||
Show() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package octoprintApis | ||
|
||
import ( | ||
// "encoding/json" | ||
"fmt" | ||
|
||
"github.com/Z-Bolt/OctoScreen/logger" | ||
"github.com/Z-Bolt/OctoScreen/octoprintApis/dataModels" | ||
) | ||
|
||
|
||
var ExecuteErrors = StatusMapping { | ||
404: "The command could not be found for source and action", | ||
500: "The command didn’t define a command to execute, the command returned a non-zero return code and ignore was not true or some other internal server error occurred", | ||
} | ||
|
||
// SystemExecuteCommandRequest retrieves all configured system commands. | ||
type SystemExecuteCommandRequest struct { | ||
// Source for which to list commands. | ||
Source dataModels.CommandSource `json:"source"` | ||
|
||
// Action is the identifier of the command, action from its definition. | ||
Action string `json:"action"` | ||
} | ||
|
||
// Do sends an API request and returns an error if any. | ||
func (this *SystemExecuteCommandRequest) Do(client *Client) error { | ||
uri := fmt.Sprintf("%s/%s/%s", SystemCommandsApiUri, this.Source, this.Action) | ||
_, err := client.doJsonRequest("POST", uri, nil, ExecuteErrors, true) | ||
if err != nil { | ||
logger.LogError("SystemExecuteCommandRequest.Do()", "client.doJsonRequest(POST)", err) | ||
} | ||
|
||
return err | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.