Merge pull request #3 from c-villain/fix-2.7.0

fix templates
This commit is contained in:
Alexander Kraev 2025-07-22 10:27:27 +03:00 committed by GitHub
commit 2ee06803ee
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 7 deletions

View file

@ -3,7 +3,7 @@
<div> <div>
<a-card :title="i18n('menu.blocked_domains')"> <a-card :title="i18n('menu.blocked_domains')">
<a-button type="primary" @click="showAddModal = true" style="margin-bottom: 16px;"> <a-button type="primary" @click="showAddModal = true" style="margin-bottom: 16px;">
{{ i18n('add') }} {{ i18n "add" }}
</a-button> </a-button>
<a-table-sortable <a-table-sortable
:data-source="domains" :data-source="domains"
@ -12,8 +12,8 @@
style="margin-bottom: 16px;" style="margin-bottom: 16px;"
> >
<a-table-column title="#" :customRender="(_, __, i) => i + 1" width="50" /> <a-table-column title="#" :customRender="(_, __, i) => i + 1" width="50" />
<a-table-column title="{{ i18n('domain') }}" dataIndex="domain" key="domain" /> <a-table-column title="{{ i18n "domain" }}" dataIndex="domain" key="domain" />
<a-table-column title="{{ i18n('comment') }}" dataIndex="comment" key="comment" /> <a-table-column title="{{ i18n "comment" }}" dataIndex="comment" key="comment" />
<a-table-column <a-table-column
:title="i18n('action')" :title="i18n('action')"
key="action" key="action"

View file

@ -131,13 +131,17 @@ func (s *Server) getHtmlTemplate(funcMap template.FuncMap) (*template.Template,
t := template.New("").Funcs(funcMap) t := template.New("").Funcs(funcMap)
err := fs.WalkDir(htmlFS, "html", func(path string, d fs.DirEntry, err error) error { err := fs.WalkDir(htmlFS, "html", func(path string, d fs.DirEntry, err error) error {
if err != nil { if err != nil {
return err if strings.Contains(err.Error(), "pattern matches no files") {
return nil
}
println("TEMPLATE ERROR in ", path, ": ", err.Error())
return nil
} }
if d.IsDir() { if d.IsDir() {
newT, err := t.ParseFS(htmlFS, path+"/*.html") newT, err := t.ParseFS(htmlFS, path+"/*.html")
if err != nil { if err != nil {
// ignore println("TEMPLATE ERROR in ", path, ": ", err.Error())
return nil return nil
} }
t = newT t = newT