Introduce the "Reset disk" button
This commit is contained in:
parent
aa1935e389
commit
8055466b7a
@ -16,6 +16,7 @@ export default {
|
|||||||
case '.fa-github:before':
|
case '.fa-github:before':
|
||||||
case '.fa-star:before':
|
case '.fa-star:before':
|
||||||
case '.fa-circle:before':
|
case '.fa-circle:before':
|
||||||
|
case '.fa-trash-can:before':
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -1,8 +1,32 @@
|
|||||||
<script>
|
<script>
|
||||||
|
import PanelButton from './PanelButton.svelte';
|
||||||
|
import { createEventDispatcher } from 'svelte';
|
||||||
import { diskLatency } from './activities.js'
|
import { diskLatency } from './activities.js'
|
||||||
|
var dispatch = createEventDispatcher();
|
||||||
|
let state = "START";
|
||||||
|
function handleReset()
|
||||||
|
{
|
||||||
|
if(state == "START")
|
||||||
|
state = "CONFIRM";
|
||||||
|
else
|
||||||
|
dispatch('reset');
|
||||||
|
}
|
||||||
|
function getButtonText()
|
||||||
|
{
|
||||||
|
if(state == "START")
|
||||||
|
return "Reset disk";
|
||||||
|
else
|
||||||
|
return "Confirm?"
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
<h1 class="text-lg font-bold">Disk</h1>
|
<h1 class="text-lg font-bold">Disk</h1>
|
||||||
<p><span class="font-bold">Backend latency: </span>{$diskLatency}ms</p>
|
<PanelButton buttonIcon="fa-solid fa-trash-can" clickHandler={handleReset} buttonText={getButtonText(state)} bgColor="bg-red-900" hoverColor="hover:bg-red-700">
|
||||||
|
</PanelButton>
|
||||||
|
{#if state == "CONFIRM"}
|
||||||
|
<p><span class="font-bold">Warning: </span>WebVM will reload</p>
|
||||||
|
{:else}
|
||||||
|
<p><span class="font-bold">Backend latency: </span>{$diskLatency}ms</p>
|
||||||
|
{/if}
|
||||||
<p>WebVM runs on top of a complete Linux distribution</p>
|
<p>WebVM runs on top of a complete Linux distribution</p>
|
||||||
<p>Filesystems up to 2GB are supported and data is downloaded completely on-demand</p>
|
<p>Filesystems up to 2GB are supported and data is downloaded completely on-demand</p>
|
||||||
<p>The WebVM cloud backend uses WebSockets and a it's distributed via a global CDN to minimize download latency</p>
|
<p>The WebVM cloud backend uses WebSockets and a it's distributed via a global CDN to minimize download latency</p>
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
{:else if activeInfo === 'CPU'}
|
{:else if activeInfo === 'CPU'}
|
||||||
<CpuTab/>
|
<CpuTab/>
|
||||||
{:else if activeInfo === 'Disk'}
|
{:else if activeInfo === 'Disk'}
|
||||||
<DiskTab/>
|
<DiskTab on:reset/>
|
||||||
{:else if activeInfo === 'Discord'}
|
{:else if activeInfo === 'Discord'}
|
||||||
<DiscordTab/>
|
<DiscordTab/>
|
||||||
{:else if activeInfo === 'GitHub'}
|
{:else if activeInfo === 'GitHub'}
|
||||||
|
@ -282,12 +282,15 @@
|
|||||||
await cx.networkLogin();
|
await cx.networkLogin();
|
||||||
w.location.href = await startLogin();
|
w.location.href = await startLogin();
|
||||||
}
|
}
|
||||||
|
async function handleReset()
|
||||||
|
{
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<main class="relative w-full h-full">
|
<main class="relative w-full h-full">
|
||||||
<Nav />
|
<Nav />
|
||||||
<div class="absolute top-10 bottom-0 left-0 right-0">
|
<div class="absolute top-10 bottom-0 left-0 right-0">
|
||||||
<SideBar on:connect={handleConnect}/>
|
<SideBar on:connect={handleConnect} on:reset={handleReset}/>
|
||||||
{#if configObj.needsDisplay}
|
{#if configObj.needsDisplay}
|
||||||
<canvas class="absolute top-0 bottom-0 left-14 right-0" width="1024" height="768" id="display"></canvas>
|
<canvas class="absolute top-0 bottom-0 left-14 right-0" width="1024" height="768" id="display"></canvas>
|
||||||
{/if}
|
{/if}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user