This commit is contained in:
Abdenasser 2024-11-13 14:15:34 +01:00
parent 5aa6a7a8e7
commit 040fd47ef3
7 changed files with 8 additions and 25 deletions

View File

@ -1,18 +1,4 @@
<script lang="ts">
import { Window } from "@tauri-apps/api/window";
const appWindow = new Window("main");
let isMaximized = false;
async function toggleMaximize() {
isMaximized = await appWindow.isMaximized();
if (isMaximized) {
await appWindow.unmaximize();
} else {
await appWindow.maximize();
}
isMaximized = await appWindow.isMaximized();
}
</script>
<div class="title-bar" data-tauri-drag-region>

View File

@ -1,5 +1,5 @@
<script lang="ts">
import Modal from "./Modal.svelte";
import { Modal } from "$lib/components/modals";
interface Process {
pid: number;

View File

@ -1,5 +1,5 @@
<script lang="ts">
import Modal from "./Modal.svelte";
import { Modal } from "$lib/components/modals";
import { formatStatus, formatUptime } from "$lib/utils";
import type { Process } from "$lib/types";
import Fa from "svelte-fa";
@ -8,7 +8,6 @@
faMemory,
faMicrochip,
faHardDrive,
faNetworkWired,
} from "@fortawesome/free-solid-svg-icons";
export let show = false;
@ -17,10 +16,6 @@
$: currentProcess = process;
function formatMemory(bytes: number) {
return (bytes / (1024 * 1024)).toFixed(1) + " MB";
}
function formatBytes(bytes: number) {
if (bytes < 1024) return `${bytes} B`;
if (bytes < 1024 * 1024) return `${(bytes / 1024).toFixed(1)} KB`;

View File

@ -0,0 +1,3 @@
export { default as Modal } from "./Modal.svelte";
export { default as ProcessDetailsModal } from "./ProcessDetailsModal.svelte";
export { default as KillProcessModal } from "./KillProcessModal.svelte";

View File

@ -1,6 +1,5 @@
export { default as ProcessTable } from "./ProcessTable.svelte";
export { default as ProcessRow } from "./ProcessRow.svelte";
export { default as TableHeader } from "./TableHeader.svelte";
export { default as ProcessCell } from "./cells/ProcessCell.svelte";
export { default as ActionButtons } from "./ActionButtons.svelte";
export { default as ProcessIcon } from "./ProcessIcon.svelte";

View File

@ -3,9 +3,9 @@
import { onMount, onDestroy } from "svelte";
import { StatsBar } from "$lib/components/stats";
import ToolBar from "$lib/components/ToolBar.svelte";
import ProcessTable from "$lib/components/process/ProcessTable.svelte";
import ProcessDetailsModal from "$lib/components/ProcessDetailsModal.svelte";
import KillProcessModal from "$lib/components/KillProcessModal.svelte";
import { ProcessTable } from "$lib/components/process";
import { ProcessDetailsModal } from "$lib/components/modals";
import { KillProcessModal } from "$lib/components/modals";
import { formatMemorySize, formatStatus } from "$lib/utils";
import { themeStore } from "$lib/stores";
import type { Process, SystemStats, Column } from "$lib/types";