1 $(document).on('arv-log-event', '.arv-log-event-handler-append-logs', function(event, eventData){
3 if (this != event.target) {
4 // Not interested in events sent to child nodes.
8 if (!('properties' in eventData)) {
13 if ('text' in eventData.properties &&
14 eventData.properties.text.length > 0) {
15 txt += eventData.properties.text;
16 if (txt.slice(txt.length-1) != "\n") {
20 if (eventData.event_type == 'update' &&
21 eventData.object_uuid.indexOf("-dz642-") == 5 &&
22 'old_attributes' in eventData.properties &&
23 'new_attributes' in eventData.properties) {
25 if (eventData.properties.old_attributes.state != eventData.properties.new_attributes.state) {
26 var stamp = eventData.event_at + " ";
27 switch(eventData.properties.new_attributes.state) {
29 txt += stamp + "Container "+eventData.object_uuid+" was returned to the queue\n";
32 txt += stamp + "Container "+eventData.object_uuid+" was taken from the queue by a dispatch process\n";
35 txt += stamp + "Container "+eventData.object_uuid+" started\n";
38 var outcome = eventData.properties.new_attributes.exit_code === 0 ? "success" : "failure";
39 txt += stamp + "Container "+eventData.object_uuid+" finished with exit code " +
40 eventData.properties.new_attributes.exit_code +
44 txt += stamp + "Container "+eventData.object_uuid+" was cancelled\n";
47 // Unknown state -- unexpected, might as well log it.
48 txt += stamp + "Container "+eventData.object_uuid+" changed state to " +
49 eventData.properties.new_attributes.state + "\n";
59 wasatbottom = ($(this).scrollTop() + $(this).height() >= this.scrollHeight);
60 if (eventData.prepend) {
66 this.scrollTop = this.scrollHeight;