|
@@ -125,26 +125,26 @@ func updateSystemStatus() {
|
|
|
type AdminOperation int
|
|
type AdminOperation int
|
|
|
|
|
|
|
|
const (
|
|
const (
|
|
|
- // CLEAN_INACTIVATE_USER operation value
|
|
|
|
|
- CLEAN_INACTIVATE_USER AdminOperation = iota + 1
|
|
|
|
|
|
|
+ // CleanInactiveUser operation value
|
|
|
|
|
+ CleanInactiveUser AdminOperation = iota + 1
|
|
|
|
|
|
|
|
- // CLEAN_REPO_ARCHIVES operation value
|
|
|
|
|
- CLEAN_REPO_ARCHIVES
|
|
|
|
|
|
|
+ // CleanRepoArchives operation value
|
|
|
|
|
+ CleanRepoArchives
|
|
|
|
|
|
|
|
- // CLEAN_MISSING_REPOS operation value
|
|
|
|
|
- CLEAN_MISSING_REPOS
|
|
|
|
|
|
|
+ // CleanMissingRepos operation value
|
|
|
|
|
+ CleanMissingRepos
|
|
|
|
|
|
|
|
- // GIT_GC_REPOS operation value
|
|
|
|
|
- GIT_GC_REPOS
|
|
|
|
|
|
|
+ // GitGCRepos operation value
|
|
|
|
|
+ GitGCRepos
|
|
|
|
|
|
|
|
- // SYNC_SSH_AUTHORIZED_KEY operation value
|
|
|
|
|
- SYNC_SSH_AUTHORIZED_KEY
|
|
|
|
|
|
|
+ // SyncSSHAuthorizedKey operation value
|
|
|
|
|
+ SyncSSHAuthorizedKey
|
|
|
|
|
|
|
|
- // SYNC_REPOSITORY_HOOKS operation value
|
|
|
|
|
- SYNC_REPOSITORY_HOOKS
|
|
|
|
|
|
|
+ // SyncRepositoryHooks operation value
|
|
|
|
|
+ SyncRepositoryHooks
|
|
|
|
|
|
|
|
- // REINIT_MISSING_REPOSITORY operation value
|
|
|
|
|
- REINIT_MISSING_REPOSITORY
|
|
|
|
|
|
|
+ // ReinitMissingRepository operation value
|
|
|
|
|
+ ReinitMissingRepository
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
// Dashboard shows dashboard page
|
|
// Dashboard shows dashboard page
|
|
@@ -160,22 +160,22 @@ func Dashboard(c *context.Context) {
|
|
|
var success string
|
|
var success string
|
|
|
|
|
|
|
|
switch AdminOperation(op) {
|
|
switch AdminOperation(op) {
|
|
|
- case CLEAN_REPO_ARCHIVES:
|
|
|
|
|
|
|
+ case CleanRepoArchives:
|
|
|
success = "All repositories archives have been deleted successfully."
|
|
success = "All repositories archives have been deleted successfully."
|
|
|
err = models.DeleteRepositoryArchives()
|
|
err = models.DeleteRepositoryArchives()
|
|
|
- case CLEAN_MISSING_REPOS:
|
|
|
|
|
|
|
+ case CleanMissingRepos:
|
|
|
success = "All repository records that lost Git files have been deleted successfully."
|
|
success = "All repository records that lost Git files have been deleted successfully."
|
|
|
err = models.DeleteMissingRepositories()
|
|
err = models.DeleteMissingRepositories()
|
|
|
- case GIT_GC_REPOS:
|
|
|
|
|
|
|
+ case GitGCRepos:
|
|
|
success = "All repositories have done garbage collection successfully."
|
|
success = "All repositories have done garbage collection successfully."
|
|
|
err = models.GitGcRepos()
|
|
err = models.GitGcRepos()
|
|
|
- case SYNC_SSH_AUTHORIZED_KEY:
|
|
|
|
|
|
|
+ case SyncSSHAuthorizedKey:
|
|
|
success = "All public keys have been rewritten successfully."
|
|
success = "All public keys have been rewritten successfully."
|
|
|
err = models.RewriteAuthorizedKeys()
|
|
err = models.RewriteAuthorizedKeys()
|
|
|
- case SYNC_REPOSITORY_HOOKS:
|
|
|
|
|
|
|
+ case SyncRepositoryHooks:
|
|
|
success = "All repositories' pre-receive, update and post-receive hooks have been resynced successfully."
|
|
success = "All repositories' pre-receive, update and post-receive hooks have been resynced successfully."
|
|
|
err = models.SyncRepositoryHooks()
|
|
err = models.SyncRepositoryHooks()
|
|
|
- case REINIT_MISSING_REPOSITORY:
|
|
|
|
|
|
|
+ case ReinitMissingRepository:
|
|
|
success = "All repository records that lost Git files have been reinitialized successfully."
|
|
success = "All repository records that lost Git files have been reinitialized successfully."
|
|
|
err = models.ReinitMissingRepositories()
|
|
err = models.ReinitMissingRepositories()
|
|
|
}
|
|
}
|