Skip to content

Commit

Permalink
v0.0.3 add csp and screenshot
Browse files Browse the repository at this point in the history
  • Loading branch information
no398 committed Jan 16, 2024
1 parent a3163cb commit 4a3d2de
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "cases"
version = "0.0.2"
version = "0.0.3"
edition = "2021"

[dependencies]
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@
运行 `index config.toml` 程序会将数据库中的数据创建索引,索引文件路径为 `config.toml` 中的 `index_path` 变量;如果中途中断,需要删除 `index_path` 中的文件,重新运行 `index` 程序;默认情况下,不会索引案件内容,索引大小约为 15.5G,可能会花费数小时的时间。如果需要索引案件内容,需要将index.toml中的 `index_with_full_text` 设置为 `true`,但是这会使索引文件增加到150G左右,索引时间也会增加到十几个小时。

### 运行搜索服务
运行 `main config.toml` 程序,用浏览器打开网址,即可搜索。
运行 `main config.toml` 程序,用浏览器打开`config.toml`网址,即可搜索。

## 说明

当程序和配置文件放在同一目录下,且配置文件命名为 `config.toml` 时,可以省略配置文件路径参数。
当程序和配置文件放在同一目录下,且配置文件命名为 `config.toml` 时,可以省略配置文件路径参数。

![screenshot](Screenshot.png)
Binary file added Screenshot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions templates/case.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src 'self'; script-src 'none'; style-src 'self'; object-src 'none'; font-src 'none'; form-action 'self'; frame-src 'none'; media-src 'none'; manifest-src 'none'; worker-src 'none';">
<title>裁判文书网 - {{case.case_id}} - {{case.case_name}}</title>
<link rel="stylesheet" href="/style.css">
</head>
<body>
<main class="search-results">
<div class="search-result-text">
<h3 class="underlineonhover">{{ case.case_name }}</h3>
<p><b>裁判日期</b>:{{ case.judgment_date }}</b></p>
<p><b>裁判日期</b>:{{ case.judgment_date }}</p>
<p><b>发布日期</b>:{{ case.public_date }}</p>
<p><b>案号</b>:{{case.case_id}}</p>
<p><b>法院</b>:{{ case.court }}</p>
Expand All @@ -23,7 +24,8 @@ <h3 class="underlineonhover">{{ case.case_name }}</h3>
<p><b>法律依据</b>:{{ case.legal_basis }}</p>
<p></p>
<p></p>
<p><b>全文</b>:{{ case.full_text }}</p>
<p><b>全文</b></p>
{{ case.full_text }}
</div>
</main>
</body>
Expand Down
5 changes: 2 additions & 3 deletions templates/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="Content-Security-Policy" content="default-src 'none'; img-src 'self'; script-src 'none'; style-src 'self'; object-src 'none'; font-src 'none'; form-action 'self'; frame-src 'none'; media-src 'none'; manifest-src 'none'; worker-src 'none';">
<title>裁判文书网</title>
<link rel="stylesheet" href="/style.css">
</head>
Expand All @@ -12,9 +13,7 @@
<a href="/"><img src="/logo.png"></a>
<form id="search" action="/" method="get">
<div class="searchbar search-searchbar">
<form class="search-form" action="/search">
<input class="search-input" type="text" id="search" name="search" value="{{ search }}">
</form>
<input class="search-input" type="text" id="search" name="search" value="{{ search }}">
</div>
</form>
</nav>
Expand Down

0 comments on commit 4a3d2de

Please sign in to comment.