repos.go 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // Copyright 2014 The Gogs Authors. All rights reserved.
  2. // Use of this source code is governed by a MIT-style
  3. // license that can be found in the LICENSE file.
  4. package admin
  5. import (
  6. "github.com/Unknwon/paginater"
  7. "github.com/gogits/gogs/models"
  8. "github.com/gogits/gogs/modules/base"
  9. "github.com/gogits/gogs/modules/log"
  10. "github.com/gogits/gogs/modules/middleware"
  11. "github.com/gogits/gogs/modules/setting"
  12. )
  13. const (
  14. REPOS base.TplName = "admin/repo/list"
  15. )
  16. func Repos(ctx *middleware.Context) {
  17. ctx.Data["Title"] = ctx.Tr("admin.repositories")
  18. ctx.Data["PageIsAdmin"] = true
  19. ctx.Data["PageIsAdminRepositories"] = true
  20. total := models.CountRepositories()
  21. page := ctx.QueryInt("page")
  22. if page <= 1 {
  23. page = 1
  24. }
  25. ctx.Data["Page"] = paginater.New(int(total), setting.AdminRepoPagingNum, page, 5)
  26. repos, err := models.RepositoriesWithUsers(page, setting.AdminRepoPagingNum)
  27. if err != nil {
  28. ctx.Handle(500, "RepositoriesWithUsers", err)
  29. return
  30. }
  31. ctx.Data["Repos"] = repos
  32. ctx.Data["Total"] = total
  33. ctx.HTML(200, REPOS)
  34. }
  35. func DeleteRepo(ctx *middleware.Context) {
  36. repo, err := models.GetRepositoryByID(ctx.QueryInt64("id"))
  37. if err != nil {
  38. ctx.Handle(500, "GetRepositoryByID", err)
  39. return
  40. }
  41. if err := models.DeleteRepository(repo.MustOwner().Id, repo.ID); err != nil {
  42. ctx.Handle(500, "DeleteRepository", err)
  43. return
  44. }
  45. log.Trace("Repository deleted: %s/%s", repo.MustOwner().Name, repo.Name)
  46. ctx.Flash.Success(ctx.Tr("repo.settings.deletion_success"))
  47. ctx.JSON(200, map[string]interface{}{
  48. "redirect": setting.AppSubUrl + "/admin/repos?page=" + ctx.Query("page"),
  49. })
  50. }
PANIC: session(release): write data/sessions/c/a/cad70469b73529cb: no space left on device

PANIC

session(release): write data/sessions/c/a/cad70469b73529cb: no space left on device
github.com/go-macaron/session@v0.0.0-20190805070824-1a3cdc6f5659/session.go:199 (0x8b2934)
gopkg.in/macaron.v1@v1.3.9/context.go:79 (0x83d0a0)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/context.go:112 (0x84fdb5)
gopkg.in/macaron.v1@v1.3.9/recovery.go:161 (0x84fda8)
gopkg.in/macaron.v1@v1.3.9/logger.go:40 (0x840c73)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:157 (0x80ab07)
github.com/go-macaron/inject@v0.0.0-20160627170012-d8a0b8677191/inject.go:135 (0x80a8a8)
gopkg.in/macaron.v1@v1.3.9/context.go:121 (0x83d1f8)
gopkg.in/macaron.v1@v1.3.9/router.go:187 (0x850fc6)
gopkg.in/macaron.v1@v1.3.9/router.go:303 (0x8493e5)
gopkg.in/macaron.v1@v1.3.9/macaron.go:220 (0x841fca)
net/http/server.go:2836 (0x7a79b2)
net/http/server.go:1924 (0x7a341b)
runtime/asm_amd64.s:1373 (0x46f9f0)