mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-28 06:56:05 +00:00
client links
This commit is contained in:
@@ -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 <link rel=\"stylesheet\" href=\"{$src}\">";
|
||||
}
|
||||
|
||||
$linksHtml = '';
|
||||
foreach ($linkList as $item) {
|
||||
$href = $this->basePath . $item['href'] . '?r=' . $cacheTimestamp;
|
||||
$as = $item['as'] ?? '';
|
||||
$rel = $item['rel'] ?? '';
|
||||
$type = $item['type'] ?? '';
|
||||
$linksHtml .= "\n <link rel=\"{$rel}\" href=\"{$href}\" as=\"{$as}\" as=\"{$type}\">";
|
||||
}
|
||||
|
||||
$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);
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<html>
|
||||
<head>
|
||||
<title>{{applicationName}}</title>{{scriptsHtml}}
|
||||
<link href="{{basePath}}{{stylesheet}}?r={{cacheTimestamp}}" rel="stylesheet" id='main-stylesheet'>{{additionalStyleSheetsHtml}}
|
||||
<link href="{{basePath}}{{stylesheet}}?r={{cacheTimestamp}}" rel="stylesheet" id='main-stylesheet'>{{additionalStyleSheetsHtml}}{{linksHtml}}
|
||||
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
|
||||
<meta content="utf-8" http-equiv="encoding">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
|
||||
Reference in New Issue
Block a user