Skip to content

Commit 8aaa99c

Browse files
committed
updating to support weburl for acknowlegement messages
1 parent 6a47bd4 commit 8aaa99c

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/lib/stackstorm_api.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ var EventEmitter = require('events').EventEmitter;
1111
// Setup the Environment
1212
env.ST2_API = env.ST2_API || 'http://localhost:9101';
1313
env.ST2_ROUTE = env.ST2_ROUTE || null;
14+
env.ST2_WEBUI_URL = env.ST2_WEBUI_URL || null;
1415

1516
// Optional authentication info
1617
env.ST2_AUTH_USERNAME = env.ST2_AUTH_USERNAME || null;
@@ -121,6 +122,7 @@ StackStormApi.prototype.getAliases = function () {
121122
};
122123

123124
StackStormApi.prototype.sendAck = function (msg, res) {
125+
res.execution.web_url = env.ST2_WEBUI_URL;
124126
var history_url = utils.getExecutionHistoryUrl(res.execution);
125127
var history = history_url ? util.format(' (details available at %s)', history_url) : '';
126128

@@ -141,11 +143,11 @@ StackStormApi.prototype.sendAck = function (msg, res) {
141143
};
142144

143145
// TODO: decouple the msg object from stackstorm api, this should use an event emitter
144-
StackStormApi.prototype.executeCommand = function (msg, alias_name, format_string, command, addressee) {
146+
StackStormApi.prototype.executeCommand = function (msg, alias_name, command_format_string, command, addressee) {
145147
var self = this;
146148
var payload = {
147149
'name': alias_name,
148-
'format': format_string,
150+
'format': command_format_string,
149151
'command': command,
150152
'user': addressee.name,
151153
'source_channel': addressee.room,
@@ -169,7 +171,7 @@ StackStormApi.prototype.executeCommand = function (msg, alias_name, format_strin
169171
}
170172
self.emit('st2.execution_error', {
171173
name: alias_name,
172-
format_string: format_string,
174+
format_string: command_format_string,
173175
message: message,
174176
addressee: addressee,
175177
command: command

0 commit comments

Comments
 (0)