Skip to content

Commit

Permalink
Small fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
thomiceli committed Jan 4, 2024
1 parent 269ce61 commit b0b71d1
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion internal/ssh/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func listen(serverConfig *ssh.ServerConfig) {
go func() {
sConn, channels, reqs, err := ssh.NewServerConn(nConn, serverConfig)
if err != nil {
if !(err != io.EOF && !errors.Is(err, syscall.ECONNRESET)) {
if err != io.EOF && !errors.Is(err, syscall.ECONNRESET) {
errorSsh("Failed to handshake", err)
}
return
Expand Down
2 changes: 1 addition & 1 deletion internal/web/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ func NewServer(isDev bool) *Server {
return nil
},
}))
// e.Use(middleware.Recover())
e.Use(middleware.Recover())
e.Use(middleware.Secure())

e.Renderer = &Template{
Expand Down
1 change: 1 addition & 0 deletions public/admin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ document.addEventListener('DOMContentLoaded', () => {
});

const setSetting = (key: string, value: string) => {
// @ts-ignore
const baseUrl = window.opengist_base_url || '';
const data = new URLSearchParams();
data.append('key', key);
Expand Down
2 changes: 1 addition & 1 deletion templates/base/admin_footer.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
{{ define "admin_footer" }}
{{ if .urlPage }}
<div class="flex mt-4 justify-center space-x-2">
{{ template "pagination" . }}
{{ template "_pagination" . }}
</div>
{{ end }}
</main>
Expand Down
7 changes: 7 additions & 0 deletions templates/pages/admin_config.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@
</div>
</div>
<dt>Log level</dt><dd>{{ .c.LogLevel }}</dd>
<dt>Log output</dt><dd>{{ .c.LogOutput }}</dd>
<dt>External URL</dt><dd>{{ .c.ExternalUrl }}</dd>
<dt>Opengist home</dt><dd>{{ .c.OpengistHome }}</dd>
<dt>DB filename</dt><dd>{{ .c.DBFilename }}</dd>
<dt>Index Enabled</dt><dd>{{ .c.IndexEnabled }}</dd>
<dt>Index Dirname</dt><dd>{{ .c.IndexDirname }}</dd>
<dt>Git default branch</dt><dd>{{ .c.GitDefaultBranch }}</dd>
<dt>SQLite Journal Mode</dt><dd>{{ .c.SqliteJournalMode }}</dd>
<div class="relative col-span-3 mt-4">
<div class="absolute inset-0 flex items-center" aria-hidden="true">
Expand Down Expand Up @@ -52,6 +56,9 @@
</div>
<dt>Github Client key</dt><dd>{{ .c.GithubClientKey }}</dd>
<dt>Github Secret</dt><dd>{{ .c.GithubSecret }}</dd>
<dt>GitLab client Key</dt><dd>{{ .c.GitlabClientKey }}</dd>
<dt>GitLab Secret</dt><dd>{{ .c.GitlabSecret }}</dd>
<dt>GitLab URL</dt><dd>{{ .c.GitlabUrl }}</dd>
<dt>Gitea client Key</dt><dd>{{ .c.GiteaClientKey }}</dd>
<dt>Gitea Secret</dt><dd>{{ .c.GiteaSecret }}</dd>
<dt>Gitea URL</dt><dd>{{ .c.GiteaUrl }}</dd>
Expand Down
2 changes: 1 addition & 1 deletion templates/pages/all.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ <h1 class="text-2xl font-bold leading-tight">{{ .locale.Tr "gist.list.search-res
{{ template "_gist_preview" $nest }}
{{ end }}

{{ template "pagination" . }}
{{ template "_pagination" . }}
{{ else }}
<div class="text-center">
<svg xmlns="http://www.w3.org/2000/svg" class="mx-auto h-12 w-12 text-slate-600 dark:text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
Expand Down
2 changes: 1 addition & 1 deletion templates/pages/likes.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ <h3 class="text-xl font-bold leading-tight break-all py-2">{{ .locale.Tr "gist.l
{{ end }}
</div>
<div class="flex justify-center space-x-2 mt-4">
{{ template "pagination" . }}
{{ template "_pagination" . }}
</div>
{{ else }}
<div class="text-center">
Expand Down
2 changes: 1 addition & 1 deletion templates/pages/revisions.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ <h3 class="text-sm py-2 flex-auto">
{{end}}
</div>
<div class="flex justify-center space-x-2">
{{ template "pagination" . }}
{{ template "_pagination" . }}
</div>
{{ else }}
<div class="text-center">
Expand Down
2 changes: 1 addition & 1 deletion templates/pages/search.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ <h1 class="text-2xl font-bold leading-tight">{{ .nbHits }} {{ .locale.Tr "gist.s
{{ end }}
</div>
</div>
{{ template "pagination" . }}
{{ template "_pagination" . }}
{{ else }}
<div class="text-center">
<svg xmlns="http://www.w3.org/2000/svg" class="mx-auto h-12 w-12 text-slate-600 dark:text-slate-400" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{ define "pagination" }}
{{ define "_pagination" }}
<div class="flex justify-center space-x-2">
{{ if .prevPage }}
<a href="{{ $.c.ExternalUrl }}/{{ .urlPage }}?page={{ .prevPage }}{{ .urlParams }}" class="relative inline-flex items-center space-x-2 rounded-md border border-white dark:border-gray-900 bg-white dark:bg-gray-900 px-2 py-1.5 font-medium text-slate-700 dark:text-slate-300 hover:border-gray-200 dark:hover:border-gray-400 hover:text-slate-700 dark:hover:text-slate-300 focus:border-primary-500 focus:outline-none focus:ring-1 focus:ring-primary-500 text-sm leading-4">
Expand Down

0 comments on commit b0b71d1

Please sign in to comment.