diff --git a/app/src-tauri/tauri.conf.json b/app/src-tauri/tauri.conf.json index 7250f07..9132534 100644 --- a/app/src-tauri/tauri.conf.json +++ b/app/src-tauri/tauri.conf.json @@ -1,35 +1,33 @@ { - "build": { - "beforeDevCommand": "pnpm dev", - "beforeBuildCommand": "pnpm build", - "frontendDist": "../dist", - "devUrl": "http://localhost:1420" - }, - "bundle": { - "active": true, - "targets": "all", - "icon": [ - "icons/32x32.png", - "icons/128x128.png", - "icons/128x128@2x.png", - "icons/icon.icns", - "icons/icon.ico" - ] - }, - "productName": "panorama", - "version": "0.1.0", - "identifier": "io.mzhang.panorama", - "plugins": {}, - "app": { - "security": { - "csp": null - }, - "windows": [ - { - "title": "panorama", - "width": 800, - "height": 600 - } - ] - } -} \ No newline at end of file + "build": { + "beforeDevCommand": "pnpm dev", + "beforeBuildCommand": "pnpm build", + "frontendDist": "../dist", + "devUrl": "http://localhost:1420" + }, + "bundle": { + "active": true, + "targets": "all", + "icon": [ + "icons/32x32.png", + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/icon.icns", + "icons/icon.ico" + ] + }, + "identifier": "io.mzhang.panorama", + "plugins": {}, + "app": { + "security": { + "csp": null + }, + "windows": [ + { + "title": "panorama", + "width": 800, + "height": 600 + } + ] + } +} diff --git a/app/src/components/NodeDisplay.tsx b/app/src/components/NodeDisplay.tsx index d688093..3be2470 100644 --- a/app/src/components/NodeDisplay.tsx +++ b/app/src/components/NodeDisplay.tsx @@ -50,6 +50,7 @@ export default function NodeDisplay({ id, idx }: NodeDisplayProps) { function NodeDisplayHeaderLoaded({ idx, id, data }) { const { openNode, closeNode } = useNodeControls(); + const updatedAt = data.updated_at && Date.parse(data.updated_at); return ( <> @@ -64,9 +65,9 @@ function NodeDisplayHeaderLoaded({ idx, id, data }) { )} Type {data.type}{" "} - {data.created_at && ( + {updatedAt && ( <> - · Last updated + · Last updated )} diff --git a/crates/panorama-core/src/state/journal.rs b/crates/panorama-core/src/state/journal.rs index 5008084..61cf6bb 100644 --- a/crates/panorama-core/src/state/journal.rs +++ b/crates/panorama-core/src/state/journal.rs @@ -29,19 +29,19 @@ impl AppState { self.db.run_script( " - { - ?[id, title, type] <- [[$node_id, $title, 'panorama/journal/page']] - :put node { id, title, type } - } - { - ?[node_id, content] <- [[$node_id, '']] - :put journal { node_id => content } - } - { - ?[day, node_id] <- [[$day, $node_id]] - :put journal_day { day => node_id } - } - ", + { + ?[id, title, type] <- [[$node_id, $title, 'panorama/journal/page']] + :put node { id, title, type } + } + { + ?[node_id, content] <- [[$node_id, '']] + :put journal { node_id => content } + } + { + ?[day, node_id] <- [[$day, $node_id]] + :put journal_day { day => node_id } + } + ", btmap! { "node_id".to_owned() => node_id.clone().into(), "day".to_owned() => today.clone().into(), diff --git a/crates/panorama-daemon/src/export.rs b/crates/panorama-daemon/src/export.rs index 9d10db1..3b6b667 100644 --- a/crates/panorama-daemon/src/export.rs +++ b/crates/panorama-daemon/src/export.rs @@ -3,14 +3,15 @@ use std::{ path::PathBuf, }; -use axum::extract::State; +use axum::{extract::State, Json}; use miette::IntoDiagnostic; +use serde_json::Value; use crate::{error::AppResult, AppState}; // This code is really bad but gives me a quick way to look at all of the data // in the data at once. Rip this out once there's any Real Security Mechanism. -pub async fn export(State(state): State) -> AppResult<()> { +pub async fn export(State(state): State) -> AppResult> { let export = state.export().await?; let base_dir = PathBuf::from("export"); @@ -20,5 +21,5 @@ pub async fn export(State(state): State) -> AppResult<()> { serde_json::to_writer_pretty(file, &export).into_diagnostic()?; - Ok(()) + Ok(Json(export)) } diff --git a/crates/panorama-daemon/src/journal.rs b/crates/panorama-daemon/src/journal.rs index 8dd5ede..668adfc 100644 --- a/crates/panorama-daemon/src/journal.rs +++ b/crates/panorama-daemon/src/journal.rs @@ -13,8 +13,7 @@ use crate::{error::AppResult, AppState}; pub(super) struct JournalApi; pub(super) fn router() -> Router { - Router::new() - .route("/journal/get_todays_journal_id", get(get_todays_journal_id)) + Router::new().route("/get_todays_journal_id", get(get_todays_journal_id)) } #[utoipa::path(