mirror of
https://github.com/kunkunsh/kunkun-ext-neohtop.git
synced 2025-04-03 17:36:41 +00:00
modals
This commit is contained in:
parent
5aa6a7a8e7
commit
040fd47ef3
@ -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>
|
||||
|
@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import Modal from "./Modal.svelte";
|
||||
import { Modal } from "$lib/components/modals";
|
||||
|
||||
interface Process {
|
||||
pid: number;
|
@ -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`;
|
3
src/lib/components/modals/index.ts
Normal file
3
src/lib/components/modals/index.ts
Normal 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";
|
@ -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";
|
||||
|
@ -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";
|
||||
|
Loading…
x
Reference in New Issue
Block a user