2022-11-21 23:57:29 +00:00
|
|
|
<?php require 'base.php' ?>
|
2022-12-15 15:20:15 +00:00
|
|
|
<!DOCTYPE html>
|
2022-11-21 23:35:48 +00:00
|
|
|
<html>
|
|
|
|
<head>
|
2022-12-15 13:56:43 +00:00
|
|
|
<title>Soselo - Panel</title>
|
2022-11-21 23:35:48 +00:00
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
2022-12-17 00:58:47 +00:00
|
|
|
<link rel="icon" type="image/x-icon" href="img/favicon.png">
|
2022-11-21 23:35:48 +00:00
|
|
|
<link rel="stylesheet" href="fonts/forkawesome/css/fork-awesome.min.css">
|
|
|
|
<script type="application/javascript" src="js/dayjs.min.js"></script>
|
|
|
|
<script type="application/javascript" src="js/relativeTime.js"></script>
|
|
|
|
<script type="application/javascript" src="js/updateLocale.js"></script>
|
|
|
|
</head>
|
|
|
|
<body>
|
2022-11-23 00:18:34 +00:00
|
|
|
<script>window.vars = [];</script>
|
2022-11-24 23:21:52 +00:00
|
|
|
<script>
|
|
|
|
window.consts = {
|
|
|
|
'instance_config': {
|
|
|
|
'mastodon': {
|
2022-11-25 00:44:03 +00:00
|
|
|
'musthave': ['instance_url','psql_host','psql_port','psql_db',
|
|
|
|
'psql_username','psql_password','redis_host','redis_port','api_authkey'],
|
2022-11-24 23:21:52 +00:00
|
|
|
},
|
|
|
|
}
|
|
|
|
};
|
2022-11-28 00:45:53 +00:00
|
|
|
window.view = {};
|
2022-11-28 02:03:20 +00:00
|
|
|
window.cache = {};
|
2022-12-17 18:22:57 +00:00
|
|
|
window.http_cachebuster = {
|
|
|
|
'api/v1/http/[^\/]+/accounts/[^\/]+': 'users',
|
|
|
|
'api/v1/config/trusted_users/add': 'users',
|
|
|
|
'api/v1/cache/put?keys=temp_hidden': 'users',
|
|
|
|
};
|
2022-11-24 23:21:52 +00:00
|
|
|
</script>
|
|
|
|
<script>
|
|
|
|
function apcontrol_title(str) {
|
2022-12-15 13:56:43 +00:00
|
|
|
document.title = `Soselo - ${str}`;
|
2022-11-24 23:21:52 +00:00
|
|
|
}
|
|
|
|
</script>
|
2022-11-21 23:35:48 +00:00
|
|
|
|
|
|
|
<?php require 'css/base.php' ?>
|
|
|
|
|
|
|
|
<main>
|
2022-11-24 00:54:43 +00:00
|
|
|
<?php foreach (scandir('./views') as $t): ?>
|
2022-11-23 00:18:34 +00:00
|
|
|
<?php if (!in_array($t,['.','..']) && substr($t, -4) === '.php'): ?>
|
|
|
|
<div id="window-<?php echo substr($t, 0, -4) ?>"
|
|
|
|
class="window hidden">
|
2022-11-24 00:54:43 +00:00
|
|
|
<?php require './views/'.$t ?>
|
2022-11-23 00:18:34 +00:00
|
|
|
</div>
|
|
|
|
<?php endif ?>
|
|
|
|
<?php endforeach ?>
|
2022-11-21 23:35:48 +00:00
|
|
|
</main>
|
2022-12-06 15:18:34 +00:00
|
|
|
<div id="toast-container"></div>
|
2022-12-17 12:03:03 +00:00
|
|
|
<div id="overlay-loader"></div>
|
|
|
|
<div id="overlay-loader-item">
|
|
|
|
<div class="overlay" onclick="if ({cancelable}) http.abort()">
|
|
|
|
<div class="content">{content}</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-11-21 23:35:48 +00:00
|
|
|
|
|
|
|
<?php require 'js/base.php' ?>
|
|
|
|
|
|
|
|
<script>
|
2022-11-23 00:18:34 +00:00
|
|
|
|
2022-12-05 15:31:15 +00:00
|
|
|
async function hashProcessor(initial) {
|
|
|
|
console.log(`EVENT hash-changed (no_fire_change: ${window.hash_argument_nofirechange})`);
|
|
|
|
if (window.hash_argument_nofirechange === true) {
|
|
|
|
delete window.hash_argument_nofirechange;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2022-11-21 23:35:48 +00:00
|
|
|
var args = window.location.hash.substring(1).trim().split('/');
|
|
|
|
if (args.length > 0 && args[0].trim() === '')
|
|
|
|
args = [];
|
|
|
|
|
|
|
|
if (args.length === 0) {
|
2022-11-23 00:18:34 +00:00
|
|
|
window.location.hash = '#home';
|
2022-11-21 23:35:48 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
initial = initial || false;
|
|
|
|
const processArgs = function() {
|
2022-11-23 00:18:34 +00:00
|
|
|
if (document.getElementById('window-'+args[0]) !== null) {
|
|
|
|
if (window['load__'+args[0]] !== undefined) {
|
|
|
|
E.class.removeAll('.window', 'hidden');
|
|
|
|
E.class.addAll('.window', 'hidden');
|
|
|
|
document.getElementById('window-'+args[0]).classList.remove('hidden');
|
2022-12-06 15:18:34 +00:00
|
|
|
document.body.className = args[0];
|
2022-11-23 00:18:34 +00:00
|
|
|
window['load__'+args[0]](args);
|
|
|
|
}
|
2022-11-24 23:21:52 +00:00
|
|
|
if (window['title__'+args[0]] !== undefined)
|
|
|
|
window['title__'+args[0]]();
|
|
|
|
else apcontrol_title('Panel');
|
2022-11-21 23:35:48 +00:00
|
|
|
}
|
|
|
|
};
|
|
|
|
processArgs();
|
|
|
|
}
|
|
|
|
|
|
|
|
window.onhashchange = function(e) { hashProcessor() }
|
|
|
|
window.onload = function(e) {
|
|
|
|
dayjs.extend(window.dayjs_plugin_relativeTime);
|
|
|
|
dayjs.extend(window.dayjs_plugin_updateLocale);
|
|
|
|
dayjs.updateLocale('en', {
|
|
|
|
relativeTime: {
|
|
|
|
future: "in %s",
|
|
|
|
past: "%s ago",
|
|
|
|
s: '%d s',
|
|
|
|
m: "1 m",
|
|
|
|
mm: "%d m",
|
|
|
|
h: "1 h",
|
|
|
|
hh: "%d h",
|
|
|
|
d: "1 d",
|
|
|
|
dd: "%d d",
|
|
|
|
M: "1 M",
|
|
|
|
MM: "%s M",
|
|
|
|
y: "1 Y",
|
|
|
|
yy: "%s Y"
|
|
|
|
}
|
|
|
|
});
|
2022-11-23 00:18:34 +00:00
|
|
|
hashProcessor();
|
2022-11-21 23:35:48 +00:00
|
|
|
}
|
|
|
|
</script>
|
|
|
|
</body>
|
|
|
|
</html>
|