Merge branch 'beta' into picker

This commit is contained in:
JeLuF 2023-07-02 18:40:20 +02:00
commit d17ee88ced
4 changed files with 18 additions and 10 deletions

View File

@ -485,7 +485,7 @@ dialog {
} }
dialog::backdrop { dialog::backdrop {
background: var(--backdrop-color); background: rgba(32, 33, 36, 50%);
} }
dialog > div { dialog > div {
@ -1295,7 +1295,7 @@ input::file-selector-button {
.popup { .popup {
position: absolute; position: absolute;
background: var(--backdrop-color); background: rgba(32, 33, 36, 50%);
top: 0px; top: 0px;
left: 0px; left: 0px;
right: 0px; right: 0px;
@ -1575,6 +1575,7 @@ body.wait-pause {
margin-top: 0.2em; margin-top: 0.2em;
margin-bottom: 0.2em; margin-bottom: 0.2em;
display: inline-block; display: inline-block;
width: 80%;
} }
#copy-cloudflare-address { #copy-cloudflare-address {

View File

@ -1,4 +1,4 @@
:root, ::backdrop { :root {
--main-hue: 222; --main-hue: 222;
--main-saturation: 4%; --main-saturation: 4%;
--value-base: 13%; --value-base: 13%;
@ -45,7 +45,6 @@
--status-orange: rgb(200, 139, 0); --status-orange: rgb(200, 139, 0);
--status-green: green; --status-green: green;
--status-red: red; --status-red: red;
--backdrop-color: rgba(32, 33, 36, 50%);
} }
.theme-light { .theme-light {

View File

@ -2103,7 +2103,7 @@ function tunnelUpdate(event) {
if ("cloudflare" in event) { if ("cloudflare" in event) {
document.getElementById("cloudflare-off").classList.add("displayNone") document.getElementById("cloudflare-off").classList.add("displayNone")
document.getElementById("cloudflare-on").classList.remove("displayNone") document.getElementById("cloudflare-on").classList.remove("displayNone")
cloudflareAddressField.innerHTML = event.cloudflare cloudflareAddressField.value = event.cloudflare
document.getElementById("toggle-cloudflare-tunnel").innerHTML = "Stop" document.getElementById("toggle-cloudflare-tunnel").innerHTML = "Stop"
} else { } else {
document.getElementById("cloudflare-on").classList.add("displayNone") document.getElementById("cloudflare-on").classList.add("displayNone")

View File

@ -233,7 +233,7 @@ var PARAMETERS = [
note: `<span id="cloudflare-off">Create a VPN tunnel to share your Easy Diffusion instance with your friends. This will note: `<span id="cloudflare-off">Create a VPN tunnel to share your Easy Diffusion instance with your friends. This will
generate a web server address on the public Internet for your Easy Diffusion instance. </span> generate a web server address on the public Internet for your Easy Diffusion instance. </span>
<div id="cloudflare-on" class="displayNone"><div>This Easy Diffusion server is available on the Internet using the <div id="cloudflare-on" class="displayNone"><div>This Easy Diffusion server is available on the Internet using the
address:</div><div><div id="cloudflare-address"></div><button id="copy-cloudflare-address">Copy</button></div></div> address:</div><div><input id="cloudflare-address" value="" readonly><button id="copy-cloudflare-address">Copy</button></div></div>
<b>Anyone knowing this address can access your server.</b> The address of your server will change each time <b>Anyone knowing this address can access your server.</b> The address of your server will change each time
you share a session.<br> you share a session.<br>
Uses <a href="https://try.cloudflare.com/" target="_blank">Cloudflare services</a>.`, Uses <a href="https://try.cloudflare.com/" target="_blank">Cloudflare services</a>.`,
@ -714,9 +714,17 @@ listenPortField.addEventListener("change", debounce( ()=>{
let copyCloudflareAddressBtn = document.querySelector("#copy-cloudflare-address") let copyCloudflareAddressBtn = document.querySelector("#copy-cloudflare-address")
let cloudflareAddressField = document.getElementById("cloudflare-address") let cloudflareAddressField = document.getElementById("cloudflare-address")
copyCloudflareAddressBtn.addEventListener("click", (e) => { navigator.permissions.query({ name: "clipboard-write" }).then(function (result) {
navigator.clipboard.writeText(cloudflareAddressField.innerHTML) if (result.state === "granted") {
showToast("Copied server address to clipboard") // you can read from the clipboard
}) copyCloudflareAddressBtn.addEventListener("click", (e) => {
navigator.clipboard.writeText(cloudflareAddressField.innerHTML)
showToast("Copied server address to clipboard")
})
} else {
copyCloudflareAddressBtn.classList.add("displayNone")
}
});
document.addEventListener("system_info_update", (e) => setDeviceInfo(e.detail)) document.addEventListener("system_info_update", (e) => setDeviceInfo(e.detail))