Skip to content

Commit

Permalink
add discord button
Browse files Browse the repository at this point in the history
  • Loading branch information
= committed Aug 7, 2024
1 parent 9325a94 commit 670aed6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 18 deletions.
25 changes: 7 additions & 18 deletions app/src/components/home/information.vue
Original file line number Diff line number Diff line change
@@ -1,17 +1,6 @@
<template>
<div>
<div role="alert" class="alert alert-error">
<svg
xmlns="http://www.w3.org/2000/svg"
class="h-6 w-6 shrink-0 stroke-current"
fill="none"
viewBox="0 0 24 24">
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M10 14l2-2m0 0l2-2m-2 2l-2-2m2 2l2 2m7-2a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
<div role="alert" class="alert alert-error mx-4 w-full">
<span>
<h2 class="font-bold text-lg">{{ errors?.length }} issue(s) occurred while starting SCRCPY+</h2>
<p>{{ errors?.join('\n\n') }}</p>
Expand All @@ -24,14 +13,14 @@
<div class="flex">
<img alt="Vue logo" src="@/assets/logo.png" class="mr-8" style="width: 5em;">
<div>
<h2 class="card-title">SCRCPY+ <span class="accent-text">{{ version.scrcpyplus }}</span></h2>
<p>SCRCPY <span class="accent-text">{{ version.scrcpy }}</span></p>
<p>ADB <span class="accent-text">{{ version.adb }}</span></p>
<h2 class="text-2xl"><span class="font-bold mr-2">SCRCPY+</span><span class="accent-text">{{ version.scrcpyplus }}</span></h2>
<p><span class="font-bold mr-2">SCRCPY</span><span class="accent-text">{{ version.scrcpy }}</span></p>
<p><span class="font-bold mr-2">ADB</span><span class="accent-text">{{ version.adb }}</span></p>
</div>
</div>

<div class="card-actions justify-end">
<button class="btn btn-ghost">Join the Discord</button>
<button class="btn btn-ghost" @click="$spb.openExternal('https://discord.gg/APQyKz9e9w')">Join the Discord</button>
<router-link to="/settings">
<button class="btn btn-primary">Settings</button>
</router-link>
Expand Down Expand Up @@ -62,15 +51,15 @@ export default {
})
.catch(e => {
errors.push(e);
return false;
return "Error";
});
const scrcpy = await this.$spb.execute('scrcpy --version')
.then(data => {
return data.split('\n')[0].split(" ")[1].trim();
})
.catch(e => {
errors.push(e);
return false;
return "Error";
});
this.version.adb = adb;
this.version.scrcpy = scrcpy;
Expand Down
6 changes: 6 additions & 0 deletions app/src/plugins/scrcpy-plus-bridge.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@ function execute(cmd) {
});
}

//--- Open In External Browser ---//
function openExternal(url) {
require("electron").shell.openExternal(url)
}

// This file is the 'SCRCPY Plus Bridge' that bridges the electron app to the host system, be it Windows, Linux or MacOS.
const spb = {
execute,
openExternal
}
export default {
install: (app, options) => {
Expand Down

0 comments on commit 670aed6

Please sign in to comment.