SuperX-Kernmodul
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

446 lines
14 KiB

<%@ taglib uri="/WEB-INF/dbforms.tld" prefix="db" %>
<%@page pageEncoding="utf-8" contentType="text/html; charset=UTF-8" %>
<%@ page import ="de.superx.servlet.ServletUtils" %>
<%@ page import ="de.superx.servlet.SxPools" %>
<%@ page import ="java.lang.management.*" %>
<%@ page import ="java.util.List" %>
<%@ page import ="java.util.Properties" %>
<%@ page import ="java.util.Enumeration" %>
<%@ page import ="java.io.File" %>
<%@ page import ="de.memtext.util.FileUtils" %>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Webanwendung Manager</title>
<link rel="stylesheet" href="../../style/bulma.css" />
<script type="text/javascript" src="/superx/xml/js/memtext/sx_functions.js"></script>
</head>
<script language="Javascript">
function getVersion()
{
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("version").innerHTML = this.responseText;
}
};
xhttp.open("GET", "../../sxrest/version", true);
xhttp.send();
}
function ManagerCacheRefresh()
{
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("ManagerCacheStatus").innerHTML = this.responseText;
}
};
xhttp.open("GET", "../../sxrest/managercache_refresh", true);
xhttp.send();
}
function TransletCacheRefresh()
{
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("TransletCacheStatus").innerHTML = this.responseText;
}
};
xhttp.open("GET", "../../sxrest/transletcache_refresh", true);
xhttp.send();
}
function getLogs(logtype,caption,loglines)
{
document.getElementById("MaskHeader").innerHTML=(logtype.startsWith("server")?"Server-Logdateien":"Maskenprotokolle");
document.getElementById("MaskSubHeader").innerHTML=caption;
if(document.forms['log'] && document.forms['log'].elements['logtype'])
{
document.forms['log'].elements['logtype'].value=logtype;
}
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById("Inhalt").innerHTML = this.responseText;
}
};
xhttp.open("GET", "../../sxrest/logs/"+logtype+"?loglines="+loglines, true);
xhttp.send();
}
function showLogElem(outElem,caption)
{
document.getElementById("LogHeader").innerHTML=caption;
//document.getElementById("LogSubHeader").innerHTML=caption;
const allElems = ["catalinaOut", "sqlOut", "xmlOut"];
for (const element of allElems) {
if(outElem==element)
document.getElementById(element).style.display="block";
else
document.getElementById(element).style.display="none";
}
}
</script>
<body>
<%
Object userobject=request.getSession().getAttribute("UserID");
String userid;
if(userobject == null)
{
%>
<jsp:forward page="/edit/not_authenticated.htm"/>
<%
}
else
userid=userobject.toString();
Object mandantobject=request.getSession().getAttribute("MandantenID");
String mandantenid="";
if(mandantobject != null)
mandantenid=mandantobject.toString();
//der superx-Default-Mandant ist bei dbforms ein Leerstring
if(mandantenid.equals("default"))
mandantenid="";
String db_form_name="userinfo";
String erlaubt="0";
%>
<%@ include file="/edit/check_authentication.inc" %>
<%
if(erlaubt.equals("0"))
{
%>
<jsp:forward page="/edit/not_authorized.htm"/>
<%
}
//init Variables:
String EntwicklungsmodusAn="";
String EntwicklungsmodusAus="checked";
if(de.superx.servlet.SuperXManager.isDevelopmentMode)
{
EntwicklungsmodusAn="checked";
EntwicklungsmodusAus="";
}
String sxversion=de.superx.servlet.SuperXManager.sxversion;
String builddatum=de.superx.servlet.SuperXManager.builddatum;
String finRechteInfos=SxPools.getPoolFinRechteInfos();
String platform=de.superx.servlet.SuperXManager.isHis1?"HISinOne":"SuperX";
String webinfpfad=de.superx.servlet.SuperXManager.getWEB_INFPfad();
String javaVersion=System.getProperties().get("java.version").toString();
//String jvmMemory=String.valueOf(Runtime.totalMemory()/(1024* 1024));
RuntimeMXBean runtimeMXBean = ManagementFactory.getRuntimeMXBean();
List<String> jvmArgs = runtimeMXBean.getInputArguments();
Properties props = new Properties();
String dbpropfile="db.properties";
if(mandantenid.equals(""))
mandantenid="default";
if(!mandantenid.equalsIgnoreCase("default"))
dbpropfile="db_"+mandantenid+".properties";
String dbproppath=webinfpfad+ File.separator+dbpropfile;
java.io.FileInputStream is = new java.io.FileInputStream(dbproppath);
if (is != null) {
props.load(is);
is.close();
} else {
System.err.println("kann "+ dbproppath +" nicht einlesen");
}
String tab = request.getParameter("tab");
if(tab == null)
tab="";
%>
<!-- START NAV -->
<nav class="navbar is-white">
<div class="container">
<div class="navbar-brand">
<a class="navbar-item" href="webapp_manager.jsp">Webanwendung Manager</a>
</div>
<!-- <div id="navMenu" class="navbar-menu">
<div class="navbar-start">
<a class="navbar-item" href="webapp_manager.jsp?tab=inst">
Installation /Patches
</a>
<a class="navbar-item" href="webapp_manager.jsp?tab=load">
Konnektoren
</a>-->
<a class="navbar-item" href="webapp_manager.jsp?tab=mask">
Masken
</a>
<a class="navbar-item" href="webapp_manager.jsp?tab=db">
Datenbank
</a>
<a class="navbar-item" href="webapp_manager.jsp?tab=log">
Logs
</a>
</div>
</div>
</div>
</nav>
<!-- END NAV -->
<div class="container">
<div class="columns">
<div class="column is-3 ">
<aside class="menu is-hidden-mobile">
<%
if(tab.equals("mask"))
{
%>
<ul class="menu-list">
<li><a class="is-active">Maskenprotokolle</a></li>
</ul>
<ul class="menu-list">
<li><a onClick="getLogs('activity','Letzte Maske',100000);">Letzte Maske</a></li>
<li><a onClick="getLogs('fmsql','SQL vor Freemarker-Transformation',100000);">SQL vor Freemarker-Transf.</a></li>
<li><a onClick="getLogs('sql','SQL nach Freemarker-Transformation',100000);">SQL nach Freemarker-Transf.</a></li>
<li><a onClick="getLogs('xml','XML-Ergebnis',100000);">XML-Ergebnis</a></li>
</ul>
<%
} //Ende Masken Menü
if(tab.equals("log"))
{
%>
<ul class="menu-list">
<li><a class="is-active">Server-Logdateien</a></li>
</ul>
<ul class="menu-list">
<li><a onClick="getLogs('serverlog','Server log',document.forms['log'].elements['loglines'].value);">Server log</a></li>
<li><a onClick="getLogs('serverlogsql','SQL-Log',document.forms['log'].elements['loglines'].value);">SQL log</a></li>
<li><a onClick="getLogs('serverlogxml','XML-Log',document.forms['log'].elements['loglines'].value);">XML log</a></li>
</ul>
<%
} //Ende log Menü
%>
</aside>
</div>
<div class="column is-9">
<%
if(tab.equals(""))
{
%>
<section class="hero is-info welcome is-small">
<div class="hero-body">
<div class="container">
<h1 class="title">
Webanwendung Manager
</h1>
<h2 class="subtitle">
Serverstatus
</h2>
</div>
</div>
</section>
<section class="info-tiles">
<div class="tile is-ancestor has-text-centered">
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Serverumgebung</p>
<p class="subtitle">JVM-Parameter</p>
<textarea name="env" readonly="readonly" rows="10" cols="30"><%
out.println("Java Version:"+javaVersion.trim());
out.println("WEB-INF-Pfad: "+ webinfpfad);
for (String arg : jvmArgs) {
out.println(arg);
}
%></textarea>
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Server Cache</p>
<p class="subtitle">aktualisieren</p>
<button class="button has-tooltip-multiline has-tooltip-right" data-tooltip="Es werden Erläuterungen und Übersetzungen (captions) gecacht. Fürs XML-Frontend auch: User,Userrechte und Sichten, und auch Abfragen wenn in der db.properties eingetragen"
onClick="ManagerCacheRefresh();">Gesamter Cache</button><br />
<span id="ManagerCacheStatus"></span><br />
<button class="button has-tooltip-multiline has-tooltip-right" data-tooltip="Nur XSL-Stylesheets Translet Cache leeren"
onClick="TransletCacheRefresh();">Nur Stylesheet Cache</button><br />
<span id="TransletCacheStatus"></span><br />
</article>
</div>
<div class="tile is-parent">
<article class="tile is-child box">
<p class="title">Einstellungen</p>
<p class="subtitle">der Webanwendung</p>
<p align="left">Version: <%= sxversion %><br />
Builddatum: <%= builddatum %><br />
Plattform: <%= platform %><br />
Aktueller Mandant: <%= mandantenid %><br />
Installierte Mandanten: <br />
<%= finRechteInfos %>
</article>
</div>
<!--<div class="tile is-parent">
<article class="tile is-child box">
<p class="title"></p>
<p class="subtitle"></p>
</article>
</div>-->
</div>
</section>
<div class="columns">
<div class="column is-6">
</div>
<div class="column is-6">
</div>
</div>
<%
} //Ende Tiles Startseite
%>
<%
if(tab.equals("mask"))
{
%>
<section class="hero is-info welcome is-small">
<div class="hero-body">
<div class="container">
<h1 class="title" id="MaskHeader">
Masken-Verwaltung
</h1>
<h2 class="subtitle" id="MaskSubHeader">
Wählen Sie links das Masken-Menü
</h2>
</div>
</div>
</section>
<section class="section">
<div class="container" id="loadMask" >
<div class="bd-snippet-code highlight-full ">
<figure class="highlight"><div class="buttons has-addons is-right">
<button class="button is-small is-info" onClick="copyText('Inhalt');">Kopieren</button>
</div>
<textarea id="Inhalt" name="Inhalt" class="textarea" placeholder="Inhalt..." rows="20"></textarea>
</figure>
</div>
</div>
</section>
<%
} //Ende Mask Content
if(tab.equals("db"))
{
%>
<section class="hero is-info welcome is-small">
<div class="hero-body">
<div class="container">
<h1 class="title" id="MaskHeader">
Datenbank
</h1>
<h2 class="subtitle" id="MaskSubHeader">
Verbindungsparameter
</h2>
</div>
</div>
</section>
<section class="section">
<div class="container">
<p align="left"><%
Enumeration propNames = props.propertyNames();
while (propNames.hasMoreElements()) {
String propName = (String)propNames.nextElement();
String propValue = props.getProperty(propName);
if(propName.equals("connectionPassword"))
out.println(propName+": ...<br />");
else
out.println(propName+": "+ propValue+"<br />");
}
%>
</p>
</div>
</section>
<%
} //Ende db Content
if(tab.equals("log"))
{
%>
<section class="hero is-info welcome is-small">
<div class="hero-body">
<div class="container">
<h1 class="title" id="MaskHeader">
Server-Logdateien
</h1>
<h2 class="subtitle" id="MaskSubHeader">
Logtyp
</h2>
</div>
</div>
</section>
<section class="section">
<form name="log" onsubmit="getLogs(document.forms['log'].elements['logtype'].value,document.getElementById('MaskSubHeader').innerHTML,document.forms['log'].elements['loglines'].value);return false;" >
<div class="container" id="loadMask" >
<div> (max. letzte <input type="hidden" name="logtype" value="" /> <input type="text" size="5" maxlength="5" name="loglines" value="100" /> 100 Zeilen)
<textarea id="Inhalt" name="Inhalt" class="textarea" placeholder="Inhalt..." rows="20"></textarea>
</div>
</div>
</form>
</section>
<%
} //Ende log Content
%>
</div>
</div>
</div>
<!--<script async type="text/javascript" src="../js/bulma.js"></script>-->
</body>
</html>