use of org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction in project scout.rt by eclipse.
the class GeneralView method createMonitoringQuickLink.
private String createMonitoringQuickLink(HtmlComponent p) {
if (!ACCESS.check(new UpdateServiceConfigurationPermission())) {
return null;
}
final ProcessInspector inst = ProcessInspector.instance();
if (inst.isEnabled()) {
p.print("Monitor is active with maximum caching of " + (inst.getTimeout() / 1000 / 60) + " minutes [ ");
p.linkAction("cache 2 min", new P_SetTimeoutAction(2));
p.print(" | ");
p.linkAction("cache 15 min", new P_SetTimeoutAction(15));
p.print(" | ");
p.linkAction("cache 60 min", new P_SetTimeoutAction(60));
p.print(" | ");
p.linkAction("deactivate", new P_EnableAction(false));
p.print(" ]");
p.br();
if (inst.acceptCall(IPingService.class.getName(), "ping")) {
p.linkAction("IPingService.ping (click to toggle)", new AbstractHtmlAction("IPingService.ignore") {
@Override
public void run() {
inst.getIgnoredCallSet().clear();
inst.getIgnoredCallSet().add(".*\\.IPingService\\.ping");
}
});
} else {
p.startLinkAction(new AbstractHtmlAction("IPingService.accept") {
@Override
public void run() {
inst.getIgnoredCallSet().clear();
}
});
p.raw("<s>");
p.printNoBreak("IPingService.ping");
p.raw("</s>");
p.printNoBreak(" (click to toggle)");
p.endLinkAction();
}
} else {
p.print("Monitor is inactive [ ");
p.linkAction("activate", new P_EnableAction(true));
p.print(" ]");
}
p.p();
if (inst.isEnabled()) {
return "<p><b>Note: Session Activity Monitor is enabled; this might affect performance and memory due to higher resource consumption during analysis.</b><p>";
}
return null;
}
use of org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction in project scout.rt by eclipse.
the class ServicesView method renderServiceTable.
private void renderServiceTable(HtmlComponent p, String sectionName, Collection<ServiceInspector> serviceInspectors) {
// sort
TreeMap<String, ServiceInspector> sortMap = new TreeMap<String, ServiceInspector>();
for (ServiceInspector inspector : serviceInspectors) {
String s = inspector.getService().getClass().getName();
sortMap.put(s, inspector);
}
p.p(sectionName);
p.startListBox("listBox", 1, true);
p.listBoxOption(" ", new AbstractHtmlAction("selectService.choose") {
@Override
public void run() {
// do nothing
}
}, false);
for (ServiceInspector serviceInspector : sortMap.values()) {
boolean selected = m_selectedService != null && (m_selectedService.getService() == serviceInspector.getService());
final ServiceInspector finalServiceInspector = serviceInspector;
p.listBoxOption(serviceInspector.getService().getClass().getName(), new AbstractHtmlAction("selectService2." + serviceInspector.getService().getClass().getName()) {
@Override
public void run() {
m_selectedService = finalServiceInspector;
}
}, selected);
}
p.endListBox();
}
use of org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction in project scout.rt by eclipse.
the class ServicesView method renderProperties.
private void renderProperties(HtmlComponent p, final ServiceInspector service, ReflectServiceInventory inv) {
PropertyDescriptor[] properties = inv.getProperties();
if (properties.length > 0) {
p.pBold("Properties (" + properties.length + ")");
p.startTable(1, 0, 4);
p.startTableRow();
p.tableHeaderCell("Property name");
p.tableHeaderCell("Value");
p.endTableRow();
for (PropertyDescriptor desc : properties) {
String propName = desc.getName();
String propValue = "[value not available]";
if (desc.getReadMethod() != null) {
try {
propValue = formatPropertyValue(desc, desc.getReadMethod().invoke(service.getService(), (Object[]) null));
} catch (Exception e) {
// NOSONAR
// nop
}
}
boolean editable = desc.getWriteMethod() != null;
//
if (editable) {
final PropertyDescriptor finalDesc = desc;
p.startForm(new AbstractHtmlAction("changeProp." + service.getService().getClass().getName() + "." + desc.getName()) {
@Override
public void run() {
String propText = getFormParameter("value", "");
if (propText.length() == 0) {
propText = null;
}
try {
service.changeProperty(finalDesc, propText);
} catch (Exception e) {
LOG.error("setting {}={}", finalDesc.getName(), propText, e);
}
}
});
}
p.startTableRow();
p.tableCell(propName);
p.startTableCell();
if (editable) {
p.formTextArea("value", getPropertyDisplayValue(propName, propValue));
p.formSubmit("Change");
} else {
p.print(getPropertyDisplayValue(propName, propValue));
}
p.endTableCell();
p.endTableRow();
if (editable) {
p.endForm();
}
}
p.endTable();
}
}
use of org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction in project scout.rt by eclipse.
the class SessionsView method renderSessionIdCell.
protected void renderSessionIdCell(HtmlComponent p, final SessionInspector session) {
p.startTableCell();
if (isSelectedSession(session)) {
p.focusAnchor();
}
p.startLinkAction(new AbstractHtmlAction("selectSession" + session.getInfo().getSessionId()) {
@Override
public void run() {
m_selectedSession = session;
}
});
p.print(session.getInfo().getSessionId());
p.endLinkAction();
p.endTableCell();
}
use of org.eclipse.scout.rt.server.admin.html.AbstractHtmlAction in project scout.rt by eclipse.
the class TopView method produceBody.
@Override
public void produceBody(HtmlComponent p) {
m_messagesView.produceBody(p);
p.raw("[ ");
for (IView v : new IView[] { m_generalView, m_servicesView, m_sessionsView, m_callsView }) {
if (v.isVisible()) {
p.raw(" ");
if (v == m_activeView) {
p.raw("<b>");
v.produceTitle(p);
p.raw("</b>");
} else {
final IView finalV = v;
p.startLinkAction(new AbstractHtmlAction("tab." + v.getClass().getSimpleName()) {
@Override
public void run() {
m_activeView = finalV;
if (m_activeView != null) {
m_activeView.activated();
}
}
});
v.produceTitle(p);
p.endLinkAction();
}
p.raw(" ");
p.raw(" ");
}
}
p.raw(" ]");
p.p();
if (m_activeView != null) {
m_activeView.produceBody(p);
}
}
Aggregations