|
537 | 537 | ></x-switch> |
538 | 538 | </div> |
539 | 539 | </x-card> |
| 540 | + |
| 541 | + <!-- Logs --> |
| 542 | + <x-card |
| 543 | + class="flex flex-row justify-between items-center p-2 py-3 my-0 w-full backdrop-blur-xl backdrop-brightness-150 bg-neutral-800/20" |
| 544 | + > |
| 545 | + <div> |
| 546 | + <div class="flex flex-row gap-2 items-center mb-2"> |
| 547 | + <Icon class="inline-flex text-violet-400 size-8" icon="lucide:file-code"></Icon> |
| 548 | + <h1 class="my-0 text-lg font-semibold">Logs</h1> |
| 549 | + </div> |
| 550 | + <p class="text-neutral-400 text-[0.9rem] !pt-0 !mt-0">Select the log you want to open</p> |
| 551 | + </div> |
| 552 | + <div class="flex flex-col gap-2 justify-center items-center" style="font-size: 0.8125rem"> |
| 553 | + <x-button |
| 554 | + @click=" |
| 555 | + logTitle = 'Winboat log (winboat.log)'; |
| 556 | + logContent = fs.readFileSync(path.join(WINBOAT_DIR, 'winboat.log')); |
| 557 | + logDialog!.showModal(); |
| 558 | + " |
| 559 | + > |
| 560 | + Winboat log (winboat.log) |
| 561 | + </x-button> |
| 562 | + <x-button |
| 563 | + @click=" |
| 564 | + logTitle = 'Install log (install.log)'; |
| 565 | + logContent = fs.readFileSync(path.join(WINBOAT_DIR, 'install.log')); |
| 566 | + logDialog!.showModal(); |
| 567 | + " |
| 568 | + > |
| 569 | + Install log (winboat.log) |
| 570 | + </x-button> |
| 571 | + <dialog ref="logDialog"> |
| 572 | + <div class="flex flex-row gap-0 align-middle" style="margin-bottom: 16px"> |
| 573 | + <h3 class="mb-0 mt-0 content-center">{{ logTitle }}</h3> |
| 574 | + <x-button |
| 575 | + title="Copy to clipboard" |
| 576 | + class="p-0 w-9 h-6" |
| 577 | + @click="electron.clipboard.writeText(logContent.toString())" |
| 578 | + skin="flat" |
| 579 | + > |
| 580 | + <x-popover modal> |
| 581 | + <x-label>Copied!</x-label> |
| 582 | + </x-popover> |
| 583 | + <icon icon="flowbite:clipboard-clean-outline" class="size-5"></icon> |
| 584 | + </x-button> |
| 585 | + </div> |
| 586 | + <div class="overflow-y-scroll" style="max-height: 60vh; max-width: 90vh"> |
| 587 | + <pre class="text-sm text-gray-400 bg-neutral-800 p-4 rounded-lg overflow-auto m-0">{{ |
| 588 | + logContent |
| 589 | + }}</pre> |
| 590 | + </div> |
| 591 | + <footer> |
| 592 | + <x-button v-on:click="logDialog?.close()"> |
| 593 | + <x-label>Close</x-label> |
| 594 | + </x-button> |
| 595 | + </footer> |
| 596 | + </dialog> |
| 597 | + </div> |
| 598 | + </x-card> |
540 | 599 | </div> |
541 | 600 | </div> |
542 | 601 |
|
|
572 | 631 | > |
573 | 632 | <div> |
574 | 633 | <div class="flex flex-row items-center gap-2 mb-2"> |
575 | | - <Icon class="text-violet-400 inline-flex size-8" icon="mdi:administrator"> </Icon> |
| 634 | + <Icon class="text-violet-400 inline-flex size-8" icon="mdi:administrator"></Icon> |
576 | 635 | <h1 class="text-lg my-0 font-semibold">Advanced Settings</h1> |
577 | 636 | </div> |
578 | 637 | <p class="text-neutral-400 text-[0.9rem] !pt-0 !mt-0"> |
@@ -633,9 +692,14 @@ import { |
633 | 692 | RESTART_NO, |
634 | 693 | GUEST_RDP_PORT, |
635 | 694 | DEFAULT_HOST_QMP_PORT, |
| 695 | + WINBOAT_DIR, |
636 | 696 | } from "../lib/constants"; |
637 | 697 | import { PortManager } from "../utils/port"; |
| 698 | +
|
638 | 699 | const { app }: typeof import("@electron/remote") = require("@electron/remote"); |
| 700 | +const fs: typeof import("fs") = require("node:fs"); |
| 701 | +const path: typeof import("path") = require("node:path"); |
| 702 | +const electron: typeof import("electron") = require("electron"); |
639 | 703 |
|
640 | 704 | // Emits |
641 | 705 | const $emit = defineEmits(["rerender"]); |
@@ -669,6 +733,9 @@ const isResettingWinboat = ref(false); |
669 | 733 | const isUpdatingUSBPrerequisites = ref(false); |
670 | 734 | const origApplicationScale = ref(0); |
671 | 735 | const rdpArgs = ref<RdpArg[]>([]); |
| 736 | +const logDialog = ref<HTMLDialogElement | null>(null); |
| 737 | +const logContent = ref(""); |
| 738 | +const logTitle = ref(""); |
672 | 739 |
|
673 | 740 | // For USB Devices |
674 | 741 | const availableDevices = ref<Device[]>([]); |
|
0 commit comments