findManifestFiles('manifest.json'); foreach ($manifestFiles as $manifestPath) { $manifest = $this->getManifestContents($manifestPath); $subfolder = $this->getRelativePath($manifestPath); foreach ($manifest as $key => $value) { if (strpos($key, self::RICH_COMPONENTS_ENTRY) !== false && isset($value["file"])) { return ($subfolder ? $subfolder . '/' : '') . $value["file"]; } } } return ''; } private function getRichComponentsScript(): string { $jsFile = $this->getRichComponentsFile(); if (empty($jsFile)) { return ''; } return ''; } private function getUnraidUiScriptHtml(): string { $manifestFiles = $this->findManifestFiles('ui.manifest.json'); if (empty($manifestFiles)) { error_log("No ui.manifest.json found"); return ''; } $manifestPath = $manifestFiles[0]; // Use the first found manifest $manifest = $this->getManifestContents($manifestPath); $subfolder = $this->getRelativePath($manifestPath); if (!isset($manifest[self::UI_ENTRY]) || !isset($manifest[self::UI_STYLES_ENTRY])) { error_log("Required entries not found in ui.manifest.json"); return ''; } $jsFile = ($subfolder ? $subfolder . '/' : '') . $manifest[self::UI_ENTRY]['file']; $cssFile = ($subfolder ? $subfolder . '/' : '') . $manifest[self::UI_STYLES_ENTRY]['file']; return ''; } public function getScriptTagHtml(): string { try { return $this->getRichComponentsScript() . $this->getUnraidUiScriptHtml(); } catch (\Exception $e) { error_log("Error in WebComponentsExtractor::getScriptTagHtml: " . $e->getMessage()); return ""; } } }