44 lines
1.3 KiB
JavaScript
44 lines
1.3 KiB
JavaScript
// Generated by CoffeeScript 1.12.5
|
|
import Ember from 'ember';
|
|
|
|
export default Ember.Component.extend({
|
|
panda_prefix: '/panda/api/v1',
|
|
loading_html: "<i class='notched circle loading icon green'></i>",
|
|
session: Ember.inject.service('session'),
|
|
identifier: '',
|
|
actions: {
|
|
on_show: function(element, popup) {
|
|
var identifier, request, session, start_time, url;
|
|
if (!(identifier = this.get('identifier'))) {
|
|
return;
|
|
}
|
|
session = this.get('session');
|
|
url = (this.get('panda_prefix')) + "/workflow_action_definitions/" + identifier + "/action_info";
|
|
start_time = new Date();
|
|
request = {
|
|
url: url,
|
|
contentType: "application/json",
|
|
dataType: "json",
|
|
success: function(response) {
|
|
debugger;
|
|
console.log(response);
|
|
return popup.setSemanticAttr('html', response);
|
|
}
|
|
};
|
|
if (Ember.get(session, 'isAuthenticated')) {
|
|
session.authorize('authorizer:devise', function(key, authorization) {
|
|
var obj;
|
|
request.crossDomain = true;
|
|
return request.headers = (
|
|
obj = {},
|
|
obj["" + key] = authorization,
|
|
obj
|
|
);
|
|
});
|
|
}
|
|
Ember.$.ajax(request);
|
|
return true;
|
|
}
|
|
}
|
|
});
|