mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2024-11-25 01:22:42 +01:00
Fix #635
This commit is contained in:
parent
ce8d4cc80b
commit
2d8c414f8c
9 changed files with 55 additions and 10 deletions
|
@ -462,7 +462,11 @@ dashboard.operation_name=Name der Operation
|
|||
dashboard.operation_switch=Switch
|
||||
dashboard.operation_run=Ausführen
|
||||
dashboard.clean_unbind_oauth=ungebundene OAuths bereinigen
|
||||
dashboard.clean_unbind_oauth_success=Alle aufheben OAuthes erfolgreich gelöscht wurden.
|
||||
dashboard.delete_inactivate_accounts=inaktive Konten löschen
|
||||
dashboard.delete_inactivate_accounts_success=Alle inaktive Konten erfolgreich gelöscht wurden.
|
||||
dashboard.delete_repo_archives=Alle Repositories Archive löschen
|
||||
dashboard.delete_repo_archives_success=Alle Repositories Archive wurden erfolgreich gelöscht.
|
||||
dashboard.server_uptime=Server-Uptime
|
||||
dashboard.current_goroutine=Aktuelle Goroutines
|
||||
dashboard.current_memory_usage=Aktuelle Speichernutzung
|
||||
|
|
|
@ -196,7 +196,7 @@ full_name = Full Name
|
|||
website = Website
|
||||
location = Location
|
||||
update_profile = Update Profile
|
||||
update_profile_success = Your profile has been successfully updated.
|
||||
update_profile_success = Your profile has been updated successfully.
|
||||
change_username = Username Changed
|
||||
change_username_desc = Username has been changed, do you want to continue? This will affect all links relate to your account.
|
||||
continue = Continue
|
||||
|
@ -323,10 +323,10 @@ settings.new_owner_has_same_repo = New owner already has a repository with same
|
|||
settings.delete = Delete This Repository
|
||||
settings.delete_desc = Once you delete a repository, there is no going back. Please be certain.
|
||||
settings.transfer_notices = <p>- You will lose access if new owner is a individual user.</p><p>- You will remain access if new owner is an organization and you're one of the owners.</p>
|
||||
settings.update_settings_success = Repository options has been successfully updated.
|
||||
settings.update_settings_success = Repository options has been updated successfully.
|
||||
settings.transfer_owner = New Owner
|
||||
settings.make_transfer = Make Transfer
|
||||
settings.transfer_succeed = Repository ownership has been successfully transferred.
|
||||
settings.transfer_succeed = Repository ownership has been transferred successfully.
|
||||
settings.confirm_delete = Confirm Deletion
|
||||
settings.add_collaborator = Add New Collaborator
|
||||
settings.add_collaborator_success = New collaborator has been added.
|
||||
|
@ -395,7 +395,7 @@ settings.location = Location
|
|||
settings.update_settings = Update Settings
|
||||
settings.change_orgname = Organization Name Changed
|
||||
settings.change_orgname_desc = Organization name has been changed, do you want to continue? This will affect all links relate to this organization.
|
||||
settings.update_setting_success = Organization setting has been successfully updated.
|
||||
settings.update_setting_success = Organization setting has been updated successfully.
|
||||
settings.delete = Delete Organization
|
||||
settings.delete_account = Delete This Organization
|
||||
settings.delete_prompt = The operation will delete this organization permanently, and <strong>CANNOT</strong> be undone!
|
||||
|
@ -433,7 +433,7 @@ teams.delete_team = Delete This Team
|
|||
teams.add_team_member = Add Team Member
|
||||
teams.delete_team_title = Team Deletion
|
||||
teams.delete_team_desc = This team is going to be deleted, do you want to continue? Members of this team may lose access to some repositories.
|
||||
teams.delete_team_success = Given team has been successfully deleted.
|
||||
teams.delete_team_success = Given team has been deleted successfully.
|
||||
teams.read_permission_desc = This team grants <strong>Read</strong> access: members can view and clone the team's repositories.
|
||||
teams.write_permission_desc = This team grants <strong>Write</strong> access: members can read from and push to the team's repositories.
|
||||
teams.admin_permission_desc = This team grants <strong>Admin</strong> access: members can read from, push to, and add collaborators to the team's repositories.
|
||||
|
@ -462,7 +462,11 @@ dashboard.operation_name = Operation Name
|
|||
dashboard.operation_switch = Switch
|
||||
dashboard.operation_run = Run
|
||||
dashboard.clean_unbind_oauth = Clean unbound OAuthes
|
||||
dashboard.clean_unbind_oauth_success = All unbind OAuthes have been deleted successfully.
|
||||
dashboard.delete_inactivate_accounts = Delete all inactive accounts
|
||||
dashboard.delete_inactivate_accounts_success = All inactivate accounts have been deleted successfully.
|
||||
dashboard.delete_repo_archives = Delete all repositories archives
|
||||
dashboard.delete_repo_archives_success = All repositories archives have been deleted successfully.
|
||||
dashboard.server_uptime = Server Uptime
|
||||
dashboard.current_goroutine = Current Goroutines
|
||||
dashboard.current_memory_usage = Current Memory Usage
|
||||
|
@ -504,7 +508,7 @@ users.edit = Edit
|
|||
users.auth_source = Authorization Source
|
||||
users.local = Local
|
||||
users.auth_login_name = Authorization Login Name
|
||||
users.update_profile_success = Account profile has been successfully updated.
|
||||
users.update_profile_success = Account profile has been updated successfully.
|
||||
users.edit_account = Edit Account
|
||||
users.is_activated = This account is activated
|
||||
users.is_admin = This account has administrator permissions
|
||||
|
@ -550,7 +554,7 @@ auths.enable_auto_register = Enable Auto Registration
|
|||
auths.tips = Tips
|
||||
auths.edit = Edit Authorization Setting
|
||||
auths.activated = This authentication has activated
|
||||
auths.update_success = Authorization setting has been successfully updated.
|
||||
auths.update_success = Authorization setting has been updated successfully.
|
||||
auths.update = Update Authorization Setting
|
||||
auths.delete = Delete This Authorization
|
||||
auths.delete_auth_title = Authorization Deletion
|
||||
|
@ -632,7 +636,7 @@ notices.type = Type
|
|||
notices.type_1 = Repository
|
||||
notices.desc = Description
|
||||
notices.op = Op.
|
||||
notices.delete_success = System notice has been successfully deleted.
|
||||
notices.delete_success = System notice has been deleted successfully.
|
||||
|
||||
[action]
|
||||
create_repo = created repository <a href="%s/%s">%s</a>
|
||||
|
|
|
@ -462,7 +462,11 @@ dashboard.operation_name=Nom de l'Opération
|
|||
dashboard.operation_switch=Basculer
|
||||
dashboard.operation_run=Exécuter
|
||||
dashboard.clean_unbind_oauth=Nettoyer les associations OAuthes
|
||||
dashboard.clean_unbind_oauth_success=Tous unbind OAuthes ont été supprimés avec succès.
|
||||
dashboard.delete_inactivate_accounts=Supprimer tous les comptes inactifs
|
||||
dashboard.delete_inactivate_accounts_success=Inactivent tous les comptes ont été supprimés avec succès.
|
||||
dashboard.delete_repo_archives=Supprimer toutes les archives de référentiels
|
||||
dashboard.delete_repo_archives_success=Toutes les archives de référentiels ont été supprimés avec succès.
|
||||
dashboard.server_uptime=Durée de Marche Serveur
|
||||
dashboard.current_goroutine=Goroutines actuelles
|
||||
dashboard.current_memory_usage=Utilisation Mémoire actuelle
|
||||
|
|
|
@ -462,7 +462,11 @@ dashboard.operation_name=Bewerking naam
|
|||
dashboard.operation_switch=Omschakelen
|
||||
dashboard.operation_run=Uitvoeren
|
||||
dashboard.clean_unbind_oauth=Clean unbound OAuths
|
||||
dashboard.clean_unbind_oauth_success=Alle OAuthes binding hebben verwijderd.
|
||||
dashboard.delete_inactivate_accounts=Verwijder alle inactieve accounts
|
||||
dashboard.delete_inactivate_accounts_success=Alle inactivering van rekeningen hebben verwijderd.
|
||||
dashboard.delete_repo_archives=Verwijderen van alle repositories archieven
|
||||
dashboard.delete_repo_archives_success=Alle repositories archieven hebben verwijderd.
|
||||
dashboard.server_uptime=Uptime server
|
||||
dashboard.current_goroutine=Huidige Goroutines
|
||||
dashboard.current_memory_usage=Huidige geheugen gebruik
|
||||
|
|
|
@ -462,7 +462,11 @@ dashboard.operation_name=操作名称
|
|||
dashboard.operation_switch=开关
|
||||
dashboard.operation_run=执行
|
||||
dashboard.clean_unbind_oauth=清理未绑定社交帐号
|
||||
dashboard.clean_unbind_oauth_success=所有未绑定社交数据清除成功!
|
||||
dashboard.delete_inactivate_accounts=删除所有未激活帐户
|
||||
dashboard.delete_inactivate_accounts_success=所有未激活帐号清除成功!
|
||||
dashboard.delete_repo_archives=删除所有仓库存档
|
||||
dashboard.delete_repo_archives_success=所有仓库存档清除成功!
|
||||
dashboard.server_uptime=服务运行时间
|
||||
dashboard.current_goroutine=当前 Goroutines 数量
|
||||
dashboard.current_memory_usage=当前内存使用量
|
||||
|
|
|
@ -462,7 +462,11 @@ dashboard.operation_name=操作名稱
|
|||
dashboard.operation_switch=開關
|
||||
dashboard.operation_run=執行
|
||||
dashboard.clean_unbind_oauth=清理未綁定社交帳號
|
||||
dashboard.clean_unbind_oauth_success=所有未綁定社交數據清除成功!
|
||||
dashboard.delete_inactivate_accounts=刪除所有未激活帳戶
|
||||
dashboard.delete_inactivate_accounts_success=所有未激活帳號清除成功!
|
||||
dashboard.delete_repo_archives=刪除所有倉庫存檔
|
||||
dashboard.delete_repo_archives_success=所有倉庫存檔清除成功!
|
||||
dashboard.server_uptime=服務執行時間
|
||||
dashboard.current_goroutine=當前 Goroutines 數量
|
||||
dashboard.current_memory_usage=當前內存使用量
|
||||
|
|
|
@ -1171,6 +1171,18 @@ func SearchRepositoryByName(opt SearchOption) (repos []*Repository, err error) {
|
|||
return repos, err
|
||||
}
|
||||
|
||||
// DeleteRepositoryArchives deletes all repositories' archives.
|
||||
func DeleteRepositoryArchives() error {
|
||||
return x.Where("id > 0").Iterate(new(Repository),
|
||||
func(idx int, bean interface{}) error {
|
||||
repo := bean.(*Repository)
|
||||
if err := repo.GetOwner(); err != nil {
|
||||
return err
|
||||
}
|
||||
return os.RemoveAll(filepath.Join(RepoPath(repo.Owner.Name, repo.Name), "archives"))
|
||||
})
|
||||
}
|
||||
|
||||
// __ __ __ .__
|
||||
// / \ / \_____ _/ |_ ____ | |__
|
||||
// \ \/\/ /\__ \\ __\/ ___\| | \
|
||||
|
|
|
@ -116,6 +116,7 @@ type AdminOperation int
|
|||
const (
|
||||
CLEAN_UNBIND_OAUTH AdminOperation = iota + 1
|
||||
CLEAN_INACTIVATE_USER
|
||||
CLEAN_REPO_ARCHIVES
|
||||
)
|
||||
|
||||
func Dashboard(ctx *middleware.Context) {
|
||||
|
@ -131,11 +132,14 @@ func Dashboard(ctx *middleware.Context) {
|
|||
|
||||
switch AdminOperation(op) {
|
||||
case CLEAN_UNBIND_OAUTH:
|
||||
success = "All unbind OAuthes have been deleted."
|
||||
success = ctx.Tr("admin.dashboard.clean_unbind_oauth_success")
|
||||
err = models.CleanUnbindOauth()
|
||||
case CLEAN_INACTIVATE_USER:
|
||||
success = "All inactivate accounts have been deleted."
|
||||
success = ctx.Tr("admin.dashboard.delete_inactivate_accounts_success")
|
||||
err = models.DeleteInactivateUsers()
|
||||
case CLEAN_REPO_ARCHIVES:
|
||||
success = ctx.Tr("admin.dashboard.delete_repo_archives_success")
|
||||
err = models.DeleteRepositoryArchives()
|
||||
}
|
||||
|
||||
if err != nil {
|
||||
|
@ -148,6 +152,7 @@ func Dashboard(ctx *middleware.Context) {
|
|||
}
|
||||
|
||||
ctx.Data["Stats"] = models.GetStatistic()
|
||||
// FIXME: update periodically
|
||||
updateSystemStatus()
|
||||
ctx.Data["SysStatus"] = sysStatus
|
||||
ctx.HTML(200, DASHBOARD)
|
||||
|
|
|
@ -40,6 +40,10 @@
|
|||
<td>{{.i18n.Tr "admin.dashboard.delete_inactivate_accounts"}}</td>
|
||||
<td><i class="fa fa-caret-square-o-right"></i> <a href="{{AppSubUrl}}/admin?op=2">{{.i18n.Tr "admin.dashboard.operation_run"}}</a></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{{.i18n.Tr "admin.dashboard.delete_repo_archives"}}</td>
|
||||
<td><i class="fa fa-caret-square-o-right"></i> <a href="{{AppSubUrl}}/admin?op=3">{{.i18n.Tr "admin.dashboard.operation_run"}}</a></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
Loading…
Reference in a new issue