Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
ui-middleware
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Open Source Software
OX App Suite
Core
ui-middleware
Commits
787692b7
Commit
787692b7
authored
2 years ago
by
julian.baeume
Browse files
Options
Downloads
Patches
Plain Diff
inject app root variable into webmanifest template
this should fix paths for apps with app root different than /
parent
39269d46
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/plugins/webmanifest.js
+8
-6
8 additions, 6 deletions
src/plugins/webmanifest.js
with
8 additions
and
6 deletions
src/plugins/webmanifest.js
+
8
−
6
View file @
787692b7
...
@@ -2,13 +2,15 @@ import { get } from '../cache.js'
...
@@ -2,13 +2,15 @@ import { get } from '../cache.js'
import
Validator
from
'
../validator.js
'
import
Validator
from
'
../validator.js
'
import
{
getRedisKey
}
from
'
../util.js
'
import
{
getRedisKey
}
from
'
../util.js
'
const
appRoot
=
process
.
env
.
APP_ROOT
const
template
=
{
const
template
=
{
// custom values
// custom values
name
:
'
OX App Suite
'
,
name
:
'
OX App Suite
'
,
short_name
:
'
OX App Suite
'
,
short_name
:
'
OX App Suite
'
,
icons
:
[
icons
:
[
{
{
src
:
'
/
themes/default/logo_512.png
'
,
src
:
`
${
appRoot
}
themes/default/logo_512.png
`
,
type
:
'
image/png
'
,
type
:
'
image/png
'
,
sizes
:
'
512x512
'
,
sizes
:
'
512x512
'
,
purpose
:
'
any
'
purpose
:
'
any
'
...
@@ -17,15 +19,15 @@ const template = {
...
@@ -17,15 +19,15 @@ const template = {
// fixed values
// fixed values
// theme_color is taken from index.html and is changed by the theme
// theme_color is taken from index.html and is changed by the theme
theme_color
:
'
white
'
,
theme_color
:
'
white
'
,
start_url
:
'
/
#pwa=true
'
,
start_url
:
`
${
appRoot
}
#pwa=true
`
,
display
:
'
standalone
'
,
display
:
'
standalone
'
,
background_color
:
'
white
'
,
background_color
:
'
white
'
,
scope
:
'
/
'
,
scope
:
`
${
appRoot
}
`
,
id
:
'
/
#pwa=true
'
,
id
:
`
${
appRoot
}
#pwa=true
`
,
protocol_handlers
:
[
protocol_handlers
:
[
{
{
protocol
:
'
mailto
'
,
protocol
:
'
mailto
'
,
url
:
'
/
#app=io.ox/mail&mailto=%s
'
url
:
`
${
appRoot
}
#app=io.ox/mail&mailto=%s
`
}
}
]
]
}
}
...
@@ -47,7 +49,7 @@ export default async function serveWebmanifest (fastify) {
...
@@ -47,7 +49,7 @@ export default async function serveWebmanifest (fastify) {
}
}
async
function
fetchWebManifest
(
url
)
{
async
function
fetchWebManifest
(
url
)
{
const
serverConfigURL
=
new
URL
(
'
/
api/apps/manifests?action=config
'
,
url
)
const
serverConfigURL
=
new
URL
(
'
api/apps/manifests?action=config
'
,
url
)
const
conf
=
await
fetch
(
serverConfigURL
)
const
conf
=
await
fetch
(
serverConfigURL
)
if
(
conf
.
ok
)
{
if
(
conf
.
ok
)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment