1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 $(document).on('arv-log-event', '.arv-log-event-handler-append-logs', function(event, eventData){
7 if (this != event.target) {
8 // Not interested in events sent to child nodes.
12 if (!('properties' in eventData)) {
17 if ('text' in eventData.properties &&
18 eventData.properties.text.length > 0) {
19 txt += eventData.properties.text;
20 if (txt.slice(txt.length-1) != "\n") {
24 if (eventData.event_type == 'update' &&
25 eventData.object_uuid.indexOf("-dz642-") == 5 &&
26 'old_attributes' in eventData.properties &&
27 'new_attributes' in eventData.properties) {
29 if (eventData.properties.old_attributes.state != eventData.properties.new_attributes.state) {
30 var stamp = eventData.event_at + " ";
31 switch(eventData.properties.new_attributes.state) {
33 txt += stamp + "Container "+eventData.object_uuid+" was returned to the queue\n";
36 txt += stamp + "Container "+eventData.object_uuid+" was taken from the queue by a dispatch process\n";
39 txt += stamp + "Container "+eventData.object_uuid+" started\n";
42 txt += stamp + "Container "+eventData.object_uuid+" finished\n";
45 txt += stamp + "Container "+eventData.object_uuid+" was cancelled\n";
48 // Unknown state -- unexpected, might as well log it.
49 txt += stamp + "Container "+eventData.object_uuid+" changed state to " +
50 eventData.properties.new_attributes.state + "\n";
60 wasatbottom = (this.scrollTop + this.clientHeight >= this.scrollHeight);
61 if (eventData.prepend) {
67 this.scrollTop = this.scrollHeight;