Files
Blog/themes/blog/dashboard.gohtml
JiXieShi 6670a4a256 UP Api
2024-05-22 16:30:01 +08:00

45 lines
1.8 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{{template "header" .}}
<div class="sub-title">- {{ .Title }} -</div>
<p>Search</p>
<div class="item-content">
<div class="search-box">
<input id="search-input" class="search-input" type="text">
<img onclick="searchArticle()" class="search-icon" src="/public/img/search.svg" alt="">
</div>
</div>
<p>Theme</p>
<div class="item-content">
<ul class="colors">
{{range $index, $color := .Config.ThemeOption }}
<li onclick="selectColor('{{ $index }}')" class="{{ if eq $color $.Config.ThemeColor }}active{{end}}" style="background-color: {{ $color }}"></li>
{{end}}
</ul>
</div>
<p>Action</p>
<div class="item-content">
<div class="action">
<a href="{{ .Config.Dashboard }}?action=updateArticle">更新文章</a>
</div>
</div>
{{ if .Data.msg }}
<div id="action-msg" class="action-msg">
{{range $msg := .Data.msg }}
<span>{{ $msg }}</span>
{{ end }}
<span class="close" onclick="document.getElementById('action-msg').remove()">x</span>
</div>
{{ end }}
<span class="action-tip">提示更新文章会执行git pull命令和你的仓库网络有关等待时间可能会稍长。</span>
<script>
function selectColor(index) {
window.location.href = '{{ .Config.Dashboard }}?theme=' + index
}
function searchArticle() {
var searchKey = document.getElementById('search-input').value;
searchKey = searchKey.replace(/^\s+|\s+$/g,"")
if("" === searchKey){return}
window.location.href = '/?search=' + searchKey
}
</script>
{{template "footer" .}}