Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2572204
mod.rs
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
582 B
Referenced Files
None
Subscribers
None
mod.rs
View Options
use
pmc
::
config
;
use
std
::
error
::
Error
;
use
tera
::
Tera
;
use
warp
::{
filters
,
Filter
};
pub
fn
create_template_filter
()
->
Result
<
filters
::
BoxedFilter
<
((
Tera
,
String
),)
>
,
Box
<
dyn
Error
>>
{
let
s_path
=
config
::
read
().
get_path
();
let
mut
tera
=
Tera
::
default
();
tera
.
add_raw_templates
(
vec!
[
(
"view"
,
include_str!
(
"dist/view.html"
)),
(
"login"
,
include_str!
(
"dist/login.html"
)),
(
"dashboard"
,
include_str!
(
"dist/index.html"
)),
])
.
unwrap
();
Ok
(
warp
::
any
().
map
(
move
||
(
tera
.
clone
(),
s_path
.
trim_end_matches
(
'/'
).
to_string
())).
boxed
())
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Dec 16, 5:09 AM (7 h, 32 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
484916
Default Alt Text
mod.rs (582 B)
Attached To
Mode
rPMC Process Management Controller
Attached
Detach File
Event Timeline
Log In to Comment