Changeset 8122


Ignore:
Timestamp:
Mar 8, 2023, 1:20:27 PM (7 months ago)
Author:
Nicklas Nordborg
Message:

References #2295: Add API for services to send log messages that can be displayed by the web client

Added the possibility to view the stacktrace for log entries that has one.

Location:
branches/3.19-stable/www/admin/services
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/3.19-stable/www/admin/services/services.js

    r8120 r8122  
    7777    var extensionId = Data.get(event.currentTarget, 'extension-id');
    7878    Doc.showHide('stacktrace.' + extensionId);
     79   
     80    var img = event.currentTarget.firstChild;
     81    if (img.src.indexOf('gonext') > 0)
     82    {
     83      img.src = App.getRoot() + '/images/move_down.png';
     84    }
     85    else if (img.src.indexOf('move_down') > 0)
     86    {
     87      img.src = App.getRoot() + '/images/gonext.png';
     88    }
    7989  }
    8090 
     
    8494    var url = 'view_log.jsp?ID='+App.getSessionId();
    8595    url += '&extensionId='+extensionId;
    86     Dialogs.openPopup(url, 'ViewLog', 1000, 600);
     96    Dialogs.openPopup(url, 'ViewLog'+extensionId, 1000, 600);
    8797  }
    8898 
  • branches/3.19-stable/www/admin/services/view_log.jsp

    r8120 r8122  
    5959    </style>
    6060  </base:head>
    61   <base:body>
     61  <base:body data-read-only="1">
    6262  <h1>Event log - <%=ext.getAbout().getName()%></h1>
    6363 
     
    118118          entryNo++;
    119119          LogEntry e = it.next();
     120          Throwable stacktrace = e.getStacktrace();
    120121          %>
    121122          <tbl:row>
    122123            <tbl:cell column="level" subclass="level"><%=entryNo%><base:icon image="<%=e.getLevel().getIcon()%>"/></tbl:cell>
    123124            <tbl:cell column="timestamp" subclass="timestamp"><%=DateUtil.formatTimestamp(e.getDate()) %></tbl:cell>
    124             <tbl:cell column="message"><%=HTML.encodeTags(e.getMessage()) %></tbl:cell>
     125            <tbl:cell column="message"><%=HTML.encodeTags(e.getMessage()) %>
     126              <%
     127              if (stacktrace != null)
     128              {
     129                %>
     130                <base:icon
     131                  id="<%="toggle-stacktrace."+entryNo%>" subclass="auto-init"
     132                  data-auto-init="toggle-stacktrace"
     133                  data-extension-id="<%=entryNo%>"
     134                  tooltip="Click to show full stacktrace"
     135                  image="gonext.png"
     136                />
     137                <div id="stacktrace.<%=entryNo%>"
     138                    class="stacktrace messagecontainer error"
     139                    style="display: none;"
     140                  ><%=ThrowableUtil.stackTraceToString(stacktrace)%></div>
     141               
     142                <%
     143              }
     144              %>
     145            </tbl:cell>
    125146          </tbl:row>
    126147          <%
Note: See TracChangeset for help on using the changeset viewer.