-
Notifications
You must be signed in to change notification settings - Fork 10
/
index.cfm
83 lines (63 loc) · 1.9 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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<cfinclude template="../header.cfm">
<cfscript>
debugger = createObject("component", "cfide.adminapi.debugging");
logfolder = debugger.getLogProperty("logdirectory");
function tailFile(filename) {
try {
var line = "";
var lines = "";
var theFile = createObject("java","java.io.File").init(filename);
var raFile = createObject("java","java.io.RandomAccessFile").init(theFile,"r");
var pos = theFile.length();
var c = "";
var total = 10;
if(arrayLen(arguments) gte 2) total = arguments[2];
raFile.seek(pos-1);
while( (listLen(line,chr(10)) <= total) && pos > -1) {
c = raFile.read();
//if(c != -1) writeOutput("#c#=" & chr(c) & "<br/>");
if(c != -1) line &= chr(c);
raFile.seek(pos--);
}
line = reverse(line);
lines = listToArray(line, chr(10));
arrayDeleteAt(lines,1);
raFile.close();
return lines;
} catch (any e) {
return [];
};
}
events = tailFile("#logfolder#/configmanager.log",20);
</cfscript>
<h2 class="pageHeader">Configuration Manager</h2>
<br>
This page lists recent changes made by remote Admin API calls. The full log can be found at <cfoutput>#logfolder#/configmanager.log</cfoutput>.
<br>
<br>
<table width="100%" cellspacing="0" cellpadding="5" border="0">
<tr>
<td class="cellBlueTopAndBottom" bgcolor="#E2E6E7">
<b> Recent API Calls </b>
</td>
</tr>
<tr>
<td>
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr>
<th class="cellBlueTopAndBottom" width="50" nowrap="" bgcolor="#F3F7F7" scope="col">
<strong> Log Entry </strong>
</th>
</tr>
<cfloop from="#ArrayLen(events)#" index="i" to="1" step="-1">
<tr bgcolor="ffffff">
<td class="cell3BlueSides">
<cfoutput>#events[i]#</cfoutput>
</td>
</tr>
</cfloop>
</table>
</t>
</tr>
</table>
<cfinclude template="../footer.cfm">