-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implementation of LXD PWA with a dynamic start_url"
- Added Screenshot images to /public/assets/img/ for use in teh manifest variable in index.html. Signed-off-by: Nkeiruka <nkeiruka.whenu@canonical.com>
- Loading branch information
Showing
6 changed files
with
67 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,27 @@ | ||
<!doctype html> | ||
|
||
<html lang="en" dir="ltr"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
|
||
<title>LXD UI</title> | ||
<link rel="shortcut icon" href="/assets/img/favicon-32x32.png" type="image/x-icon"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1" /> | ||
|
||
<script>const global = globalThis;</script> | ||
</head> | ||
<body> | ||
<title>LXD UI</title> | ||
<link rel="shortcut icon" href="/assets/img/favicon-32x32.png" type="image/x-icon"> | ||
<link rel="manifest" href="/manifest.json" id="manifest"> | ||
<script src="manifest.js"></script> | ||
|
||
<div id="app"></div> | ||
<script type="module" src="/src/index.tsx"></script> | ||
|
||
</body> | ||
</html> | ||
<script>const global = globalThis; | ||
|
||
</script> | ||
</head> | ||
|
||
<body> | ||
|
||
<div id="app"></div> | ||
<script type="module" src="/src/index.tsx"></script> | ||
|
||
</body> | ||
|
||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
var screenshot = window.location.origin + "/ui/assets/img/"; | ||
|
||
const manifestElement = document.getElementById("manifest"); | ||
const dynamicManifest = JSON.stringify({ | ||
short_name: "LXD", | ||
name: "LXD-UI", | ||
icons: [ | ||
{ | ||
src: window.location.origin + "/ui/assets/img/canonical-lxd-512.png", | ||
type: "image/png", | ||
sizes: "512x512", | ||
}, | ||
], | ||
id: "LXDID", | ||
start_url: window.location.origin, | ||
background_color: "#E95420", | ||
display: "standalone", | ||
scope: window.location.origin, | ||
theme_color: "#262626", | ||
shortcuts: [], | ||
description: | ||
"LXD provides a unified user experience for managing system containers and virtual machines.", | ||
screenshots: [ | ||
{ | ||
src: screenshot + "LXD-screenshot.png", | ||
type: "image/png", | ||
sizes: "954x953", | ||
form_factor: "wide", | ||
}, | ||
{ | ||
src: screenshot + "LXD-screenshot2.png", | ||
type: "image/png", | ||
sizes: "954x953", | ||
form_factor: "wide", | ||
}, | ||
{ | ||
src: screenshot + "LXD-screenshot3.png", | ||
type: "image/png", | ||
sizes: "1914x1079", | ||
}, | ||
], | ||
}); | ||
|
||
manifestElement?.setAttribute( | ||
"href", | ||
"data:application/json;charset=utf-8," + encodeURIComponent(dynamicManifest), | ||
); |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.