mirror of
https://github.com/RSS-Bridge/rss-bridge.git
synced 2025-04-10 17:08:47 +00:00
refactor/fix: css organization and error rendering (#3117)
* fix: php notice * refactor/feat: merge HtmlFormat.css into style.css Also improve ux of error rendering. * fix: center-align footer text
This commit is contained in:
parent
1b45a53402
commit
23f8c81646
@ -163,14 +163,15 @@ class DisplayAction implements ActionInterface
|
|||||||
// Create "new" error message every 24 hours
|
// Create "new" error message every 24 hours
|
||||||
$request['_error_time'] = urlencode((int)(time() / 86400));
|
$request['_error_time'] = urlencode((int)(time() / 86400));
|
||||||
|
|
||||||
|
// todo: I don't think this _error_time in the title is useful. It's confusing.
|
||||||
$itemTitle = sprintf('Bridge returned error %s! (%s)', $e->getCode(), $request['_error_time']);
|
$itemTitle = sprintf('Bridge returned error %s! (%s)', $e->getCode(), $request['_error_time']);
|
||||||
$item->setTitle($itemTitle);
|
$item->setTitle($itemTitle);
|
||||||
$item->setURI(get_current_url());
|
$item->setURI(get_current_url());
|
||||||
$item->setTimestamp(time());
|
$item->setTimestamp(time());
|
||||||
|
|
||||||
|
// todo: consider giving more helpful error messages
|
||||||
$content = render_template(__DIR__ . '/../templates/bridge-error.html.php', [
|
$content = render_template(__DIR__ . '/../templates/bridge-error.html.php', [
|
||||||
'message' => create_sane_exception_message($e),
|
'error' => render_template(__DIR__ . '/../templates/error.html.php', ['e' => $e]),
|
||||||
'trace' => trace_from_exception($e),
|
|
||||||
'searchUrl' => self::createGithubSearchUrl($bridge),
|
'searchUrl' => self::createGithubSearchUrl($bridge),
|
||||||
'issueUrl' => self::createGithubIssueUrl($bridge, $e, create_sane_exception_message($e)),
|
'issueUrl' => self::createGithubIssueUrl($bridge, $e, create_sane_exception_message($e)),
|
||||||
'maintainer' => $bridge->getMaintainer(),
|
'maintainer' => $bridge->getMaintainer(),
|
||||||
|
@ -35,6 +35,7 @@ final class FrontpageAction implements ActionInterface
|
|||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="rssbridge_list_search()">
|
<body onload="rssbridge_list_search()">
|
||||||
|
<div class="container">
|
||||||
EOD;
|
EOD;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,6 +147,7 @@ EOD;
|
|||||||
{$inactive}
|
{$inactive}
|
||||||
{$admininfo}
|
{$admininfo}
|
||||||
</section>
|
</section>
|
||||||
|
</div>
|
||||||
</body></html>
|
</body></html>
|
||||||
EOD;
|
EOD;
|
||||||
}
|
}
|
||||||
|
@ -59,6 +59,7 @@ TEXT;
|
|||||||
|
|
||||||
foreach ($feeds as $feed) {
|
foreach ($feeds as $feed) {
|
||||||
// Fetch all items from the feed
|
// Fetch all items from the feed
|
||||||
|
// todo: consider wrapping this in a try..catch to not let a single feed break the entire bridge?
|
||||||
$this->collectExpandableDatas($feed);
|
$this->collectExpandableDatas($feed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -120,11 +120,14 @@ class NovayaGazetaEuropeBridge extends BridgeAbstract
|
|||||||
case 'text/quote':
|
case 'text/quote':
|
||||||
return "<figure><blockquote>{$datum->data}</blockquote></figure><br>";
|
return "<figure><blockquote>{$datum->data}</blockquote></figure><br>";
|
||||||
case 'embed/native':
|
case 'embed/native':
|
||||||
|
if (isset($datum->link)) {
|
||||||
$desc = $datum->link;
|
$desc = $datum->link;
|
||||||
if (property_exists($datum, 'caption')) {
|
if (isset($datum->caption)) {
|
||||||
$desc = $datum->caption;
|
$desc = $datum->caption;
|
||||||
}
|
}
|
||||||
return "<p><a link=\"{$datum->link}\">{$desc}</a></p>";
|
return sprintf('<p><a href="%s">%s</a></p>', $datum->link, $desc);
|
||||||
|
}
|
||||||
|
return '';
|
||||||
case 'text/framed':
|
case 'text/framed':
|
||||||
$res = '';
|
$res = '';
|
||||||
if (property_exists($datum, 'typeDisplay')) {
|
if (property_exists($datum, 'typeDisplay')) {
|
||||||
|
@ -29,26 +29,31 @@ final class Logger
|
|||||||
private static function log(string $level, string $message, array $context = []): void
|
private static function log(string $level, string $message, array $context = []): void
|
||||||
{
|
{
|
||||||
if (isset($context['e'])) {
|
if (isset($context['e'])) {
|
||||||
$context['message'] = create_sane_exception_message($context['e']);
|
/** @var \Throwable $e */
|
||||||
$context['code'] = $context['e']->getCode();
|
$e = $context['e'];
|
||||||
$context['url'] = get_current_url();
|
|
||||||
$context['trace'] = trace_to_call_points(trace_from_exception($context['e']));
|
|
||||||
unset($context['e']);
|
unset($context['e']);
|
||||||
// Don't log these records
|
$context['type'] = get_class($e);
|
||||||
|
$context['code'] = $e->getCode();
|
||||||
|
$context['message'] = $e->getMessage();
|
||||||
|
$context['file'] = trim_path_prefix($e->getFile());
|
||||||
|
$context['line'] = $e->getLine();
|
||||||
|
$context['url'] = get_current_url();
|
||||||
|
$context['trace'] = trace_to_call_points(trace_from_exception($e));
|
||||||
|
// Don't log these exceptions
|
||||||
$ignoredExceptions = [
|
$ignoredExceptions = [
|
||||||
'Exception Exception: You must specify a format',
|
'You must specify a format',
|
||||||
'Exception InvalidArgumentException: Format name invalid',
|
'Format name invalid',
|
||||||
'Exception InvalidArgumentException: Unknown format given',
|
'Unknown format given',
|
||||||
'Exception InvalidArgumentException: Bridge name invalid',
|
'Bridge name invalid',
|
||||||
'Exception Exception: Invalid action',
|
'Invalid action',
|
||||||
'Exception Exception: twitter: No results for this query',
|
'twitter: No results for this query',
|
||||||
// telegram
|
// telegram
|
||||||
'Exception Exception: Unable to find channel. The channel is non-existing or non-public',
|
'Unable to find channel. The channel is non-existing or non-public',
|
||||||
// fb
|
// fb
|
||||||
'Exception Exception: This group is not public! RSS-Bridge only supports public groups!',
|
'This group is not public! RSS-Bridge only supports public groups!',
|
||||||
];
|
];
|
||||||
foreach ($ignoredExceptions as $ignoredException) {
|
foreach ($ignoredExceptions as $ignoredException) {
|
||||||
if (str_starts_with($context['message'], $ignoredException)) {
|
if (str_starts_with($e->getMessage(), $ignoredException)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -16,10 +16,7 @@ final class RssBridge
|
|||||||
} catch (\Throwable $e) {
|
} catch (\Throwable $e) {
|
||||||
Logger::error('Exception in main', ['e' => $e]);
|
Logger::error('Exception in main', ['e' => $e]);
|
||||||
http_response_code(500);
|
http_response_code(500);
|
||||||
print render(__DIR__ . '/../templates/error.html.php', [
|
print render(__DIR__ . '/../templates/error.html.php', ['e' => $e]);
|
||||||
'message' => create_sane_exception_message($e),
|
|
||||||
'trace' => trace_from_exception($e),
|
|
||||||
]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ function frame_to_call_point(array $frame): string
|
|||||||
/**
|
/**
|
||||||
* Trim path prefix for privacy/security reasons
|
* Trim path prefix for privacy/security reasons
|
||||||
*
|
*
|
||||||
* Example: "/var/www/rss-bridge/index.php" => "index.php"
|
* Example: "/home/davidsf/rss-bridge/index.php" => "index.php"
|
||||||
*/
|
*/
|
||||||
function trim_path_prefix(string $filePath): string
|
function trim_path_prefix(string $filePath): string
|
||||||
{
|
{
|
||||||
|
@ -1,145 +0,0 @@
|
|||||||
html, body, div, span, applet, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, big, cite, code, del, dfn, em, img, ins, kbd, q, s, samp, small, strike, strong, sub, sup, tt, var, b, u, i, center, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, article, aside, canvas, details, figcaption, figure, footer, header, hgroup, menu, nav, section, summary, time, mark, audio, video {
|
|
||||||
margin: 0;
|
|
||||||
padding: 0;
|
|
||||||
border: 0;
|
|
||||||
outline: 0;
|
|
||||||
font-size: 100%;
|
|
||||||
font: inherit;
|
|
||||||
vertical-align: baseline;
|
|
||||||
}
|
|
||||||
/* HTML5 display-role reset for older browsers */
|
|
||||||
article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, section {
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
/* Let's go for the actual style */
|
|
||||||
body {
|
|
||||||
background-color: #f0f0f0;
|
|
||||||
font-family: -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";
|
|
||||||
}
|
|
||||||
a, a:link, a:visited {
|
|
||||||
color: #2196F3;
|
|
||||||
text-decoration: none;
|
|
||||||
}
|
|
||||||
a:hover {
|
|
||||||
text-decoration: underline;
|
|
||||||
}
|
|
||||||
img {
|
|
||||||
max-width: 100%;
|
|
||||||
}
|
|
||||||
/* Section */
|
|
||||||
section {
|
|
||||||
background-color: #FFFFFF;
|
|
||||||
width: 60%;
|
|
||||||
margin: 30px auto;
|
|
||||||
padding: 15px 15px;
|
|
||||||
box-shadow: 0 6px 15px rgba(0, 0, 0, 0.09);
|
|
||||||
border-radius: 4px;
|
|
||||||
}
|
|
||||||
section > h2 {
|
|
||||||
font-size: 200%;
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
h1.pagetitle {
|
|
||||||
margin: 40px 0 20px;
|
|
||||||
font-size: 300%;
|
|
||||||
font-weight: bold;
|
|
||||||
text-align: center;
|
|
||||||
color: #2196F3;
|
|
||||||
}
|
|
||||||
h1.pagetitle > a {
|
|
||||||
color: #2196F3;
|
|
||||||
}
|
|
||||||
a.backlink, a.backlink:link, a.backlink:visited, a.itemtitle, a.itemtitle:link, a.itemtitle:visited {
|
|
||||||
color: #2196F3;
|
|
||||||
}
|
|
||||||
.buttons {
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
section > div.content, section > div.attachments {
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
section h1, section h2, section h3, section b, section strong {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
section i, section em {
|
|
||||||
font-style: italic;
|
|
||||||
}
|
|
||||||
section p:not(:last-child) {
|
|
||||||
margin-bottom: 1em;
|
|
||||||
}
|
|
||||||
section li {
|
|
||||||
margin-left: 1em;
|
|
||||||
}
|
|
||||||
section > div.attachments > li.enclosure {
|
|
||||||
list-style-type: circle;
|
|
||||||
list-style-position: inside;
|
|
||||||
}
|
|
||||||
section > time, section > p.author {
|
|
||||||
color: #888;
|
|
||||||
font-size: 80%;
|
|
||||||
padding: 10px;
|
|
||||||
}
|
|
||||||
button {
|
|
||||||
line-height: 1.9em;
|
|
||||||
color: #FFF;
|
|
||||||
font-weight: bold;
|
|
||||||
vertical-align: middle;
|
|
||||||
padding: 6px 12px;
|
|
||||||
margin: 12px auto 0px;
|
|
||||||
border-radius: 4px;
|
|
||||||
border: 1px solid transparent;
|
|
||||||
background: #2196F3 none repeat scroll 0% 0%;
|
|
||||||
cursor: pointer;
|
|
||||||
width: 200px;
|
|
||||||
}
|
|
||||||
button:hover {
|
|
||||||
background: #49afff;
|
|
||||||
}
|
|
||||||
button.highlight {
|
|
||||||
background: #ff6600;
|
|
||||||
}
|
|
||||||
button.highlight:hover {
|
|
||||||
background: #ff8a3b;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@media screen and (max-width: 767px) {
|
|
||||||
|
|
||||||
section {
|
|
||||||
width: 100%;
|
|
||||||
padding: 0;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
|
||||||
display: inline-block;
|
|
||||||
width: 40%;
|
|
||||||
padding: 5px auto;
|
|
||||||
margin: 3px auto 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Dark theme, will automatically be set for those that have dark mode on their OS. */
|
|
||||||
@media (prefers-color-scheme: dark){
|
|
||||||
|
|
||||||
* {
|
|
||||||
scrollbar-color: #202324 #454a4d;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
background-color: #202325;
|
|
||||||
color: #e8e6e3;
|
|
||||||
}
|
|
||||||
|
|
||||||
a, a:link, a:visited {
|
|
||||||
color: #0A6AB6;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Section */
|
|
||||||
section {
|
|
||||||
background-color: #181A1B;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
157
static/style.css
157
static/style.css
@ -39,6 +39,7 @@ article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav,
|
|||||||
body {
|
body {
|
||||||
background-color: #f0f0f0;
|
background-color: #f0f0f0;
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
a, a:link, a:visited {
|
a, a:link, a:visited {
|
||||||
@ -53,14 +54,20 @@ a:hover {
|
|||||||
h1,h2 {
|
h1,h2 {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
h5 {
|
||||||
|
margin: 20px;
|
||||||
|
font-weight: bold;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
p {
|
p {
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
/* Header */
|
|
||||||
|
|
||||||
|
/* Header */
|
||||||
header {
|
header {
|
||||||
margin-top: 40px;
|
margin-top: 40px;
|
||||||
text-align: center;
|
padding: 15px;
|
||||||
color: #1182DB;
|
color: #1182DB;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -72,13 +79,11 @@ header > div.logo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
header > section.warning {
|
header > section.warning {
|
||||||
width: 40%;
|
|
||||||
background-color: #ffc600;
|
background-color: #ffc600;
|
||||||
color: #5f5f5f;
|
color: #5f5f5f;
|
||||||
}
|
}
|
||||||
|
|
||||||
header > section.critical-warning {
|
header > section.critical-warning {
|
||||||
width: 40%;
|
|
||||||
background-color: #cf3e3e;
|
background-color: #cf3e3e;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
color: white;
|
color: white;
|
||||||
@ -109,16 +114,16 @@ input:focus:-moz-placeholder { opacity: 0; }
|
|||||||
input:focus:-ms-input-placeholder { opacity: 0; }
|
input:focus:-ms-input-placeholder { opacity: 0; }
|
||||||
|
|
||||||
.searchbar {
|
.searchbar {
|
||||||
width: 40%;
|
width: 60%;
|
||||||
margin: 40px auto 100px;
|
text-align: center;
|
||||||
|
margin: 0 auto 50px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.searchbar input[type="text"] {
|
.searchbar input[type="text"] {
|
||||||
width: 90%;
|
width: 90%;
|
||||||
margin: auto;
|
|
||||||
font-size: 1.1em;
|
font-size: 1.1em;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 10px;
|
margin: auto auto 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.searchbar input[type="text"]::placeholder {
|
.searchbar input[type="text"]::placeholder {
|
||||||
@ -132,49 +137,47 @@ input:focus:-ms-input-placeholder { opacity: 0; }
|
|||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Section */
|
.container {
|
||||||
section {
|
|
||||||
background-color: #FFFFFF;
|
|
||||||
width: 60%;
|
width: 60%;
|
||||||
margin: 30px auto;
|
margin: 30px auto;
|
||||||
padding: 15px 15px;
|
}
|
||||||
text-align: center;
|
|
||||||
|
/* Section */
|
||||||
|
section {
|
||||||
|
margin-bottom: 10px;
|
||||||
|
background-color: #FFFFFF;
|
||||||
|
padding: 15px;
|
||||||
box-shadow: 0 6px 15px rgba(0, 0, 0, 0.09);
|
box-shadow: 0 6px 15px rgba(0, 0, 0, 0.09);
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
}
|
}
|
||||||
|
section > time,
|
||||||
|
section > p.author {
|
||||||
|
color: #888;
|
||||||
|
font-size: 80%;
|
||||||
|
padding: 10px;
|
||||||
|
}
|
||||||
section.footer {
|
section.footer {
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
section.footer:hover {
|
section.footer:hover {
|
||||||
opacity: 1;
|
opacity: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
section.footer .version {
|
|
||||||
font-size: 80%;
|
|
||||||
}
|
|
||||||
|
|
||||||
section > h2 {
|
section > h2 {
|
||||||
font-size: 200%;
|
font-size: 200%;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
section li {
|
||||||
|
margin-left: 1em;
|
||||||
|
}
|
||||||
|
.bridge-card {
|
||||||
|
text-align: center;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Buttons */
|
/* Buttons */
|
||||||
button {
|
|
||||||
line-height: 1.9em;
|
|
||||||
color: #FFF;
|
|
||||||
font-weight: bold;
|
|
||||||
vertical-align: middle;
|
|
||||||
padding: 6px 12px;
|
|
||||||
margin: 12px auto 0px;
|
|
||||||
border-radius: 4px;
|
|
||||||
border: 1px solid transparent;
|
|
||||||
background: #2196F3 none repeat scroll 0% 0%;
|
|
||||||
cursor: pointer;
|
|
||||||
width: calc(20% - 4px);
|
|
||||||
}
|
|
||||||
|
|
||||||
button.small {
|
button.small {
|
||||||
width: auto;
|
width: auto;
|
||||||
line-height: 1.2em;
|
line-height: 1.2em;
|
||||||
@ -188,11 +191,6 @@ button:hover {
|
|||||||
margin: 10px;
|
margin: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
h5 {
|
|
||||||
margin: 20px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
form {
|
form {
|
||||||
margin-bottom: 6px;
|
margin-bottom: 6px;
|
||||||
}
|
}
|
||||||
@ -206,7 +204,7 @@ form {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.info {
|
.info {
|
||||||
cursor: help;
|
cursor: pointer;
|
||||||
opacity: 0.5;
|
opacity: 0.5;
|
||||||
width: 24px;
|
width: 24px;
|
||||||
height: 24px;
|
height: 24px;
|
||||||
@ -265,7 +263,7 @@ form {
|
|||||||
|
|
||||||
} /* @supports (display: grid) */
|
} /* @supports (display: grid) */
|
||||||
|
|
||||||
.maintainer {
|
p.maintainer {
|
||||||
color: #888888;
|
color: #888888;
|
||||||
font-size: 70%;
|
font-size: 70%;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
@ -278,10 +276,15 @@ form {
|
|||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
border: 1px solid transparent;
|
border: 1px solid transparent;
|
||||||
width: 80%;
|
width: 80%;
|
||||||
margin: auto;
|
margin: auto auto 6px;
|
||||||
margin-bottom: 6px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.error strong {
|
||||||
|
display: inline-block;
|
||||||
|
width: 100px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Hide all forms on the frontpage by default */
|
||||||
form {
|
form {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -291,11 +294,7 @@ select {
|
|||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
h5 {
|
/* Show more/less */
|
||||||
display: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Show more / less */
|
|
||||||
.showmore-box {
|
.showmore-box {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
@ -321,26 +320,43 @@ h5 {
|
|||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Additional styles for error pages */
|
/* html format */
|
||||||
.exception-message {
|
h1.pagetitle {
|
||||||
background-color: #c00000;
|
margin: 40px 0 20px;
|
||||||
color: #FFFFFF;
|
font-size: 300%;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3);
|
text-align: center;
|
||||||
border-radius: 2px;
|
color: #2196F3;
|
||||||
border: 1px solid transparent;
|
|
||||||
width: 80%;
|
|
||||||
margin: auto;
|
|
||||||
margin-bottom: 6px;
|
|
||||||
}
|
}
|
||||||
|
h1.pagetitle > a {
|
||||||
.advice > li {
|
color: #2196F3;
|
||||||
text-align: left;
|
}
|
||||||
|
.buttons {
|
||||||
|
text-align: center;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
}
|
||||||
|
button {
|
||||||
|
line-height: 1.9em;
|
||||||
|
color: #FFF;
|
||||||
|
font-weight: bold;
|
||||||
|
vertical-align: middle;
|
||||||
|
padding: 6px 12px;
|
||||||
|
margin: 12px auto 0px;
|
||||||
|
border-radius: 4px;
|
||||||
|
border: 1px solid transparent;
|
||||||
|
background: #2196F3 none repeat scroll 0% 0%;
|
||||||
|
cursor: pointer;
|
||||||
|
width: 200px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media screen and (max-width: 767px) {
|
@media screen and (max-width: 767px) {
|
||||||
body {
|
.container {
|
||||||
font-size: 75%;
|
width: 100%;
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.searchbar {
|
||||||
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
header > div.logo {
|
header > div.logo {
|
||||||
@ -349,25 +365,6 @@ h5 {
|
|||||||
height: 89px;
|
height: 89px;
|
||||||
}
|
}
|
||||||
|
|
||||||
header > section.warning {
|
|
||||||
width: 90%;
|
|
||||||
}
|
|
||||||
|
|
||||||
header > section.critical-warning {
|
|
||||||
width: 90%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.searchbar {
|
|
||||||
width: 90%;
|
|
||||||
margin: 0 auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
section {
|
|
||||||
width: 90%;
|
|
||||||
margin: 10px auto;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
|
|
||||||
button {
|
button {
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
width: 40%;
|
width: 40%;
|
||||||
|
@ -1,6 +1,4 @@
|
|||||||
<section>
|
|
||||||
<h1>
|
|
||||||
Please authenticate in order to access this instance
|
|
||||||
</h1>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
|
<h1>
|
||||||
|
Please authenticate in order to access this instance
|
||||||
|
</h1>
|
||||||
|
@ -8,11 +8,15 @@
|
|||||||
<link href="static/style.css" rel="stylesheet">
|
<link href="static/style.css" rel="stylesheet">
|
||||||
<link rel="icon" type="image/png" href="static/favicon.png">
|
<link rel="icon" type="image/png" href="static/favicon.png">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
<div class="container">
|
||||||
<header>
|
<header>
|
||||||
<div class="logo"></div>
|
<div class="logo"></div>
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<?= raw($page) ?>
|
<?= raw($page) ?>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
@ -1,38 +1,14 @@
|
|||||||
<section>
|
|
||||||
<p class="exception-message">
|
|
||||||
<?= e($message) ?>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<?php foreach ($trace as $i => $frame) : ?>
|
<?= raw($error) ?>
|
||||||
#<?= $i ?> <?= e(frame_to_call_point($frame)) ?>
|
|
||||||
<br>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
|
|
||||||
<br>
|
<a href="<?= raw($searchUrl) ?>" title="Opens GitHub to search for similar issues">
|
||||||
|
|
||||||
<p>
|
|
||||||
Query string: <?= e(urldecode($_SERVER['QUERY_STRING']) ?? '') ?>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Version: <?= raw(Configuration::getVersion()) ?>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
OS: <?= raw(PHP_OS_FAMILY) ?>
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
PHP version: <?= raw(PHP_VERSION ?: 'Unknown') ?>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<a href="<?= raw($searchUrl) ?>" title="Opens GitHub to search for similar issues">
|
|
||||||
<button>Find similar bugs</button>
|
<button>Find similar bugs</button>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<a href="<?= raw($issueUrl) ?>" title="After clicking this button you can review the issue before submitting it">
|
<a href="<?= raw($issueUrl) ?>" title="After clicking this button you can review the issue before submitting it">
|
||||||
<button>Create GitHub Issue</button>
|
<button>Create GitHub Issue</button>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
<p class="maintainer">
|
<p class="maintainer">
|
||||||
<?= e($maintainer) ?>
|
<?= e($maintainer) ?>
|
||||||
</p>
|
</p>
|
||||||
</section>
|
|
||||||
|
|
@ -1,14 +1,36 @@
|
|||||||
<div style="width: 60%; margin: 30px auto">
|
<div class="error">
|
||||||
|
|
||||||
<h1>Something went wrong</h1>
|
<h1>Application Error</h1>
|
||||||
|
|
||||||
<p>
|
<p>The application could not run because of the following error:</p>
|
||||||
<?= e($message) ?>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<h2>Stacktrace</h2>
|
<h2>Details</h2>
|
||||||
|
|
||||||
<?php foreach ($trace as $i => $frame) : ?>
|
<div style="margin-bottom: 15px">
|
||||||
|
<div>
|
||||||
|
<strong>Type:</strong> <?= e(get_class($e)) ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<strong>Code:</strong> <?= e($e->getCode()) ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<strong>Message:</strong> <?= e($e->getMessage()) ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<strong>File:</strong> <?= e(trim_path_prefix($e->getFile())) ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<strong>Line:</strong> <?= e($e->getLine()) ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<h2>Trace</h2>
|
||||||
|
|
||||||
|
<?php foreach (trace_from_exception($e) as $i => $frame) : ?>
|
||||||
<code>
|
<code>
|
||||||
#<?= $i ?> <?= e(frame_to_call_point($frame)) ?>
|
#<?= $i ?> <?= e(frame_to_call_point($frame)) ?>
|
||||||
</code>
|
</code>
|
||||||
@ -19,17 +41,24 @@
|
|||||||
|
|
||||||
<h2>Context</h2>
|
<h2>Context</h2>
|
||||||
|
|
||||||
<p>
|
<div>
|
||||||
Query string: <?= e(urldecode($_SERVER['QUERY_STRING'] ?? '')) ?>
|
<strong>Query:</strong> <?= e(urldecode($_SERVER['QUERY_STRING'] ?? '')) ?>
|
||||||
</p>
|
</div>
|
||||||
<p>
|
|
||||||
Version: <?= raw(Configuration::getVersion()) ?>
|
<div>
|
||||||
</p>
|
<strong>Version:</strong> <?= raw(Configuration::getVersion()) ?>
|
||||||
<p>
|
</div>
|
||||||
OS: <?= raw(PHP_OS_FAMILY) ?>
|
|
||||||
</p>
|
<div>
|
||||||
<p>
|
<strong>OS:</strong> <?= raw(PHP_OS_FAMILY) ?>
|
||||||
PHP version: <?= raw(PHP_VERSION ?: 'Unknown') ?>
|
</div>
|
||||||
</p>
|
|
||||||
|
<div>
|
||||||
|
<strong>PHP:</strong> <?= raw(PHP_VERSION ?: 'Unknown') ?>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<br>
|
||||||
|
|
||||||
|
<a href="/">Go back</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -1,10 +1,11 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html lang="en">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="<?= $charset ?>">
|
<meta charset="<?= $charset ?>">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
|
<meta name="viewport" content="width=device-width, initial-scale=1.0"/ >
|
||||||
|
<meta name="description" content="RSS-Bridge" />
|
||||||
<title><?= e($title) ?></title>
|
<title><?= e($title) ?></title>
|
||||||
<link href="static/HtmlFormat.css" rel="stylesheet">
|
<link href="static/style.css" rel="stylesheet">
|
||||||
<link rel="icon" type="image/png" href="static/favicon.png">
|
<link rel="icon" type="image/png" href="static/favicon.png">
|
||||||
|
|
||||||
<?php foreach ($linkTags as $link): ?>
|
<?php foreach ($linkTags as $link): ?>
|
||||||
@ -18,11 +19,12 @@
|
|||||||
|
|
||||||
<meta name="robots" content="noindex, follow">
|
<meta name="robots" content="noindex, follow">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
<div class="container">
|
||||||
<h1 class="pagetitle">
|
<h1 class="pagetitle">
|
||||||
<a href="<?= e($uri) ?>" target="_blank">
|
<a href="<?= e($uri) ?>" target="_blank"><?= e($title) ?></a>
|
||||||
<?= e($title) ?>
|
|
||||||
</a>
|
|
||||||
</h1>
|
</h1>
|
||||||
|
|
||||||
<div class="buttons">
|
<div class="buttons">
|
||||||
@ -35,7 +37,6 @@
|
|||||||
<button class="rss-feed"><?= $button['value'] ?></button>
|
<button class="rss-feed"><?= $button['value'] ?></button>
|
||||||
</a>
|
</a>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php foreach ($items as $item): ?>
|
<?php foreach ($items as $item): ?>
|
||||||
@ -86,5 +87,6 @@
|
|||||||
</section>
|
</section>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -40,4 +40,11 @@ final class UtilsTest extends TestCase
|
|||||||
$this->assertIsNumeric($sut->getTime());
|
$this->assertIsNumeric($sut->getTime());
|
||||||
$sut->purgeCache(-1);
|
$sut->purgeCache(-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function testTrimFilePath()
|
||||||
|
{
|
||||||
|
$this->assertSame('', trim_path_prefix(dirname(__DIR__)));
|
||||||
|
$this->assertSame('tests', trim_path_prefix(__DIR__));
|
||||||
|
$this->assertSame('tests/UtilsTest.php', trim_path_prefix(__DIR__ . '/UtilsTest.php'));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user