Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
forked fromgo-gitea/gitea

Commit7e6f5e2

Browse files
wxiaoguangGiteaBot
authored andcommitted
Fix some log and UI problems (go-gitea#34863)
Remove the misleading error log,fixgo-gitea#34738Make the "search" input auto-focused,fixgo-gitea#34807
1 parent9339661 commit7e6f5e2

File tree

4 files changed

+15
-10
lines changed

4 files changed

+15
-10
lines changed

‎models/asymkey/gpg_key_add.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ func AddGPGKey(ctx context.Context, ownerID int64, content, token, signature str
9191
signer,err=openpgp.CheckArmoredDetachedSignature(ekeys,strings.NewReader(token+"\r\n"),strings.NewReader(signature),nil)
9292
}
9393
iferr!=nil {
94-
log.Error("Unable to validate token signature. Error: %v",err)
94+
log.Debug("AddGPGKey CheckArmoredDetachedSignature failed: %v",err)
9595
returnnil,ErrGPGInvalidTokenSignature{
9696
ID:ekeys[0].PrimaryKey.KeyIdString(),
9797
Wrapped:err,

‎models/asymkey/gpg_key_verify.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ func VerifyGPGKey(ctx context.Context, ownerID int64, keyID, token, signature st
8585
}
8686

8787
ifsigner==nil {
88-
log.Error("Unable to validate token signature. Error: %v",err)
88+
log.Debug("VerifyGPGKey failed: no signer")
8989
return"",ErrGPGInvalidTokenSignature{
9090
ID:key.KeyID,
9191
}

‎models/asymkey/ssh_key_verify.go‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ func VerifySSHKey(ctx context.Context, ownerID int64, fingerprint, token, signat
3535
// edge case for Windows based shells that will add CR LF if piped to ssh-keygen command
3636
// see https://github.com/PowerShell/PowerShell/issues/5974
3737
ifsshsig.Verify(strings.NewReader(token+"\r\n"), []byte(signature), []byte(key.Content),"gitea")!=nil {
38-
log.Error("Unable to validate token signature. Error: %v",err)
38+
log.Debug("VerifySSHKey sshsig.Verify failed: %v",err)
3939
return"",ErrSSHInvalidTokenSignature{
4040
Fingerprint:key.Fingerprint,
4141
}

‎web_src/js/components/DashboardRepoList.vue‎

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export default defineComponent({
3838
return {
3939
tab,
4040
repos: [],
41-
reposTotalCount:0,
41+
reposTotalCount:null,
4242
reposFilter,
4343
archivedFilter,
4444
privateFilter,
@@ -112,9 +112,6 @@ export default defineComponent({
112112
const el=document.querySelector('#dashboard-repo-list');
113113
this.changeReposFilter(this.reposFilter);
114114
fomanticQuery(el.querySelector('.ui.dropdown')).dropdown();
115-
nextTick(()=> {
116-
this.$refs.search?.focus();
117-
});
118115
119116
this.textArchivedFilterTitles= {
120117
'archived':this.textShowOnlyArchived,
@@ -242,12 +239,20 @@ export default defineComponent({
242239
243240
let response, json;
244241
try {
242+
const firstLoad=this.reposTotalCount===null;
245243
if (!this.reposTotalCount) {
246244
const totalCountSearchURL=`${this.subUrl}/repo/search?count_only=1&uid=${this.uid}&team_id=${this.teamId}&q=&page=1&mode=`;
247245
response=awaitGET(totalCountSearchURL);
248246
this.reposTotalCount=parseInt(response.headers.get('X-Total-Count')??'0');
249247
}
250-
248+
if (firstLoad&&this.reposTotalCount) {
249+
nextTick(()=> {
250+
// MDN: If there's no focused element, this is the Document.body or Document.documentElement.
251+
if ((document.activeElement===document.body||document.activeElement===document.documentElement)) {
252+
this.$refs.search.focus({preventScroll:true});
253+
}
254+
});
255+
}
251256
response=awaitGET(searchedURL);
252257
json=awaitresponse.json();
253258
}catch {
@@ -349,7 +354,7 @@ export default defineComponent({
349354
<h4class="ui top attached header tw-flex tw-items-center">
350355
<divclass="tw-flex-1 tw-flex tw-items-center">
351356
{{ textMyRepos }}
352-
<spanclass="ui grey label tw-ml-2">{{ reposTotalCount }}</span>
357+
<spanv-if="reposTotalCount"class="ui grey label tw-ml-2">{{ reposTotalCount }}</span>
353358
</div>
354359
<aclass="tw-flex tw-items-center muted":href="subUrl + '/repo/create' + (isOrganization ? '?org=' + organizationId : '')":data-tooltip-content="textNewRepo">
355360
<svg-iconname="octicon-plus"/>
@@ -420,7 +425,7 @@ export default defineComponent({
420425
</div>
421426
<divv-if="repos.length"class="ui attached table segment tw-rounded-b">
422427
<ulclass="repo-owner-name-list">
423-
<liclass="tw-flex tw-items-center tw-py-2"v-for="repo, index in repos":class="{'active': index === activeIndex}":key="repo.id">
428+
<liclass="tw-flex tw-items-center tw-py-2"v-for="(repo, index) in repos":class="{'active': index === activeIndex}":key="repo.id">
424429
<aclass="repo-list-link muted":href="repo.link">
425430
<svg-icon:name="repoIcon(repo)":size="16"class="repo-list-icon"/>
426431
<divclass="text truncate">{{ repo.full_name }}</div>

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp