-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.cfm
55 lines (54 loc) · 1.83 KB
/
index.cfm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<cfscript>
request.self = ListFirst(cgi.REQUEST_URL,"?") &"?action=Plugin";
url.action = "Plugin";
url.plugin = "PerformanceAnalyzer";
request.version = DeserializeJson(FileRead(ExpandPath(".\box.json"))).version;
request.subtitle = "";
request.title = "Lucee Performance Analyzer - #request.version#";
param name="url.pluginAction" default="analysis";
param name="url.xhr" default="false";
variables.plugin = new source.cfml.plugins.Action(lang={},app={});
request.action = ListLast( url.pluginAction, "/\/" );
savecontent variable="body"{
switch ( request.action ){
case "logout":
sessionInvalidate();
location url="index.cfm" addtoken="false";
case "login":
if ( cgi.REQUEST_URL does not contain "/index.cfm" )
location url="index.cfm" addtoken="false";
cfinclude( template="login.cfm" );
break;
default:
if ( StructKeyExists( variables.plugin, request.action ) )
variables.plugin[ request.action ]( lang={}, app={}, req=url );
if ( !url.xhr )
variables.plugin.getRenderUtils().includeJavascript( "jquery-3.6.0.slim.min" );
variables.plugin._display( template=request.action & ".cfm", lang={}, app={}, req=url );
}
}
</cfscript>
<cfcontent reset="yes">
<html>
<head>
<cfoutput>
<title>#request.subtitle# <cfif len(request.subtitle)>-</cfif> #request.title#</title>
</cfoutput>
<meta name="robots" content="noindex,nofollow">
</head>
</html>
<body>
<cfoutput>
<div class="header">
<h1>Lucee Performance Analyzer (standalone) #request.version#</h1>
Lucee #server.lucee.version# / #UCFirst( request.adminType )# / <a href="/lucee/admin/server.cfm" target="_blank">Lucee Admin</a>
<cfif request.action neq "login">
/ <a href="?pluginAction=logout">Logout</a>
</cfif>
</div>
<div class="content">
#variables.plugin.getRenderUtils().cleanHtml(body)#
</div>
</cfoutput>
</body>
</html>