Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
139 changes: 124 additions & 15 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"vue": "^3.5.13",
"vue-router": "^4.5.0",
"vue3-apexcharts": "^1.8.0",
"word-list": "^4.1.0",
"xel": "^0.33.7",
"yaml": "^2.7.1"
}
Expand Down
26 changes: 26 additions & 0 deletions src/renderer/lib/password.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
const wordList: typeof import("word-list") = require("word-list");

const fs: typeof import("fs") = require("node:fs");
const crypto: typeof import("crypto") = require("node:crypto");

export function generateRandomPassword(wordList: string[], length: number, separator: string): string {
let result = "";
separator = separator || "-";
for (let i = 0; i < length; i++) {
if (i > 0 && i < length) {
result += separator;
}
result += getRandomWordFrom(wordList);
}
return result;
}

function getRandomWordFrom(words: string[]) {
let i = crypto.randomInt(0, words.length);
return words[i];
}

export function readWordList(): string[] {
const wordArray = fs.readFileSync(wordList.default, "utf8").split("\n");
return wordArray.filter(word => word.length >= 5);
}
7 changes: 6 additions & 1 deletion src/renderer/views/Apps.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,12 @@
<div class="flex flex-row gap-5 mt-4 w-[35vw]">
<div class="flex flex-col flex-none gap-2 justify-center items-center">
<div class="relative">
<img alt="Icon for current app" v-if="currentAppForm.Icon" :src="currentAppForm.Icon" class="size-24" />
<img
alt="Icon for current app"
v-if="currentAppForm.Icon"
:src="currentAppForm.Icon"
class="size-24"
/>
<Icon v-else class="size-24 text-neutral-400" icon="mdi:image"></Icon>
<button
@click="pickCustomAppIcon"
Expand Down
15 changes: 15 additions & 0 deletions src/renderer/views/Home.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,20 @@

<!-- Buttons -->
<div v-if="!winboat.containerActionLoading.value" class="flex flex-row items-center gap-5 text-gray-200/80">
<button title="Copy" class="generic-hover" skin="flat" v-on:click="passwordDialog?.showModal()">
<Icon icon="icomoon-free:key" style="width: 3.6rem; height: 3.6rem"></Icon>
<dialog ref="passwordDialog">
<h3>Window VM Password</h3>
<pre class="text-sm text-gray-400 bg-neutral-800 p-4 rounded-lg overflow-auto">{{
compose?.services.windows.environment.PASSWORD
}}</pre>
<footer>
<x-button v-on:click="passwordDialog?.close()">
<x-label>Close</x-label>
</x-button>
</footer>
</dialog>
</button>
<button
title="Start"
class="generic-hover"
Expand Down Expand Up @@ -180,6 +194,7 @@ import { openAnchorLink } from "../utils/openLink";
const winboat = Winboat.getInstance();
const compose = ref<ComposeConfig | null>(null);
const wallpaper = ref("");
const passwordDialog = ref<HTMLDialogElement | null>(null);

onMounted(async () => {
compose.value = winboat.parseCompose();
Expand Down
Loading