]> source.dussan.org Git - gitea.git/commit
Show messages for users if the ROOT_URL is wrong, show JavaScript errors (#18971)
authorwxiaoguang <wxiaoguang@gmail.com>
Wed, 30 Mar 2022 05:52:24 +0000 (13:52 +0800)
committerGitHub <noreply@github.com>
Wed, 30 Mar 2022 05:52:24 +0000 (13:52 +0800)
commit2bce1ea9862c70ebb69963e65bb84dcad6ebb31c
tree04a83cae7c2e4e6c01982d9ec0ca203d1b8020bc
parentea8622d454355355df38c97f6d122862fc744514
Show messages for users if the ROOT_URL is wrong, show JavaScript errors (#18971)

* ROOT_URL issues: some users did wrong to there app.ini config, then:
    * The assets can not be loaded (AppSubUrl != "" and users try to access http://host:3000/)
    *The ROOT_URL is wrong, then many URLs in Gitea are broken.
Now Gitea show enough information to users.

* JavaScript error issues, there are many users affected by JavaScript errors, some are caused by frontend bugs, some are caused by broken customized templates. If these JS errors can be found at first time, then maintainers do not need to ask about how bug occurs again and again.

* Some people like to modify the `head.tmpl`, so we separate the script part to `head_script.tmpl`, then it's much safer.

* use specialized CSS class "js-global-error", end users still have a chance to hide error messages by customized CSS styles.
templates/base/footer.tmpl
templates/base/head.tmpl
templates/base/head_script.tmpl [new file with mode: 0644]
web_src/js/bootstrap.js [new file with mode: 0644]
web_src/js/features/common-global.js
web_src/js/index.js
web_src/js/publicpath.js [deleted file]