Skip to content

Commit

Permalink
fix: fix transflow path issue
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Dec 9, 2021
1 parent f0deec0 commit 666c61d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
4 changes: 2 additions & 2 deletions quake_core/src/entry/entry_paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@ impl EntryPaths {
"entries.csv"
}

pub fn transflows_yaml() -> &'static str {
"transflows.yaml"
pub fn quake() -> &'static str {
"_quake"
}

pub fn transfuncs() -> &'static str {
Expand Down
7 changes: 6 additions & 1 deletion quake_webapp/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,17 @@
overflow: scroll;
position: relative;
}
#transflow-nav {
display: inline;
}
</style>
</head>
<body>
<div id="navigator">
<a href="/">Go Home</a>
<a href="/transflow/show_calendar">calendar</a>
<div id="transflow-nav">
<a href="/transflow/show_calendar">calendar</a>
</div>
</div>
<div id="outlet"></div>
</body>
Expand Down
5 changes: 3 additions & 2 deletions src/server/transflow_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ use std::path::PathBuf;

use rocket::fs::NamedFile;
use rocket::response::content::JavaScript;
use rocket::response::status::NotFound;
use rocket::serde::json::Json;
use rocket::State;
use rocket::{get, post};
Expand Down Expand Up @@ -53,7 +52,9 @@ pub(crate) async fn translate(
#[get("/script")]
pub(crate) async fn transfunc_script(config: &State<QuakeConfig>) -> Option<NamedFile> {
let path = PathBuf::from(config.workspace.clone());
let fs = path.join(EntryPaths::transfuncs());
let fs = path
.join(EntryPaths::quake())
.join(EntryPaths::transfuncs());

let file = NamedFile::open(fs);
file.await.ok()
Expand Down

0 comments on commit 666c61d

Please sign in to comment.