43 lines
2.0 KiB
PHP
43 lines
2.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
$manifest = [];
|
|
$manifestRaw = is_file(__DIR__ . '/module.json') ? file_get_contents(__DIR__ . '/module.json') : false;
|
|
if ($manifestRaw !== false) {
|
|
$decoded = json_decode($manifestRaw, true);
|
|
$manifest = is_array($decoded) ? $decoded : [];
|
|
}
|
|
|
|
return [
|
|
'app_id' => 'pihole',
|
|
'title' => (string) ($manifest['title'] ?? 'Pi-hole'),
|
|
'icon' => 'PH',
|
|
'entry_route' => '/apps/pihole/index.php',
|
|
'window_mode' => 'window',
|
|
'content_mode' => 'native-module',
|
|
'default_width' => 1220,
|
|
'default_height' => 860,
|
|
'supports_widget' => false,
|
|
'supports_tray' => false,
|
|
'module_name' => 'network',
|
|
'summary' => (string) ($manifest['description'] ?? 'Pi-hole Monitoring, Listen und Steuerung fuer mehrere Instanzen.'),
|
|
'native_module' => [
|
|
'initializer' => 'initPiholeApp',
|
|
'options' => [
|
|
'entryRoute' => '/apps/pihole/index.php',
|
|
'defaultView' => 'dashboard',
|
|
],
|
|
'assets' => [
|
|
'styles' => [
|
|
['href' => '/module-assets/index.php?module=pihole&path=assets/pihole.css&v=' . rawurlencode((string) (is_file(__DIR__ . '/assets/pihole.css') ? filemtime(__DIR__ . '/assets/pihole.css') : '0'))],
|
|
],
|
|
'scripts' => [
|
|
['src' => '/module-assets/index.php?module=pihole&path=assets/pihole.js&v=' . rawurlencode((string) (is_file(__DIR__ . '/assets/pihole.js') ? filemtime(__DIR__ . '/assets/pihole.js') : '0'))],
|
|
['src' => '/module-assets/index.php?module=pihole&path=assets/pihole_instances.js&v=' . rawurlencode((string) (is_file(__DIR__ . '/assets/pihole_instances.js') ? filemtime(__DIR__ . '/assets/pihole_instances.js') : '0'))],
|
|
['src' => '/module-assets/index.php?module=pihole&path=assets/pihole-native.js&v=' . rawurlencode((string) (is_file(__DIR__ . '/assets/pihole-native.js') ? filemtime(__DIR__ . '/assets/pihole-native.js') : '0'))],
|
|
],
|
|
],
|
|
],
|
|
];
|