You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

dataset.go 567 B

2 years ago
2 years ago
2 years ago
2 years ago
1234567891011121314151617181920212223242526272829303132333435
  1. package dataset
  2. import "code.gitea.io/gitea/models"
  3. func GetResourceType(cloudbrainType int) string {
  4. if cloudbrainType == 0 {
  5. return "CPU/GPU"
  6. } else {
  7. return "NPU"
  8. }
  9. }
  10. func GetStatusText(isPrivate bool) string {
  11. if isPrivate {
  12. return "dataset.private"
  13. } else {
  14. return "dataset.public"
  15. }
  16. }
  17. func IsShowDataSetOfCurrentRepo(repoID int64) bool {
  18. repo := models.Repository{
  19. ID: repoID,
  20. }
  21. dataset, _ := models.GetDatasetByRepo(&repo)
  22. if dataset != nil {
  23. return true
  24. }
  25. if models.HasReferenceDataset(repoID) {
  26. return false
  27. }
  28. return true
  29. }