]> source.dussan.org Git - gitea.git/commitdiff
Fix #635
authorUnknwon <joe2010xtmf@163.com>
Wed, 19 Nov 2014 00:05:33 +0000 (19:05 -0500)
committerUnknwon <joe2010xtmf@163.com>
Wed, 19 Nov 2014 00:05:33 +0000 (19:05 -0500)
conf/locale/locale_de-DE.ini
conf/locale/locale_en-US.ini
conf/locale/locale_fr-CA.ini
conf/locale/locale_nl-NL.ini
conf/locale/locale_zh-CN.ini
conf/locale/locale_zh-HK.ini
models/repo.go
routers/admin/admin.go
templates/admin/dashboard.tmpl

index 53e71d853f611aab6ff6d72c39765115c827985f..bcef66fc34c78446602c1f99abc5a97be77a65eb 100755 (executable)
@@ -462,7 +462,11 @@ dashboard.operation_name=Name der Operation
 dashboard.operation_switch=Switch\r
 dashboard.operation_run=Ausführen\r
 dashboard.clean_unbind_oauth=ungebundene OAuths bereinigen\r
+dashboard.clean_unbind_oauth_success=Alle aufheben OAuthes erfolgreich gelöscht wurden.\r
 dashboard.delete_inactivate_accounts=inaktive Konten löschen\r
+dashboard.delete_inactivate_accounts_success=Alle inaktive Konten erfolgreich gelöscht wurden.\r
+dashboard.delete_repo_archives=Alle Repositories Archive löschen\r
+dashboard.delete_repo_archives_success=Alle Repositories Archive wurden erfolgreich gelöscht.\r
 dashboard.server_uptime=Server-Uptime\r
 dashboard.current_goroutine=Aktuelle Goroutines\r
 dashboard.current_memory_usage=Aktuelle Speichernutzung\r
index a061bcb21c695c5d1ad8ee02c8df3d57e87fdaf2..3cfc9671582a23a27a3dde979dd992048695fe28 100644 (file)
@@ -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>
index 5ebe53e016fd3c3b742b453e0dbe77fbaafed4d3..ea7bc022fbaebaaf5dcdabc310dc6a032df16df7 100755 (executable)
@@ -462,7 +462,11 @@ dashboard.operation_name=Nom de l'Opération
 dashboard.operation_switch=Basculer\r
 dashboard.operation_run=Exécuter\r
 dashboard.clean_unbind_oauth=Nettoyer les associations OAuthes\r
+dashboard.clean_unbind_oauth_success=Tous unbind OAuthes ont été supprimés avec succès.\r
 dashboard.delete_inactivate_accounts=Supprimer tous les comptes inactifs\r
+dashboard.delete_inactivate_accounts_success=Inactivent tous les comptes ont été supprimés avec succès.\r
+dashboard.delete_repo_archives=Supprimer toutes les archives de référentiels\r
+dashboard.delete_repo_archives_success=Toutes les archives de référentiels ont été supprimés avec succès.\r
 dashboard.server_uptime=Durée de Marche Serveur\r
 dashboard.current_goroutine=Goroutines actuelles\r
 dashboard.current_memory_usage=Utilisation Mémoire actuelle\r
index ab93b8e021fd8e5bebc712217a969a9c508343c7..1bfc3c3d98328ae4af848225114e315759c0977d 100755 (executable)
@@ -462,7 +462,11 @@ dashboard.operation_name=Bewerking naam
 dashboard.operation_switch=Omschakelen\r
 dashboard.operation_run=Uitvoeren\r
 dashboard.clean_unbind_oauth=Clean unbound OAuths\r
+dashboard.clean_unbind_oauth_success=Alle OAuthes binding hebben verwijderd.\r
 dashboard.delete_inactivate_accounts=Verwijder alle inactieve accounts\r
+dashboard.delete_inactivate_accounts_success=Alle inactivering van rekeningen hebben verwijderd.\r
+dashboard.delete_repo_archives=Verwijderen van alle repositories archieven\r
+dashboard.delete_repo_archives_success=Alle repositories archieven hebben verwijderd.\r
 dashboard.server_uptime=Uptime server\r
 dashboard.current_goroutine=Huidige Goroutines\r
 dashboard.current_memory_usage=Huidige geheugen gebruik\r
index bf1b21a4273939caa6d27a83589ce6f01746368a..02cf77c5c97f3347bc7916b4a2096db0fe60202e 100755 (executable)
@@ -462,7 +462,11 @@ dashboard.operation_name=操作名称
 dashboard.operation_switch=开关\r
 dashboard.operation_run=执行\r
 dashboard.clean_unbind_oauth=清理未绑定社交帐号\r
+dashboard.clean_unbind_oauth_success=所有未绑定社交数据清除成功!\r
 dashboard.delete_inactivate_accounts=删除所有未激活帐户\r
+dashboard.delete_inactivate_accounts_success=所有未激活帐号清除成功!\r
+dashboard.delete_repo_archives=删除所有仓库存档\r
+dashboard.delete_repo_archives_success=所有仓库存档清除成功!\r
 dashboard.server_uptime=服务运行时间\r
 dashboard.current_goroutine=当前 Goroutines 数量\r
 dashboard.current_memory_usage=当前内存使用量\r
index 25974e7d00d5eb652b05de3ec61a7a79a38652ed..0435e7d9e22e8758ee6be29b6896c48e0e87933e 100755 (executable)
@@ -462,7 +462,11 @@ dashboard.operation_name=操作名稱
 dashboard.operation_switch=開關\r
 dashboard.operation_run=執行\r
 dashboard.clean_unbind_oauth=清理未綁定社交帳號\r
+dashboard.clean_unbind_oauth_success=所有未綁定社交數據清除成功!\r
 dashboard.delete_inactivate_accounts=刪除所有未激活帳戶\r
+dashboard.delete_inactivate_accounts_success=所有未激活帳號清除成功!\r
+dashboard.delete_repo_archives=刪除所有倉庫存檔\r
+dashboard.delete_repo_archives_success=所有倉庫存檔清除成功!\r
 dashboard.server_uptime=服務執行時間\r
 dashboard.current_goroutine=當前 Goroutines 數量\r
 dashboard.current_memory_usage=當前內存使用量\r
index d0cd1b553d631a23642e53cb39f4f0228b6c708d..937bd8c1b6d3f2671705e05fbc7fa0c1eb56a0d5 100644 (file)
@@ -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"))
+               })
+}
+
 //  __      __         __         .__
 // /  \    /  \_____ _/  |_  ____ |  |__
 // \   \/\/   /\__  \\   __\/ ___\|  |  \
index 6f2966bcb445cb2978e0c5a6a1a2196b5aed1aae..db36696c7745d99eab3b8eec145c6cfa52553d6a 100644 (file)
@@ -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)
index 80c02828e7ccfda8b4e9985448517149d415ac53..70389105966420dbed469b28aaaf7c5eb167437d 100644 (file)
                                                 <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>