Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WD-11261] Implementation of LXD PWA with a dynamic start_url #785

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion index.html
Kxiru marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@

<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="/ui/assets/js/manifest.js"></script>
<script>const global = globalThis;</script>
</head>
<body>
Expand Down
Binary file added public/assets/img/LXD-screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/img/LXD-screenshot2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/img/LXD-screenshot3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/img/canonical-lxd-512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
47 changes: 47 additions & 0 deletions public/assets/js/manifest.js
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 " + window.location.origin,
name: "LXD-UI - " + window.location.origin,
icons: [
{
src: window.location.origin + "/ui/assets/img/canonical-lxd-512.png",
type: "image/png",
sizes: "512x512",
},
],
id: "LXDID-" + window.location.origin,
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: "1920x1075",
},
],
});

manifestElement?.setAttribute(
"href",
"data:application/json;charset=utf-8," + encodeURIComponent(dynamicManifest),
);
Loading