fix missing port information in URL in console
This commit is contained in:
parent
86574c6a2a
commit
92d35cff18
|
@ -14,10 +14,15 @@ App::init(function ($utopia, $request, $response, $layout) {
|
|||
$layout->setPath(__DIR__ . '/../../views/layouts/empty.phtml');
|
||||
}
|
||||
|
||||
$port = $request->getPort();
|
||||
$protocol = $request->getProtocol();
|
||||
$domain = $request->getHostname();
|
||||
|
||||
$layout
|
||||
->setParam('title', APP_NAME)
|
||||
->setParam('protocol', $request->getProtocol())
|
||||
->setParam('domain', $request->getHostname())
|
||||
->setParam('protocol', $protocol)
|
||||
->setParam('domain', $domain)
|
||||
->setParam('endpoint', $protocol . '://' . $domain . ($port != 80 && $port != 443 ? ':' . $port : ''))
|
||||
->setParam('home', App::getEnv('_APP_HOME'))
|
||||
->setParam('setup', App::getEnv('_APP_SETUP'))
|
||||
->setParam('class', 'unknown')
|
||||
|
|
|
@ -114,7 +114,7 @@ $maxCells = 10;
|
|||
<?php if(!$array): ?>
|
||||
<?php switch($type):
|
||||
case 'fileId': ?>
|
||||
<img data-ls-if="{{node.<?php echo $this->escape($key); ?>}} != ''" src="" data-ls-attrs="src=//{{env.DOMAIN}}/v1/storage/files/{{node.<?php echo $this->escape($key); ?>}}/preview?width=65&height=65&project={{router.params.project}}&mode=admin" class="avatar" width="30" height="30" loading="lazy" />
|
||||
<img data-ls-if="{{node.<?php echo $this->escape($key); ?>}} != ''" src="" data-ls-attrs="src={{env.ENDPOINT}}/v1/storage/files/{{node.<?php echo $this->escape($key); ?>}}/preview?width=65&height=65&project={{router.params.project}}&mode=admin" class="avatar" width="30" height="30" loading="lazy" />
|
||||
<?php break; ?>
|
||||
<?php case 'document': ?>
|
||||
{...}
|
||||
|
|
|
@ -72,7 +72,7 @@ $rules = $collection->getAttribute('rules', []);
|
|||
<?php if(!$array): ?>
|
||||
<?php switch($type):
|
||||
case 'fileId': ?>
|
||||
<img data-ls-if="{{node.<?php echo $this->escape($key); ?>}} != ''" src="" data-ls-attrs="src=//{{env.DOMAIN}}/v1/storage/files/{{node.<?php echo $this->escape($key); ?>}}/preview?width=65&height=65&project={{router.params.project}}&mode=admin" class="avatar" width="30" height="30" loading="lazy" />
|
||||
<img data-ls-if="{{node.<?php echo $this->escape($key); ?>}} != ''" src="" data-ls-attrs="src={{env.ENDPOINT}}/v1/storage/files/{{node.<?php echo $this->escape($key); ?>}}/preview?width=65&height=65&project={{router.params.project}}&mode=admin" class="avatar" width="30" height="30" loading="lazy" />
|
||||
<?php break; ?>
|
||||
<?php case 'document': ?>
|
||||
{...}
|
||||
|
|
|
@ -54,7 +54,7 @@
|
|||
<input type="radio" name="selected" data-ls-attrs="value={{file.$id}}" data-ls-bind="{{search.selected}}" />
|
||||
</td>
|
||||
<td data-title="x" class="">
|
||||
<img src="" data-ls-attrs="src=//{{env.DOMAIN}}/v1/storage/files/{{file.$id}}/preview?width=65&height=65&project={{router.params.project}}&mode=admin" class="pull-start avatar" width="30" height="30" loading="lazy" />
|
||||
<img src="" data-ls-attrs="src={{env.ENDPOINT}}/v1/storage/files/{{file.$id}}/preview?width=65&height=65&project={{router.params.project}}&mode=admin" class="pull-start avatar" width="30" height="30" loading="lazy" />
|
||||
</td>
|
||||
<td data-title="Name: " class="text-one-liner">
|
||||
<span data-ls-bind="{{file.name}}" data-ls-attrs="title={{file.name}}" class="text-fade text-size-small"></span>
|
||||
|
|
|
@ -135,7 +135,7 @@ $customDomainsTarget = $this->getParam('customDomainsTarget', false);
|
|||
|
||||
<label for="name">API Endpoint</label>
|
||||
<div class="input-copy">
|
||||
<input data-forms-copy type="text" disabled data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}/v1" />
|
||||
<input data-forms-copy type="text" disabled data-ls-bind="{{env.ENDPOINT}}/v1" />
|
||||
</div>
|
||||
|
||||
<ul class="margin-bottom-large text-fade text-size-small">
|
||||
|
@ -453,7 +453,7 @@ $customDomainsTarget = $this->getParam('customDomainsTarget', false);
|
|||
data-failure-param-alert-classname="error">
|
||||
|
||||
<input name="teamId" type="hidden" data-ls-bind="{{member.teamId}}">
|
||||
<input name="url" type="hidden" data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}/auth/join?project={{router.params.project}}" />
|
||||
<input name="url" type="hidden" data-ls-bind="{{env.ENDPOINT}}/auth/join?project={{router.params.project}}" />
|
||||
<input name="email" type="hidden" data-ls-bind="{{member.email}}">
|
||||
<input name="name" type="hidden" data-ls-bind="{{member.name}}">
|
||||
<input name="roles" type="hidden" data-ls-bind="{{member.roles}}" data-cast-to="json">
|
||||
|
@ -493,7 +493,7 @@ $customDomainsTarget = $this->getParam('customDomainsTarget', false);
|
|||
data-failure-param-alert-classname="error">
|
||||
|
||||
<input name="teamId" id="team-teamId" type="hidden" data-ls-bind="{{console-project.teamId}}">
|
||||
<input name="url" type="hidden" data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}/auth/join?project={{router.params.project}}" />
|
||||
<input name="url" type="hidden" data-ls-bind="{{env.ENDPOINT}}/auth/join?project={{router.params.project}}" />
|
||||
|
||||
<label for="email">Email</label>
|
||||
<input name="email" id="email" type="email" autocomplete="email" required>
|
||||
|
|
|
@ -113,7 +113,7 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0);
|
|||
<tbody data-ls-loop="project-files.files" data-ls-as="file">
|
||||
<tr>
|
||||
<td class="hide">
|
||||
<img src="" data-ls-attrs="src=//{{env.DOMAIN}}/v1/storage/files/{{file.$id}}/preview?width=65&height=65&project={{router.params.project}}&mode=admin" class="pull-start avatar" width="30" height="30" loading="lazy" />
|
||||
<img src="" data-ls-attrs="src={{env.ENDPOINT}}/v1/storage/files/{{file.$id}}/preview?width=65&height=65&project={{router.params.project}}&mode=admin" class="pull-start avatar" width="30" height="30" loading="lazy" />
|
||||
</td>
|
||||
<td data-title="Name: " class="text-one-liner" data-ls-attrs="title={{file.name}}" >
|
||||
<div data-ui-modal class="box modal sticky-footer width-large close" data-button-text="{{file.name}}" data-button-class="link" data-button-element="span">
|
||||
|
@ -180,15 +180,15 @@ $fileLimitHuman = $this->getParam('fileLimitHuman', 0);
|
|||
<div class="margin-bottom-small">File Preview</div>
|
||||
|
||||
<div class="margin-bottom-small">
|
||||
<img src="" class="file-preview" data-ls-attrs="src=//{{env.DOMAIN}}/v1/storage/files/{{file.$id}}/preview?width=350&height=250&project={{router.params.project}}&mode=admin" loading="lazy" width="225" height="160" />
|
||||
<img src="" class="file-preview" data-ls-attrs="src={{env.ENDPOINT}}/v1/storage/files/{{file.$id}}/preview?width=350&height=250&project={{router.params.project}}&mode=admin" loading="lazy" width="225" height="160" />
|
||||
</div>
|
||||
|
||||
<div class="margin-bottom-tiny">
|
||||
<a href="" data-ls-attrs="href=//{{env.DOMAIN}}/v1/storage/files/{{file.$id}}/view?project={{router.params.project}}&mode=admin" target="_blank" rel="noopener"><i class="icon-angle-circled-right margin-start-negative-tiny margin-end-tiny"></i> New Window <i class="icon-link-ext"></i></a>
|
||||
<a href="" data-ls-attrs="href={{env.ENDPOINT}}/v1/storage/files/{{file.$id}}/view?project={{router.params.project}}&mode=admin" target="_blank" rel="noopener"><i class="icon-angle-circled-right margin-start-negative-tiny margin-end-tiny"></i> New Window <i class="icon-link-ext"></i></a>
|
||||
</div>
|
||||
|
||||
<div class="margin-bottom">
|
||||
<a href="" data-ls-attrs="href=//{{env.DOMAIN}}/v1/storage/files/{{file.$id}}/download?project={{router.params.project}}&mode=admin" target="_blank" rel="noopener"><i class="icon-angle-circled-right margin-start-negative-tiny margin-end-tiny"></i> Download <i class="icon-link-ext"></i></a>
|
||||
<a href="" data-ls-attrs="href={{env.ENDPOINT}}/v1/storage/files/{{file.$id}}/download?project={{router.params.project}}&mode=admin" target="_blank" rel="noopener"><i class="icon-angle-circled-right margin-start-negative-tiny margin-end-tiny"></i> Download <i class="icon-link-ext"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -361,7 +361,7 @@ $providers = $this->getParam('providers', []);
|
|||
<p>To complete set up, add this OAuth2 redirect URI to your <?php echo $this->escape(ucfirst($provider)); ?> app configuration.</p>
|
||||
|
||||
<div class="input-copy">
|
||||
<input data-forms-copy type="text" disabled data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}/v1/account/sessions/oauth2/callback/<?php echo $this->escape($provider); ?>/{{router.params.project}}" class="margin-bottom-no" />
|
||||
<input data-forms-copy type="text" disabled data-ls-bind="{{env.ENDPOINT}}/v1/account/sessions/oauth2/callback/<?php echo $this->escape($provider); ?>/{{router.params.project}}" class="margin-bottom-no" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -145,7 +145,7 @@
|
|||
data-failure-param-alert-classname="error">
|
||||
|
||||
<input name="teamId" id="team-teamId" type="hidden" data-ls-bind="{{team.$id}}">
|
||||
<input name="url" type="hidden" data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}" />
|
||||
<input name="url" type="hidden" data-ls-bind="{{env.ENDPOINT}}" />
|
||||
|
||||
<label for="email">Email</label>
|
||||
<input name="email" id="email" type="email" autocomplete="email" required>
|
||||
|
|
|
@ -23,7 +23,7 @@
|
|||
<label>Email</label>
|
||||
<input name="email" type="email" class="full-width" autocomplete="email" placeholder="me@example.com" required>
|
||||
|
||||
<input name="url" type="hidden" data-ls-bind="{{env.PROTOCOL}}://{{env.DOMAIN}}/auth/recovery/reset" />
|
||||
<input name="url" type="hidden" data-ls-bind="{{env.ENDPOINT}}/auth/recovery/reset" />
|
||||
|
||||
<button type="submit" class="btn btn-primary"><i class="fa fa-sign-in"></i> Recover</button>
|
||||
</form>
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
$protocol = $this->getParam('protocol', '');
|
||||
$domain = $this->getParam('domain', '');
|
||||
$endpoint = $this->getParam('endpoint', '');
|
||||
$platforms = $this->getParam('platforms', []);
|
||||
$version = $this->getParam('version', '0.0.0');
|
||||
$isDev = $this->getParam('isDev', false);
|
||||
|
@ -56,7 +57,7 @@ if(!empty($platforms)) {
|
|||
<?php if (!empty($canonical)): ?>
|
||||
<meta property="og:url" content="<?php echo $canonical; ?>" />
|
||||
<?php endif; ?>
|
||||
<meta property="og:image" content="<?php echo $protocol; ?>://<?php echo $domain; ?>/images/logo.png?v=<?php echo APP_CACHE_BUSTER; ?>" />
|
||||
<meta property="og:image" content="<?php echo $protocol; ?>://<?php echo $domain; ?><?php echo $port != 80 ?':'.$port : '' ?>/images/logo.png?v=<?php echo APP_CACHE_BUSTER; ?>" />
|
||||
<script>
|
||||
|
||||
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
||||
|
@ -71,6 +72,7 @@ if(!empty($platforms)) {
|
|||
VERSION: '<?php echo $version; ?>',
|
||||
CACHEBUSTER: '<?php echo $version; ?>/<?php echo APP_CACHE_BUSTER; ?>',
|
||||
PROTOCOL: '<?php echo $protocol; ?>',
|
||||
ENDPOINT: '<?php echo $endpoint; ?>',
|
||||
DOMAIN: '<?php echo $domain; ?>',
|
||||
HOME: '<?php echo $this->escape($this->getParam('home')); ?>',
|
||||
SETUP: '<?php echo $this->escape($this->getParam('setup')); ?>',
|
||||
|
|
Loading…
Reference in a new issue