mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-07-27 07:35:22 +00:00
Removed redundant code
This commit is contained in:
parent
e9f33c5b50
commit
f6bcd83b72
@ -27,7 +27,6 @@ fn reset_starting_flag() {
|
|||||||
*starting_guard = false;
|
*starting_guard = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// Command to start the backend with bundled JRE
|
// Command to start the backend with bundled JRE
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
async fn start_backend(app: tauri::AppHandle) -> Result<String, String> {
|
async fn start_backend(app: tauri::AppHandle) -> Result<String, String> {
|
||||||
@ -205,10 +204,7 @@ async fn start_backend(app: tauri::AppHandle) -> Result<String, String> {
|
|||||||
|
|
||||||
// Look for startup indicators
|
// Look for startup indicators
|
||||||
if output_str.contains("Started SPDFApplication") ||
|
if output_str.contains("Started SPDFApplication") ||
|
||||||
output_str.contains("Tomcat started") ||
|
output_str.contains("Navigate to "){
|
||||||
output_str.contains("Started on port") ||
|
|
||||||
output_str.contains("Netty started") ||
|
|
||||||
output_str.contains("Started StirlingPDF") {
|
|
||||||
_startup_detected = true;
|
_startup_detected = true;
|
||||||
add_log(format!("🎉 Backend startup detected: {}", output_str));
|
add_log(format!("🎉 Backend startup detected: {}", output_str));
|
||||||
}
|
}
|
||||||
@ -296,7 +292,7 @@ async fn check_backend_health() -> Result<bool, String> {
|
|||||||
println!("💓 Health check response status: {}", status);
|
println!("💓 Health check response status: {}", status);
|
||||||
if status.is_success() {
|
if status.is_success() {
|
||||||
match response.text().await {
|
match response.text().await {
|
||||||
Ok(body) => {
|
Ok(_body) => {
|
||||||
Ok(true)
|
Ok(true)
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
@ -423,25 +419,7 @@ pub fn run() {
|
|||||||
tauri::Builder::default()
|
tauri::Builder::default()
|
||||||
.plugin(tauri_plugin_shell::init())
|
.plugin(tauri_plugin_shell::init())
|
||||||
.plugin(tauri_plugin_fs::init())
|
.plugin(tauri_plugin_fs::init())
|
||||||
.setup(|app| {
|
.setup(|_app| {Ok(())})
|
||||||
|
|
||||||
// Automatically start the backend when Tauri starts
|
|
||||||
// let app_handle = app.handle().clone();
|
|
||||||
// tauri::async_runtime::spawn(
|
|
||||||
// async move {
|
|
||||||
// match start_backend(app_handle).await {
|
|
||||||
// Ok(result) => {
|
|
||||||
// add_log(format!("🚀 Auto-started backend on Tauri startup: {}", result));
|
|
||||||
// }
|
|
||||||
// Err(error) => {
|
|
||||||
// add_log(format!("❌ Failed to auto-start backend: {}", error));
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
)
|
|
||||||
.invoke_handler(tauri::generate_handler![start_backend, check_backend_health, check_jar_exists, get_opened_file])
|
.invoke_handler(tauri::generate_handler![start_backend, check_backend_health, check_jar_exists, get_opened_file])
|
||||||
.build(tauri::generate_context!())
|
.build(tauri::generate_context!())
|
||||||
.expect("error while building tauri application")
|
.expect("error while building tauri application")
|
||||||
|
@ -2,21 +2,6 @@ import { defineConfig } from 'vite';
|
|||||||
import react from '@vitejs/plugin-react';
|
import react from '@vitejs/plugin-react';
|
||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
// prevent vite from obscuring rust errors
|
|
||||||
// clearScreen: false,
|
|
||||||
// // Env variables starting with the item of `envPrefix` will be exposed in tauri's source code through `import.meta.env`.
|
|
||||||
// envPrefix: ['VITE_', 'TAURI_ENV_*'],
|
|
||||||
// build: {
|
|
||||||
// // Tauri uses Chromium on Windows and WebKit on macOS and Linux
|
|
||||||
// target:
|
|
||||||
// process.env.TAURI_ENV_PLATFORM == 'windows'
|
|
||||||
// ? 'chrome105'
|
|
||||||
// : 'safari13',
|
|
||||||
// // don't minify for debug builds
|
|
||||||
// minify: !process.env.TAURI_ENV_DEBUG ? 'esbuild' : false,
|
|
||||||
// // produce sourcemaps for debug builds
|
|
||||||
// sourcemap: !!process.env.TAURI_ENV_DEBUG,
|
|
||||||
// },
|
|
||||||
plugins: [react()],
|
plugins: [react()],
|
||||||
server: {
|
server: {
|
||||||
// make sure this port matches the devUrl port in tauri.conf.json file
|
// make sure this port matches the devUrl port in tauri.conf.json file
|
||||||
|
Loading…
x
Reference in New Issue
Block a user