diff --git a/application/Espo/Core/Utils/ClientManager.php b/application/Espo/Core/Utils/ClientManager.php index 0f5aac853b..1015e50b0e 100644 --- a/application/Espo/Core/Utils/ClientManager.php +++ b/application/Espo/Core/Utils/ClientManager.php @@ -108,6 +108,8 @@ class ClientManager $loaderCacheTimestamp = $cacheTimestamp; } + $linkList = $this->getMetadata()->get(['app', 'client', 'linkList'], []); + $scriptsHtml = ''; foreach ($jsFileList as $jsFile) { $src = $this->basePath . $jsFile . '?r=' . $cacheTimestamp; @@ -121,6 +123,15 @@ class ClientManager $additionalStyleSheetsHtml .= "\n "; } + $linksHtml = ''; + foreach ($linkList as $item) { + $href = $this->basePath . $item['href'] . '?r=' . $cacheTimestamp; + $as = $item['as'] ?? ''; + $rel = $item['rel'] ?? ''; + $type = $item['type'] ?? ''; + $linksHtml .= "\n "; + } + $data = [ 'applicationId' => 'espocrm-application-id', 'apiUrl' => 'api/v1', @@ -134,6 +145,7 @@ class ClientManager 'appClientClassName' => 'app', 'scriptsHtml' => $scriptsHtml, 'additionalStyleSheetsHtml' => $additionalStyleSheetsHtml, + 'linksHtml' => $linksHtml, ]; $html = file_get_contents($htmlFilePath); diff --git a/application/Espo/Resources/metadata/app/client.json b/application/Espo/Resources/metadata/app/client.json index e121a0db69..18b2cb8789 100644 --- a/application/Espo/Resources/metadata/app/client.json +++ b/application/Espo/Resources/metadata/app/client.json @@ -24,5 +24,19 @@ "client/src/loader.js", "client/src/utils.js", "client/src/exceptions.js" + ], + "linkList": [ + { + "href": "client/fonts/open-sans/OpenSans-Bold.ttf", + "as": "font", + "type": "font/ttf", + "rel": "preload" + }, + { + "href": "client/fonts/open-sans/OpenSans-Regular.ttf", + "as": "font", + "type": "font/ttf", + "rel": "preload" + } ] } diff --git a/html/main.html b/html/main.html index 57ae80d9c2..be2819a6ae 100644 --- a/html/main.html +++ b/html/main.html @@ -2,7 +2,7 @@