aboutsummaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorwxiaoguang2023-03-04 10:12:02 +0800
committerGitHub2023-03-04 10:12:02 +0800
commitb2359f3df6673c1b2d04f0112be62990c139aba0 (patch)
tree05928f69132db314a2b43acf6900bd2584b9bc04 /templates
parent5c4075e16dd7afc75557b178239b8172e286d5c3 (diff)
Fix various bugs for "install" page (#23194)
## TLDR * Fix the broken page / broken image problem when click "Install" * Close #20089 * Fix the Password Hash Algorithm display problem for #22942 * Close #23183 * Close #23184 ## Details ### The broken page / broken image problem when click "Install" (Redirect failed after install gitea #23184) Before: when click "install", all new requests will fail, because the server has been restarted. Users just see a broken page with broken images, sometimes the server is not ready but the user would have been redirect to "/user/login" page, then the users see a new broken page (connection refused or something wrong ...) After: only check InstallLock=true for necessary handlers, and sleep for a while before restarting the server, then the browser has enough time to load the "post-install" page. And there is a script to check whether "/user/login" is ready, the user will only be redirected to the login page when the server is ready. ### During new instance setup make 'Gitea Base URL' filled from window.location.origin #20089 If the "app_url" input contains `localhost` (the default value from config), use current window's location href as the `app_url` (aka ROOT_URL) ### Fix the Password Hash Algorithm display problem for "Provide the ability to set password hash algorithm parameters #22942" Before: the UI shows `pbkdf2$50000$50` <details> ![image](https://user-images.githubusercontent.com/2114189/221917143-e1e54798-1698-4fee-a18d-00c48081fc39.png) </details> After: the UI shows `pbkdf2` <details> ![image](https://user-images.githubusercontent.com/2114189/221916999-97a15be8-2ebb-4a01-bf93-dac18e354fcc.png) </details> ### GET data: net::ERR_INVALID_URL #23183 Cause by empty `data:` in `<link rel="manifest" href="data:{{.ManifestData}}">` --------- Co-authored-by: Jason Song <i@wolfogre.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'templates')
-rw-r--r--templates/base/head.tmpl2
-rw-r--r--templates/post-install.tmpl4
2 files changed, 3 insertions, 3 deletions
diff --git a/templates/base/head.tmpl b/templates/base/head.tmpl
index c552dcfd2..d179140b2 100644
--- a/templates/base/head.tmpl
+++ b/templates/base/head.tmpl
@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{if .Title}}{{.Title | RenderEmojiPlain}} - {{end}}{{if .Repository.Name}}{{.Repository.Name}} - {{end}}{{AppName}}</title>
- <link rel="manifest" href="data:{{.ManifestData}}">
+ {{if .ManifestData}}<link rel="manifest" href="data:{{.ManifestData}}">{{end}}
<meta name="theme-color" content="{{ThemeColorMetaTag}}">
<meta name="default-theme" content="{{DefaultTheme}}">
<meta name="author" content="{{if .Repository}}{{.Owner.Name}}{{else}}{{MetaAuthor}}{{end}}">
diff --git a/templates/post-install.tmpl b/templates/post-install.tmpl
index 0d6cd3082..f237a6e01 100644
--- a/templates/post-install.tmpl
+++ b/templates/post-install.tmpl
@@ -1,5 +1,5 @@
{{template "base/head" .}}
-<div role="main" aria-label="{{.Title}}" class="page-content install">
+<div role="main" aria-label="{{.Title}}" class="page-content install post-install">
<div class="ui container">
<div class="ui grid">
<div class="sixteen wide column content">
@@ -13,7 +13,7 @@
</div>
<div class="ui stackable middle very relaxed page grid">
<div class="sixteen wide center aligned centered column">
- <p><a href="{{AppSubUrl}}/user/login">{{AppSubUrl}}/user/login</a></p>
+ <p><a id="goto-user-login" href="{{AppSubUrl}}/user/login">{{.locale.Tr "loading"}}</a></p>
</div>
</div>
</div>