mirror of
https://gitlab.com/vyla-entertainment/home.git
synced 2026-11-09 19:57:20 -05:00
removed floating nav, made the updater better...?
This commit is contained in:
49
main.js
49
main.js
@@ -224,9 +224,9 @@ async function start() {
|
||||
|
||||
try {
|
||||
sendToTauri('status', { message: 'Inspecting local workspace and installed files...' });
|
||||
let isFirstRun = !patcher.verifyExtraction();
|
||||
let localVersion = patcher.getCurrentVersion();
|
||||
let localSha = patcher.getCurrentSha();
|
||||
let isFirstRun = false;
|
||||
let localVersion = '0.0.0';
|
||||
let localSha = 'force-update-sha';
|
||||
debugLog(`Is First Run: ${isFirstRun}, Local Version: ${localVersion}, Local SHA: ${localSha}`);
|
||||
|
||||
function findLocalZip() {
|
||||
@@ -249,36 +249,10 @@ async function start() {
|
||||
return null;
|
||||
}
|
||||
|
||||
const localFound = findLocalZip();
|
||||
let localZipPath = localFound ? localFound.zipPath : null;
|
||||
let localManifestPath = localFound ? localFound.manifestPath : null;
|
||||
let localZipPath = null;
|
||||
let localManifestPath = null;
|
||||
let localZipManifest = null;
|
||||
|
||||
if (localManifestPath) {
|
||||
try {
|
||||
localZipManifest = JSON.parse(fs.readFileSync(localManifestPath, 'utf8'));
|
||||
} catch (e) { }
|
||||
}
|
||||
|
||||
if (localZipPath && (isFirstRun || (localZipManifest && localZipManifest.sha256 !== localSha))) {
|
||||
debugLog(`Applying local development payload from: ${localZipPath}`);
|
||||
sendToTauri('status', { message: 'Extracting local development payload...' });
|
||||
patcher.purgeOldCode();
|
||||
patcher.extractZipPayload(localZipPath);
|
||||
patcher.applyPatches(getReplacementsConfig());
|
||||
patcher.bridgeCredentials(serviceManager.credentialManager);
|
||||
|
||||
const ver = localZipManifest ? localZipManifest.version : '1.1.32';
|
||||
const sha = localZipManifest ? localZipManifest.sha256 : null;
|
||||
patcher.saveCurrentVersion(ver, sha);
|
||||
serviceManager.envConfig = getEnvConfig();
|
||||
|
||||
isFirstRun = false;
|
||||
localVersion = ver;
|
||||
localSha = sha;
|
||||
debugLog("Local payload applied successfully.");
|
||||
}
|
||||
|
||||
sendToTauri('status', { message: 'Connecting to update servers...' });
|
||||
let release = null;
|
||||
try {
|
||||
@@ -292,17 +266,6 @@ async function start() {
|
||||
} catch (e) { }
|
||||
|
||||
if (release && release.version) {
|
||||
const rVer = release.version.replace('v', '').split('.').map(Number);
|
||||
const aVer = appPkgVer.split('.').map(Number);
|
||||
let isOlder = false;
|
||||
for (let i = 0; i < 3; i++) {
|
||||
if ((rVer[i] || 0) < (aVer[i] || 0)) { isOlder = true; break; }
|
||||
if ((rVer[i] || 0) > (aVer[i] || 0)) { break; }
|
||||
}
|
||||
if (isOlder) {
|
||||
debugLog(`Remote version ${release.version} is older than local package ${appPkgVer}. Ignoring remote release.`);
|
||||
release = null;
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
debugLog(`Update check failed (offline?): ${e.message}`);
|
||||
@@ -323,7 +286,7 @@ async function start() {
|
||||
} else if (hasUpdate) {
|
||||
|
||||
debugLog("Update available. Prompting user...");
|
||||
sendToTauri('status', { message: `New update available (${release.version}). Awaiting confirmation...` });
|
||||
sendToTauri('status', { message: `New update available (${release.version}).` });
|
||||
|
||||
try {
|
||||
if (process.platform === 'win32') {
|
||||
|
||||
@@ -269,110 +269,11 @@ const LINK_HANDLER_SCRIPT: &str =
|
||||
}, true);
|
||||
|
||||
function injectLiquidNavBar() {
|
||||
if (document.getElementById('vyla-floating-nav')) return;
|
||||
if (document.getElementById('tauri-custom-titlebar')) return;
|
||||
if (!document.body) return;
|
||||
|
||||
const style = document.createElement('style');
|
||||
style.innerHTML = `
|
||||
#vyla-floating-nav {
|
||||
position: fixed !important;
|
||||
top: 12px !important;
|
||||
left: 12px !important;
|
||||
z-index: 2147483647 !important;
|
||||
height: 42px !important;
|
||||
width: 42px !important;
|
||||
border-radius: 9999px !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
background: rgba(255, 255, 255, 0.04) !important;
|
||||
backdrop-filter: blur(16px) saturate(1.8) contrast(1.1) !important;
|
||||
-webkit-backdrop-filter: blur(16px) saturate(1.8) contrast(1.1) !important;
|
||||
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45) !important;
|
||||
transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1), padding 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
|
||||
overflow: hidden !important;
|
||||
padding: 0 !important;
|
||||
user-select: none !important;
|
||||
pointer-events: auto !important;
|
||||
-webkit-app-region: no-drag !important;
|
||||
}
|
||||
|
||||
#vyla-floating-nav:hover {
|
||||
width: 82px !important;
|
||||
padding-right: 6px !important;
|
||||
}
|
||||
|
||||
.vyla-nav-logo-wrap {
|
||||
width: 42px !important;
|
||||
min-width: 42px !important;
|
||||
height: 42px !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
cursor: pointer !important;
|
||||
border-radius: 9999px !important;
|
||||
position: relative !important;
|
||||
z-index: 2147483647 !important;
|
||||
pointer-events: auto !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.vyla-nav-logo-wrap img {
|
||||
width: 26px !important;
|
||||
height: 26px !important;
|
||||
min-width: 26px !important;
|
||||
min-height: 26px !important;
|
||||
object-fit: contain !important;
|
||||
pointer-events: none !important;
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
.vyla-nav-links {
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
gap: 4px !important;
|
||||
opacity: 0 !important;
|
||||
transform: translateX(-6px) !important;
|
||||
transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
|
||||
pointer-events: none !important;
|
||||
position: relative !important;
|
||||
z-index: 2 !important;
|
||||
margin-left: 2px !important;
|
||||
}
|
||||
|
||||
#vyla-floating-nav:hover .vyla-nav-links {
|
||||
opacity: 1 !important;
|
||||
transform: translateX(0) !important;
|
||||
pointer-events: auto !important;
|
||||
}
|
||||
|
||||
.vyla-nav-btn {
|
||||
width: 32px !important;
|
||||
min-width: 32px !important;
|
||||
height: 32px !important;
|
||||
border-radius: 9999px !important;
|
||||
border: none !important;
|
||||
outline: none !important;
|
||||
background: transparent !important;
|
||||
box-shadow: none !important;
|
||||
color: #ffffff !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
cursor: pointer !important;
|
||||
transition: transform 0.15s ease, opacity 0.2s ease !important;
|
||||
opacity: 0.85 !important;
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.vyla-nav-btn:hover { opacity: 1 !important; }
|
||||
.vyla-nav-btn svg {
|
||||
width: 20px !important;
|
||||
height: 20px !important;
|
||||
fill: #ffffff !important;
|
||||
pointer-events: none !important;
|
||||
display: block !important;
|
||||
}
|
||||
|
||||
#tauri-custom-titlebar {
|
||||
position: fixed !important;
|
||||
top: 0 !important;
|
||||
@@ -429,38 +330,6 @@ const LINK_HANDLER_SCRIPT: &str =
|
||||
`;
|
||||
document.head.appendChild(style);
|
||||
|
||||
const nav = document.createElement('div');
|
||||
nav.id = 'vyla-floating-nav';
|
||||
nav.innerHTML = `
|
||||
<div class="vyla-nav-logo-wrap" title="Go to Home">
|
||||
<img src="https://gitlab.com/vyla-entertainment/go/-/raw/main/assets/logos/white_logo.png" alt="Logo" />
|
||||
</div>
|
||||
<div class="vyla-nav-links">
|
||||
<button class="vyla-nav-btn" id="vyla-btn-discord" title="Discord Community">
|
||||
<svg viewBox="0 0 127.14 96.36"><path d="M107.7,8.07A105.15,105.15,0,0,0,81.47,0a72.06,72.06,0,0,0-3.36,6.83A97.68,97.68,0,0,0,49,6.83,72.37,72.37,0,0,0,45.64,0,105.89,105.89,0,0,0,19.39,8.09C2.79,32.65-1.71,56.6.54,80.21h0A105.73,105.73,0,0,0,32.71,96.36,77.7,77.7,0,0,0,39.6,85.25a68.42,68.42,0,0,1-10.85-5.18c.91-.66,1.8-1.34,2.66-2a75.57,75.57,0,0,0,64.32,0c.87.71,1.76,1.39,2.66,2a68.68,68.68,0,0,1-10.87,5.19,77,77,0,0,0,6.89,11.1A105.25,105.25,0,0,0,126.6,80.22h0C129.24,52.84,122.09,29.11,107.7,8.07ZM42.45,65.69C36.18,65.69,31,60,31,53s5-12.74,11.43-12.74S54,45.91,53.89,53,48.84,65.69,42.45,65.69Zm42.24,0C78.41,65.69,73.25,60,73.25,53s5-12.74,11.44-12.74S96.23,45.91,96.12,53,91.08,65.69,84.69,65.69Z"/></svg>
|
||||
</button>
|
||||
</div>
|
||||
`;
|
||||
document.body.appendChild(nav);
|
||||
|
||||
const logoBtn = nav.querySelector('.vyla-nav-logo-wrap');
|
||||
if (logoBtn) {
|
||||
logoBtn.onclick = (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
window.location.href = 'http://127.0.0.1:4890';
|
||||
};
|
||||
}
|
||||
|
||||
const btnDiscord = nav.querySelector('#vyla-btn-discord');
|
||||
if (btnDiscord) {
|
||||
btnDiscord.onclick = (e) => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
openExternalUrl('https://discord.gg/5eqRhKeywG');
|
||||
};
|
||||
}
|
||||
|
||||
const tb = document.createElement('div');
|
||||
tb.id = 'tauri-custom-titlebar';
|
||||
tb.innerHTML = `
|
||||
|
||||
@@ -196,7 +196,7 @@
|
||||
<div class="loader-card">
|
||||
<div class="status-text" id="status-message">Starting runtime engine...</div>
|
||||
<div id="debug-log-box"
|
||||
style="display: none; width: 100%; max-height: 180px; overflow-y: auto; background: rgba(255, 50, 50, 0.12); border: 1px solid rgba(255, 100, 100, 0.3); border-radius: 8px; padding: 12px; font-family: monospace; font-size: 12px; color: #fca5a5; text-align: left; white-space: pre-wrap; word-break: break-all; margin-bottom: 20px; user-select: text;">
|
||||
style="display: none; width: 100%; max-height: 180px; overflow-y: auto; background: rgba(255, 50, 50, 0.12); border-radius: 15px; padding: 12px; font-family: monospace; font-size: 12px; color: #fca5a5; text-align: left; white-space: pre-wrap; word-break: break-all; margin-bottom: 20px; user-select: text;">
|
||||
</div>
|
||||
<div class="progress-track" id="progress-track" style="display: none;">
|
||||
<div class="progress-fill" id="progress-fill"></div>
|
||||
@@ -570,9 +570,11 @@ void main() {
|
||||
const data = e.payload || e;
|
||||
if (data) {
|
||||
if (progressTrack) progressTrack.style.display = "block";
|
||||
if (progressFill) progressFill.style.width = "100%";
|
||||
if (progressFill && data.percent !== undefined) {
|
||||
progressFill.style.width = `${data.percent}%`;
|
||||
}
|
||||
if (actionsEl) actionsEl.style.display = "none";
|
||||
setStatus("Downloading update...");
|
||||
setStatus(`Downloading update... ${data.percent !== undefined ? data.percent + '%' : ''}`);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user