-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5e7ca20
commit 7a2a746
Showing
36 changed files
with
355 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Ping Viewer Next DesktopApp | ||
|
||
Ping Viewer Next Desktop is a standalone version of the **Ping Viewer Next** core server. This application allows you to interface with **ping devices** attached directly to your computer or connected to a remotely one. | ||
|
||
## Key Features | ||
|
||
- **Local and Remote Connections**: Connect to ping devices on your local network or to remote Ping Viewer Next servers. | ||
- **Cross-Platform Support**: Available for macOS, Linux, and Windows. | ||
- **Standalone App**: Just install and use directly on your favorite OS. | ||
|
||
### Download | ||
|
||
You can download the latest version from the [releases page](https://github.com/bluerobotics/ping-viewer-next/releases). | ||
|
||
## How It Works | ||
|
||
Ping Viewer Next Desktop integrates the core Ping Viewer Next server with an embedded GUI, using Tauri to create a native experience across platforms. |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8" /> | ||
<link rel="icon" type="image/svg+xml" href="/vite.svg" /> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | ||
<title>Tauri + Vue + Typescript App</title> | ||
</head> | ||
|
||
<body> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "ping-viewer-next-desktop", | ||
"private": true, | ||
"version": "0.1.0", | ||
"type": "module", | ||
"scripts": { | ||
"dev": "vite", | ||
"build": "vue-tsc --noEmit && vite build", | ||
"preview": "vite preview", | ||
"tauri": "tauri" | ||
}, | ||
"dependencies": { | ||
"vue": "^3.3.4", | ||
"@tauri-apps/api": "^1" | ||
}, | ||
"devDependencies": { | ||
"@vitejs/plugin-vue": "^5.0.5", | ||
"typescript": "^5.2.2", | ||
"vite": "^5.3.1", | ||
"vue-tsc": "^2.0.22", | ||
"@tauri-apps/cli": "^1" | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Generated by Cargo | ||
# will have compiled files and executables | ||
/target/ | ||
|
||
# Generated by Tauri | ||
# will have schema files for capabilities auto-completion | ||
/gen/schemas | ||
|
||
/Cargo.lock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
[package] | ||
name = "ping-viewer-next-desktop" | ||
version = "0.1.0" | ||
description = "A Tauri App" | ||
authors = ["you"] | ||
edition = "2021" | ||
|
||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html | ||
|
||
[build-dependencies] | ||
tauri-build = { version = "1.5.4", features = [] } | ||
|
||
[dependencies] | ||
tauri = { version = "1.7.2", features = ["shell-open"] } | ||
serde = { version = "1", features = ["derive"] } | ||
serde_json = "1" | ||
ping-viewer-next = { path = "./../../", features = ["desktop-app"] } | ||
tokio = { version = "1.40.0", features = ["full"] } | ||
actix-web = "4.6.0" | ||
|
||
[features] | ||
# This feature is used for production builds or when a dev server is not specified, DO NOT REMOVE!! | ||
custom-protocol = ["tauri/custom-protocol"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fn main() { | ||
tauri_build::build() | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// Prevents additional console window on Windows in release, DO NOT REMOVE!! | ||
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")] | ||
|
||
use ping_viewer_next::{cli, device, logger, server}; | ||
use tauri::Manager; | ||
|
||
#[tokio::main] | ||
async fn main() { | ||
cli::manager::init(); | ||
|
||
logger::manager::init(); | ||
|
||
let (manager, handler) = device::manager::DeviceManager::new(10); | ||
|
||
tokio::spawn(async move { manager.run().await }); | ||
|
||
run_tauri_app(handler).await; | ||
} | ||
|
||
async fn run_tauri_app(handler: device::manager::ManagerActorHandler) { | ||
tauri::Builder::default() | ||
.setup(|app: &mut tauri::App| { | ||
let window = app.get_window("main").unwrap(); | ||
|
||
std::thread::spawn(move || { | ||
run_from_tauri(&cli::manager::server_address(), handler).unwrap(); | ||
}); | ||
|
||
std::thread::spawn(move || { | ||
std::thread::sleep(std::time::Duration::from_secs(6)); | ||
window.eval("window.location.replace('http://0.0.0.0:8080')").unwrap(); | ||
}); | ||
|
||
Ok(()) | ||
}) | ||
.run(tauri::generate_context!()) | ||
.expect("error while running tauri application"); | ||
} | ||
|
||
#[actix_web::main] | ||
pub async fn run_from_tauri( | ||
server_address: &str, | ||
handler: device::manager::ManagerActorHandler, | ||
) -> std::io::Result<()> { | ||
server::manager::run(server_address, handler).await | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"build": { | ||
"beforeDevCommand": "bun run dev", | ||
"beforeBuildCommand": "bun run build", | ||
"devPath": "http://localhost:1420", | ||
"distDir": "../dist" | ||
}, | ||
"package": { | ||
"productName": "ping-viewer-next-desktop", | ||
"version": "0.1.0" | ||
}, | ||
"tauri": { | ||
"allowlist": { | ||
"all": false, | ||
"shell": { | ||
"all": false, | ||
"open": true | ||
} | ||
}, | ||
"windows": [ | ||
{ | ||
"title": "ping-viewer-next-desktop", | ||
"width": 800, | ||
"height": 600 | ||
} | ||
], | ||
"security": { | ||
"csp": null | ||
}, | ||
"bundle": { | ||
"active": true, | ||
"targets": "all", | ||
"identifier": "com.ping-viewer-next-desktop.app", | ||
"icon": [ | ||
"icons/32x32.png", | ||
"icons/128x128.png", | ||
"icons/[email protected]", | ||
"icons/icon.icns", | ||
"icons/icon.ico" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<script setup lang="ts"> | ||
import { ref, onMounted } from "vue"; | ||
const loading = ref(true); | ||
const checkServerReady = () => { | ||
setTimeout(() => { | ||
loading.value = false; | ||
}, 2000); | ||
}; | ||
onMounted(() => { | ||
checkServerReady(); | ||
}); | ||
</script> | ||
|
||
<template> | ||
<div v-if="loading" class="preloader"> | ||
<h1>Ping Viewer Next</h1> | ||
<p>Creating a local server...</p> | ||
</div> | ||
|
||
<div v-else class="container"> | ||
<h1>Ping Viewer Next</h1> | ||
<p>Server is ready!</p> | ||
</div> | ||
</template> | ||
|
||
<style scoped> | ||
.preloader, .container { | ||
display: flex; | ||
flex-direction: column; | ||
justify-content: center; | ||
align-items: center; | ||
width: 100vw; | ||
height: 100vh; | ||
margin: 0; | ||
padding: 0; | ||
background-color: #f0f0f0; | ||
} | ||
h1 { | ||
font-size: 3rem; | ||
margin-bottom: 1rem; | ||
} | ||
p { | ||
font-size: 1.5rem; | ||
color: #666; | ||
} | ||
html, body { | ||
margin: 0; | ||
padding: 0; | ||
overflow: hidden; | ||
} | ||
</style> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<script setup lang="ts"> | ||
import { ref } from "vue"; | ||
import { invoke } from "@tauri-apps/api/tauri"; | ||
const greetMsg = ref(""); | ||
const name = ref(""); | ||
async function greet() { | ||
// Learn more about Tauri commands at https://tauri.app/v1/guides/features/command | ||
greetMsg.value = await invoke("greet", { name: name.value }); | ||
} | ||
</script> | ||
|
||
<template> | ||
<form class="row" @submit.prevent="greet"> | ||
<input id="greet-input" v-model="name" placeholder="Enter a name..." /> | ||
<button type="submit">Greet</button> | ||
</form> | ||
|
||
<p>{{ greetMsg }}</p> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import { createApp } from "vue"; | ||
import App from "./App.vue"; | ||
|
||
createApp(App).mount("#app"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
/// <reference types="vite/client" /> | ||
|
||
declare module "*.vue" { | ||
import type { DefineComponent } from "vue"; | ||
const component: DefineComponent<{}, {}, any>; | ||
export default component; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
{ | ||
"compilerOptions": { | ||
"target": "ES2020", | ||
"useDefineForClassFields": true, | ||
"module": "ESNext", | ||
"lib": ["ES2020", "DOM", "DOM.Iterable"], | ||
"skipLibCheck": true, | ||
|
||
/* Bundler mode */ | ||
"moduleResolution": "bundler", | ||
"allowImportingTsExtensions": true, | ||
"resolveJsonModule": true, | ||
"isolatedModules": true, | ||
"noEmit": true, | ||
"jsx": "preserve", | ||
|
||
/* Linting */ | ||
"strict": true, | ||
"noUnusedLocals": true, | ||
"noUnusedParameters": true, | ||
"noFallthroughCasesInSwitch": true | ||
}, | ||
"include": ["src/**/*.ts", "src/**/*.d.ts", "src/**/*.tsx", "src/**/*.vue"], | ||
"references": [{ "path": "./tsconfig.node.json" }] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"compilerOptions": { | ||
"composite": true, | ||
"skipLibCheck": true, | ||
"module": "ESNext", | ||
"moduleResolution": "bundler", | ||
"allowSyntheticDefaultImports": true | ||
}, | ||
"include": ["vite.config.ts"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { defineConfig } from "vite"; | ||
import vue from "@vitejs/plugin-vue"; | ||
|
||
// https://vitejs.dev/config/ | ||
export default defineConfig(async () => ({ | ||
plugins: [vue()], | ||
|
||
// Vite options tailored for Tauri development and only applied in `tauri dev` or `tauri build` | ||
// | ||
// 1. prevent vite from obscuring rust errors | ||
clearScreen: false, | ||
// 2. tauri expects a fixed port, fail if that port is not available | ||
server: { | ||
port: 1420, | ||
strictPort: true, | ||
watch: { | ||
// 3. tell vite to ignore watching `src-tauri` | ||
ignored: ["**/src-tauri/**"], | ||
}, | ||
}, | ||
})); |