Search in sources :

Example 1 with AbstractHtmlAction

use of org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction in project scout.rt by eclipse.

the class CallsView method produceBody.

@Override
public void produceBody(HtmlComponent p) {
    final SessionInspector session = getAdminSession().getTopView().getSessionsView().getSelectedSession();
    p.linkAction("Clear calls", new AbstractHtmlAction("clearCalls") {

        @Override
        public void run() {
            session.clearCallInspectors();
        }
    });
    p.p();
    // 
    p.startTable(0, 5, 5);
    p.startTableRow();
    p.startTableCell();
    renderCallTable(p, session);
    p.startTableCell();
    // selected call
    if (m_selectedCall != null) {
        renderCallDetail(p, m_selectedCall);
    }
    p.endTableCell();
    p.endTableRow();
    p.endTable();
}
Also used : AbstractHtmlAction(org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction) SessionInspector(org.eclipse.scout.rt.server.admin.inspector.SessionInspector)

Example 2 with AbstractHtmlAction

use of org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction in project scout.rt by eclipse.

the class MessagesView method renderMessages.

private void renderMessages(HtmlComponent p) {
    AbstractHtmlAction a = p.getInvokedAction();
    if (a != null) {
        if (a.getException() != null) {
            StringWriter sw = new StringWriter();
            a.getException().printStackTrace(new PrintWriter(sw, true));
            p.raw("<pre>");
            p.print(sw.toString());
            p.raw("</pre>");
            p.br();
        }
        if (a.getPlainText() != null) {
            p.raw("<pre>");
            p.print(a.getPlainText());
            p.raw("</pre>");
            p.br();
        }
    }
}
Also used : AbstractHtmlAction(org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction) StringWriter(java.io.StringWriter) PrintWriter(java.io.PrintWriter)

Example 3 with AbstractHtmlAction

use of org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction in project scout.rt by eclipse.

the class SessionsView method renderSessionDetailsCell.

protected void renderSessionDetailsCell(HtmlComponent p, final SessionInspector session) {
    p.startTableCell();
    p.startLinkAction(new AbstractHtmlAction("showServicesOf" + session.getInfo().getSessionId()) {

        @Override
        public void run() {
            m_selectedSession = session;
            getAdminSession().getTopView().showServices();
        }
    });
    p.print("Services");
    p.endLinkAction();
    p.raw("&nbsp;");
    p.startLinkAction(new AbstractHtmlAction("showCallsOf" + session.getInfo().getSessionId()) {

        @Override
        public void run() {
            m_selectedSession = session;
            getAdminSession().getTopView().showCalls();
        }
    });
    p.print("Calls");
    p.endLinkAction();
    p.endTableCell();
}
Also used : AbstractHtmlAction(org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction)

Example 4 with AbstractHtmlAction

use of org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction in project scout.rt by eclipse.

the class SessionsView method produceBody.

@Override
public void produceBody(HtmlComponent p) {
    p.linkAction("Clear sessions", new AbstractHtmlAction("clearSessions") {

        @Override
        public void run() {
            ProcessInspector.instance().clearSessionInspectors();
        }
    });
    p.p();
    // 
    renderSessionTable(p);
}
Also used : AbstractHtmlAction(org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction)

Example 5 with AbstractHtmlAction

use of org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction in project scout.rt by eclipse.

the class CallsView method renderCallRow.

private void renderCallRow(HtmlComponent p, int index, final CallInspector call) {
    boolean selected = m_selectedCall != null && (m_selectedCall == call);
    SimpleDateFormat startFmt = new SimpleDateFormat("dd.MM.yyyy HH:mm:ss");
    String serviceShortName = call.getInfo().getService();
    int i = Math.max(serviceShortName.lastIndexOf('.'), serviceShortName.lastIndexOf('$'));
    if (i >= 0) {
        serviceShortName = serviceShortName.substring(i + 1);
    }
    CallInfo info = call.getInfo();
    // 
    p.startTableRow();
    p.tableCell("" + index);
    p.startTableCell();
    String callId = serviceShortName + "." + info.getOperation();
    String callKey = serviceShortName + "." + info.getOperation() + "." + info.getStartTime();
    if (selected) {
        p.focusAnchor();
    }
    p.startLinkAction(new AbstractHtmlAction("selectCall." + callKey) {

        @Override
        public void run() {
            m_selectedCall = call;
        }
    });
    if (selected) {
        p.bold(callId);
    } else {
        p.print(callId);
    }
    p.endLinkAction();
    p.endTableCell();
    p.startTableCell();
    p.printNoBreak(startFmt.format(new Date(info.getStartTime())));
    p.endTableCell();
    p.startTableCell();
    p.printNoBreak("" + info.getDuration() + " ms");
    p.endTableCell();
    p.startTableCell();
    if (info.isActive()) {
        p.printNoBreak("RUNNING");
    } else {
        if (info.getReturnException() == null) {
            p.raw("<font color='008800'>");
            p.printNoBreak("COMPLETED OK");
            p.raw("</font>");
        } else {
            p.raw("<font color='880000'>");
            p.printNoBreak("COMPLETED WITH ERROR");
            p.raw("</font>");
        }
    }
    p.endTableCell();
    p.endTableRow();
}
Also used : AbstractHtmlAction(org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction) CallInfo(org.eclipse.scout.rt.server.admin.inspector.info.CallInfo) SimpleDateFormat(java.text.SimpleDateFormat) Date(java.util.Date)

Aggregations

AbstractHtmlAction (org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction)11 PropertyDescriptor (java.beans.PropertyDescriptor)1 PrintWriter (java.io.PrintWriter)1 StringWriter (java.io.StringWriter)1 SimpleDateFormat (java.text.SimpleDateFormat)1 Date (java.util.Date)1 TreeMap (java.util.TreeMap)1 CompositeObject (org.eclipse.scout.rt.platform.util.CompositeObject)1 IView (org.eclipse.scout.rt.server.admin.html.IView)1 ProcessInspector (org.eclipse.scout.rt.server.admin.inspector.ProcessInspector)1 ServiceInspector (org.eclipse.scout.rt.server.admin.inspector.ServiceInspector)1 SessionInspector (org.eclipse.scout.rt.server.admin.inspector.SessionInspector)1 CallInfo (org.eclipse.scout.rt.server.admin.inspector.info.CallInfo)1 UpdateServiceConfigurationPermission (org.eclipse.scout.rt.shared.security.UpdateServiceConfigurationPermission)1 IPingService (org.eclipse.scout.rt.shared.services.common.ping.IPingService)1