Skip to content

Commit

Permalink
Connection and settings fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Levminer committed Jul 20, 2024
1 parent ad72872 commit e1c23eb
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 18 deletions.
7 changes: 6 additions & 1 deletion platforms/interface/ui/pages/connections.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@
<button
class="button"
on:click={() => {
open(`https://cores.levminer.com/settings?connectionCode=${$settings.connectionCode}`)
open(
`https://cores.levminer.com/settings?connectionCode=${$settings.connectionCode}&mac=${
$hardwareInfo.system.network.interfaces[0]?.macAddress ?? ""
}`,
)
}}
>
<ExternalLink />
Expand All @@ -61,6 +65,7 @@
import { settings } from "ui/stores/settings.ts"
import { invoke } from "@tauri-apps/api/core"
import { open } from "@tauri-apps/plugin-shell"
import { hardwareInfo } from "../stores/hardwareInfo.ts"
const remoteConnections = () => {
invoke("restart_service")
Expand Down
8 changes: 4 additions & 4 deletions platforms/interface/ui/pages/gpu.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@
<h3>Name: {$hardwareInfo.gpu.name ?? "N/A"}</h3>
<h3>GPU memory: {$hardwareInfo.gpu.memory.length > 2 ? Math.round($hardwareInfo.gpu.memory[2]?.value ?? 0) : "N/A"} GB</h3>
<h3>Driver date: {$hardwareInfo.gpu.info}</h3>
<h3>Primary monitor: {primaryMonitor?.resolution ?? "N/A"} {primaryMonitor?.refreshRate ?? "N/A"} Hz</h3>
<h3>
Primary monitor: {$hardwareInfo.system.monitor.monitors.find((monitor) => monitor.primary)?.resolution ?? "N/A"}
{$hardwareInfo.system.monitor.monitors.find((monitor) => monitor.primary)?.refreshRate ?? "N/A"} Hz
</h3>
</div>
</div>

Expand Down Expand Up @@ -258,7 +261,4 @@
import ToggleButton from "ui/components/toggleButton.svelte"
let minutes = false
// get primary monitor
let primaryMonitor = $hardwareInfo.system.monitor.monitors.find((monitor) => monitor.primary)
</script>
30 changes: 17 additions & 13 deletions platforms/interface/ui/pages/settings.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -133,25 +133,29 @@
fullVersionList?: { version: string }[]
}
let chromium_version = "N/A"
let runtimeVersion = "N/A"
// @ts-ignore
const ua: userAgentData = await navigator.userAgentData.getHighEntropyValues([
"architecture",
"model",
"platform",
"platformVersion",
"fullVersionList",
])
if (ua.fullVersionList !== undefined && ua.fullVersionList.length > 0) {
try {
// @ts-ignore
chromium_version = ua.fullVersionList.filter((item) => item.brand === "Chromium")[0]?.version || "N/A"
const ua: userAgentData = await navigator.userAgentData.getHighEntropyValues([
"architecture",
"model",
"platform",
"platformVersion",
"fullVersionList",
])
if (ua.fullVersionList !== undefined && ua.fullVersionList.length > 0) {
// @ts-ignore
runtimeVersion = ua.fullVersionList.filter((item) => item.brand === "Chromium")[0]?.version || "N/A"
}
} catch (error) {
console.log(error)
}
const systemInfo: SystemInfo = await invoke("system_info")
let dialogMessage = `Cores: ${build.version} \n\nTauri: ${systemInfo.tauriVersion} \nChromium: ${chromium_version}\n\nOS version: ${
let dialogMessage = `Cores: ${build.version} \n\nTauri: ${systemInfo.tauriVersion} \nRuntime: ${runtimeVersion}\n\nOS version: ${
$hardwareInfo.system.os.name
} \nHardware info: ${$hardwareInfo.cpu.name} ${Math.round(systemInfo.totalMem / 1024 / 1024 / 1024)} GB RAM\n\nRelease date: ${
build.date
Expand Down

0 comments on commit e1c23eb

Please sign in to comment.