asdasd
This commit is contained in:
@@ -21,7 +21,7 @@
|
|||||||
define('APP_OIDC_REDIRECT_URI', 'https://nexus.int.kusche.berlin/auth/callback');
|
define('APP_OIDC_REDIRECT_URI', 'https://nexus.int.kusche.berlin/auth/callback');
|
||||||
define('APP_OIDC_POST_LOGOUT_REDIRECT_URI', 'https://nexus.int.kusche.berlin/');
|
define('APP_OIDC_POST_LOGOUT_REDIRECT_URI', 'https://nexus.int.kusche.berlin/');
|
||||||
define('APP_OIDC_GROUP_CLAIM', 'groups');
|
define('APP_OIDC_GROUP_CLAIM', 'groups');
|
||||||
define('APP_OIDC_ADMIN_GROUP', 'admin');
|
define('APP_OIDC_ADMIN_GROUP', 'appadmin');
|
||||||
define('APP_OIDC_USER_GROUP', 'family');
|
define('APP_OIDC_USER_GROUP', 'internalfamily');
|
||||||
define('APP_DEBUG_TOOL', false);
|
define('APP_DEBUG_TOOL', false);
|
||||||
define('APP_AUTH_DEBUG', false);
|
define('APP_AUTH_DEBUG', false);
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
define('APP_OIDC_REDIRECT_URI', 'https://staging.nexus.int.kusche.berlin/auth/callback');
|
define('APP_OIDC_REDIRECT_URI', 'https://staging.nexus.int.kusche.berlin/auth/callback');
|
||||||
define('APP_OIDC_POST_LOGOUT_REDIRECT_URI', 'https://staging.nexus.int.kusche.berlin/');
|
define('APP_OIDC_POST_LOGOUT_REDIRECT_URI', 'https://staging.nexus.int.kusche.berlin/');
|
||||||
define('APP_OIDC_GROUP_CLAIM', 'groups');
|
define('APP_OIDC_GROUP_CLAIM', 'groups');
|
||||||
define('APP_OIDC_ADMIN_GROUP', 'admin');
|
define('APP_OIDC_ADMIN_GROUP', 'appadmin');
|
||||||
define('APP_OIDC_USER_GROUP', 'family');
|
define('APP_OIDC_USER_GROUP', 'internalfamily');
|
||||||
define('APP_DEBUG_TOOL', true);
|
define('APP_DEBUG_TOOL', true);
|
||||||
define('APP_AUTH_DEBUG', true);
|
define('APP_AUTH_DEBUG', true);
|
||||||
|
|||||||
@@ -101,6 +101,6 @@ $sidebarItems = $moduleSidebar['items'] ?? [];
|
|||||||
<button class="sidebar-fab" data-sidebar-toggle aria-label="Menü einblenden">»»</button>
|
<button class="sidebar-fab" data-sidebar-toggle aria-label="Menü einblenden">»»</button>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|
||||||
<?php if (defined('APP_DEBUG_TOOL') && APP_DEBUG_TOOL): ?>
|
<?php if (defined('APP_DEBUG_TOOL') && APP_DEBUG_TOOL && auth_is_admin()): ?>
|
||||||
<button class="debug-fab" data-debug-open title="Debug" type="button">🐞</button>
|
<button class="debug-fab" data-debug-open title="Debug" type="button">🐞</button>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
|
|||||||
@@ -41,12 +41,20 @@
|
|||||||
modal.classList.add('is-open');
|
modal.classList.add('is-open');
|
||||||
modal.setAttribute('aria-hidden', 'false');
|
modal.setAttribute('aria-hidden', 'false');
|
||||||
loadList();
|
loadList();
|
||||||
|
startRefresh();
|
||||||
};
|
};
|
||||||
const close = () => {
|
const close = () => {
|
||||||
modal.classList.remove('is-open');
|
modal.classList.remove('is-open');
|
||||||
modal.setAttribute('aria-hidden', 'true');
|
modal.setAttribute('aria-hidden', 'true');
|
||||||
|
if (refreshTimer) {
|
||||||
|
clearInterval(refreshTimer);
|
||||||
|
refreshTimer = null;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let activeFile = null;
|
||||||
|
let refreshTimer = null;
|
||||||
|
|
||||||
const loadList = async () => {
|
const loadList = async () => {
|
||||||
try {
|
try {
|
||||||
const res = await fetch('/debug?list=1', { cache: 'no-store' });
|
const res = await fetch('/debug?list=1', { cache: 'no-store' });
|
||||||
@@ -71,13 +79,37 @@
|
|||||||
};
|
};
|
||||||
|
|
||||||
const loadFile = async (name) => {
|
const loadFile = async (name) => {
|
||||||
|
activeFile = name;
|
||||||
try {
|
try {
|
||||||
const res = await fetch(`/debug?raw=1&file=${encodeURIComponent(name)}`, { cache: 'no-store' });
|
const res = await fetch(`/debug?raw=1&file=${encodeURIComponent(name)}&tail=200`, { cache: 'no-store' });
|
||||||
const text = await res.text();
|
const text = await res.text();
|
||||||
contentEl.textContent = text;
|
contentEl.textContent = formatLog(text);
|
||||||
} catch (e) {}
|
} catch (e) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const formatLog = (text) => {
|
||||||
|
const lines = text.split(/\\r?\\n/).filter(Boolean);
|
||||||
|
const pretty = lines.map((line) => {
|
||||||
|
try {
|
||||||
|
const obj = JSON.parse(line);
|
||||||
|
return JSON.stringify(obj, null, 2);
|
||||||
|
} catch (e) {
|
||||||
|
return line;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return pretty.join('\\n\\n');
|
||||||
|
};
|
||||||
|
|
||||||
|
const startRefresh = () => {
|
||||||
|
if (refreshTimer) clearInterval(refreshTimer);
|
||||||
|
refreshTimer = setInterval(() => {
|
||||||
|
if (activeFile) loadFile(activeFile);
|
||||||
|
}, 3000);
|
||||||
|
};
|
||||||
|
|
||||||
openBtn.addEventListener('click', open);
|
openBtn.addEventListener('click', open);
|
||||||
closeEls.forEach((el) => el.addEventListener('click', close));
|
closeEls.forEach((el) => el.addEventListener('click', close));
|
||||||
|
if (modal.classList.contains('is-open')) {
|
||||||
|
startRefresh();
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
require_auth();
|
require_admin();
|
||||||
|
|
||||||
if (!defined('APP_DEBUG_TOOL') || !APP_DEBUG_TOOL) {
|
if (!defined('APP_DEBUG_TOOL') || !APP_DEBUG_TOOL) {
|
||||||
echo '<div class="card">Debug-Tool ist deaktiviert.</div>';
|
echo '<div class="card">Debug-Tool ist deaktiviert.</div>';
|
||||||
@@ -36,6 +36,11 @@ if (isset($_GET['list']) && $_GET['list'] === '1') {
|
|||||||
|
|
||||||
if (isset($_GET['raw']) && $_GET['raw'] === '1') {
|
if (isset($_GET['raw']) && $_GET['raw'] === '1') {
|
||||||
header('Content-Type: text/plain; charset=utf-8');
|
header('Content-Type: text/plain; charset=utf-8');
|
||||||
|
$tail = isset($_GET['tail']) ? (int)$_GET['tail'] : 0;
|
||||||
|
if ($tail > 0 && $content !== null) {
|
||||||
|
$lines = preg_split('/\\R/', $content) ?: [];
|
||||||
|
$content = implode(PHP_EOL, array_slice($lines, -$tail));
|
||||||
|
}
|
||||||
echo $content ?? '';
|
echo $content ?? '';
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user