Repository navigation
Expand file tree
/
Copy pathe404.html
More file actions
118 lines (109 loc) · 2.94 KB
/
Copy pathe404.html
File metadata and controls
118 lines (109 loc) · 2.94 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
@extends(errorPage)
@args org.osgl.mvc.result.ErrorResult _error
@if(null != _conf.urlContext() && null == _action.router()) {
<p>@actMsg("e404.url_context.not_match")</p>
@return
}
@section(moreStyles){
<style>
code, table {
font-family: "Envy Code R", "Fira Code", "Source Code Pro Semibold", Monaco, Courier, monospace;
font-size: 11pt;
}
#route-table {
background-color: #000;
padding: 1px 6px;
}
table.hide {display: none;}
code {background-color: #444; padding: 0 4px; font-weight: bold;}
td.m, td.p, td.h, th.m, th.p, th.h {
padding: 3px 20px;
text-align: left;
max-width: 40%;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
td.p a {
text-decoration: none;
}
tr.odd {
background-color: #222;
}
tbody tr:hover, tbody tr.even:hover {
background-color: #883810;
cursor: default;
}
#toggle-routetable {
cursor: pointer;
color: #00b8b6;
}
</style>
}
@import act.route.*
@{
List<RouteInfo> routes = _action.router().debug();
act.route.RouteInfo req = RouteInfo.of(_action);
}
@def tr(RouteInfo r, String parity) {
<tr class="route @parity">
<td class="m">@r.method()</td>
<td class="p" title="@r.path()">
@if (r.method() == "GET") {
<a href="@r.path()">@r.path()</a>
} else {
@r.path()
}
</td>
<td class="h" title="@r.handler()">@r.compactHandler()</td>
</tr>
}
@{
act.app.SourceInfo sourceInfo = null;
act.app.SourceInfo templateSourceInfo = null;
if (_error instanceof act.util.ActError) {
act.util.ActError actError = (act.util.ActError)_error;
sourceInfo = actError.sourceInfo();
if (_error instanceof act.view.RythmTemplateException) {
templateSourceInfo = ((act.view.RythmTemplateException) actError).templateSourceInfo();
}
}
}
<p>
@if(null == sourceInfo && null == templateSourceInfo) {
@actMsg("e404.cannot_find_handler_in_req", req.method(), req.path()).raw()
}
@actMsg("e404.route_table")(<span id="toggle-routetable" class="expanded" onclick="toggleRouteTable()">@actMsg("e404.hide")</span>)</p>
<table id="route-table">
<thead>
<tr>
<th class="m">@actMsg("e404.method")</th>
<th class="p">@actMsg("e404.path")</th>
<th class="h">@actMsg("e404.handler")</th>
</tr>
</thead>
<tbody>
@for(RouteInfo r: routes) {@tr(r, r_parity)}
</tbody>
</table>
<script>
function toggleRouteTable() {
var btn = document.getElementById("toggle-routetable");
var tbl = document.getElementById("route-table");
if (btn.className == 'expanded') {
tbl.className = 'hide';
btn.className = 'collapsed';
btn.innerText = '@actMsg("e404.open")';
} else {
tbl.className = '';
btn.className = 'expanded';
btn.innerText = '@actMsg("e404.hide")';
}
}
@if(null != sourceInfo || null != templateSourceInfo) {
toggleRouteTable();
}
</script>
@section(description) {
@actMsg("e404.desc")
}