diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-05-11 16:25:46 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-11 08:25:46 +0000 |
commit | f6e029e6c7849d4361abf7f1d749b5d528364ac4 (patch) | |
tree | af285dd000dc48e4e94e717cf61a8b2437e99beb /templates/repo/migrate | |
parent | 58dfaf3a75a097088376a9c221784b3675ac9c48 (diff) | |
download | gitea-f6e029e6c7849d4361abf7f1d749b5d528364ac4.tar.gz gitea-f6e029e6c7849d4361abf7f1d749b5d528364ac4.zip |
Make repo migration cancelable and fix various bugs (#24605)
Replace #12917
Close #24601
Close #12845
![image](https://github.com/go-gitea/gitea/assets/2114189/39378118-064d-40fb-8396-4579ebf33917)
![image](https://github.com/go-gitea/gitea/assets/2114189/faf37418-191c-46a6-90a8-353141e00e2d)
![image](https://github.com/go-gitea/gitea/assets/2114189/fdc8ee4d-125f-4737-9990-89bcdf9eb388)
![image](https://github.com/go-gitea/gitea/assets/2114189/9a3bd2c2-fe20-4011-81f0-990ed869d139)
---------
Co-authored-by: Yarden Shoham <git@yardenshoham.com>
Co-authored-by: silverwind <me@silverwind.io>
Co-authored-by: Giteabot <teabot@gitea.io>
Diffstat (limited to 'templates/repo/migrate')
-rw-r--r-- | templates/repo/migrate/migrating.tmpl | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/templates/repo/migrate/migrating.tmpl b/templates/repo/migrate/migrating.tmpl index 72c3fe5664..58c453fe54 100644 --- a/templates/repo/migrate/migrating.tmpl +++ b/templates/repo/migrate/migrating.tmpl @@ -7,7 +7,7 @@ {{template "base/alert" .}} <div class="home"> <div class="ui stackable middle very relaxed page grid"> - <div id="repo_migrating" class="sixteen wide center aligned centered column" task="{{.MigrateTask.ID}}"> + <div id="repo_migrating" class="sixteen wide center aligned centered column" data-migrating-task-id="{{.MigrateTask.ID}}"> <div> <img src="{{AssetUrlPrefix}}/img/loading.png"> </div> @@ -32,10 +32,14 @@ {{end}} <p id="repo_migrating_failed_error"></p> </div> - {{if and .Failed .Permission.IsAdmin}} + {{if .Permission.IsAdmin}} <div class="ui divider"></div> <div class="item"> + {{if .Failed}} <button class="ui basic red show-modal button" data-modal="#delete-repo-modal">{{.locale.Tr "repo.settings.delete"}}</button> + {{else}} + <button class="ui basic red show-modal button" data-modal="#cancel-repo-modal">{{.locale.Tr "cancel"}}</button> + {{end}} </div> {{end}} </div> @@ -45,6 +49,7 @@ </div> </div> </div> + <div class="ui small modal" id="delete-repo-modal"> <div class="header"> {{.locale.Tr "repo.settings.delete"}} @@ -78,4 +83,18 @@ </form> </div> </div> + +<div class="ui g-modal-confirm modal" id="cancel-repo-modal"> + <div class="header"> + {{.locale.Tr "repo.migrate.cancel_migrating_title"}} + </div> + <form action="{{.Link}}/settings/migrate/cancel" method="post"> + {{.CsrfTokenHtml}} + <div class="content"> + {{.locale.Tr "repo.migrate.cancel_migrating_confirm"}} + </div> + {{template "base/modal_actions_confirm" .}} + </form> +</div> + {{template "base/footer" .}} |