mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	* Fix repo-list private and total count bugs Signed-off-by: Andrew Thornton <art27@cantab.net> * Ensure limited and private org public repos are displayed on "private" Signed-off-by: Andrew Thornton <art27@cantab.net> * switch from onlyPrivate to is_private Signed-off-by: Andrew Thornton <art27@cantab.net> * Generate swagger Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com> Co-authored-by: guillep2k <18600385+guillep2k@users.noreply.github.com>
This commit is contained in:
		@@ -2745,7 +2745,7 @@ function initVueComponents() {
 | 
			
		||||
        }&page=${this.page}&limit=${this.searchLimit}&mode=${this.repoTypes[this.reposFilter].searchMode
 | 
			
		||||
        }${this.reposFilter !== 'all' ? '&exclusive=1' : ''
 | 
			
		||||
        }${this.archivedFilter === 'archived' ? '&archived=true' : ''}${this.archivedFilter === 'unarchived' ? '&archived=false' : ''
 | 
			
		||||
        }${this.privateFilter === 'private' ? '&onlyPrivate=true' : ''}${this.privateFilter === 'public' ? '&private=false' : ''
 | 
			
		||||
        }${this.privateFilter === 'private' ? '&is_private=true' : ''}${this.privateFilter === 'public' ? '&is_private=false' : ''
 | 
			
		||||
        }`;
 | 
			
		||||
      },
 | 
			
		||||
      repoTypeCount() {
 | 
			
		||||
@@ -2911,56 +2911,18 @@ function initVueComponents() {
 | 
			
		||||
        this.searchRepos();
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      showArchivedRepo(repo) {
 | 
			
		||||
        switch (this.archivedFilter) {
 | 
			
		||||
          case 'both':
 | 
			
		||||
            return true;
 | 
			
		||||
          case 'unarchived':
 | 
			
		||||
            return !repo.archived;
 | 
			
		||||
          case 'archived':
 | 
			
		||||
            return repo.archived;
 | 
			
		||||
          default:
 | 
			
		||||
            return !repo.archived;
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      showPrivateRepo(repo) {
 | 
			
		||||
        switch (this.privateFilter) {
 | 
			
		||||
          case 'both':
 | 
			
		||||
            return true;
 | 
			
		||||
          case 'public':
 | 
			
		||||
            return !repo.private;
 | 
			
		||||
          case 'private':
 | 
			
		||||
            return repo.private;
 | 
			
		||||
          default:
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      showFilteredRepo(repo) {
 | 
			
		||||
        switch (this.reposFilter) {
 | 
			
		||||
          case 'sources':
 | 
			
		||||
            return repo.owner.id === this.uid && !repo.mirror && !repo.fork;
 | 
			
		||||
          case 'forks':
 | 
			
		||||
            return repo.owner.id === this.uid && !repo.mirror && repo.fork;
 | 
			
		||||
          case 'mirrors':
 | 
			
		||||
            return repo.mirror;
 | 
			
		||||
          case 'collaborative':
 | 
			
		||||
            return repo.owner.id !== this.uid && !repo.mirror;
 | 
			
		||||
          default:
 | 
			
		||||
            return true;
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      showRepo(repo) {
 | 
			
		||||
        return this.showArchivedRepo(repo) && this.showPrivateRepo(repo) && this.showFilteredRepo(repo);
 | 
			
		||||
      },
 | 
			
		||||
 | 
			
		||||
      searchRepos() {
 | 
			
		||||
        const self = this;
 | 
			
		||||
 | 
			
		||||
        this.isLoading = true;
 | 
			
		||||
 | 
			
		||||
        if (!this.reposTotalCount) {
 | 
			
		||||
          const totalCountSearchURL = `${this.suburl}/api/v1/repos/search?sort=updated&order=desc&uid=${this.uid}&q=&page=1&mode=`;
 | 
			
		||||
          $.getJSON(totalCountSearchURL, (_result, _textStatus, request) => {
 | 
			
		||||
            self.reposTotalCount = request.getResponseHeader('X-Total-Count');
 | 
			
		||||
          });
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        const searchedMode = this.repoTypes[this.reposFilter].searchMode;
 | 
			
		||||
        const searchedURL = this.searchURL;
 | 
			
		||||
        const searchedQuery = this.searchQuery;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user