mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 21:28:11 +09:00 
			
		
		
		
	#2037 Add "New Mirror" button on Dashboard
This commit is contained in:
		| @@ -28,6 +28,7 @@ organization = Organization | |||||||
| mirror = Mirror | mirror = Mirror | ||||||
| new_repo = New Repository | new_repo = New Repository | ||||||
| new_migrate = New Migration | new_migrate = New Migration | ||||||
|  | new_mirror = New Mirror | ||||||
| new_fork = New Fork Repository | new_fork = New Fork Repository | ||||||
| new_org = New Organization | new_org = New Organization | ||||||
| manage_org = Manage Organizations | manage_org = Manage Organizations | ||||||
|   | |||||||
| @@ -69,9 +69,6 @@ func (f MigrateRepoForm) ParseRemoteAddr(user *models.User) (string, error) { | |||||||
| 		} | 		} | ||||||
| 		if len(f.AuthUsername)+len(f.AuthPassword) > 0 { | 		if len(f.AuthUsername)+len(f.AuthPassword) > 0 { | ||||||
| 			u.User = url.UserPassword(f.AuthUsername, f.AuthPassword) | 			u.User = url.UserPassword(f.AuthUsername, f.AuthPassword) | ||||||
| 		} else { |  | ||||||
| 			// Fake user name and password to prevent prompt and fail quick. |  | ||||||
| 			u.User = url.UserPassword("fake_user", "") |  | ||||||
| 		} | 		} | ||||||
| 		remoteAddr = u.String() | 		remoteAddr = u.String() | ||||||
| 	} else if !user.CanImportLocal() { | 	} else if !user.CanImportLocal() { | ||||||
|   | |||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -139,6 +139,7 @@ func Migrate(ctx *middleware.Context) { | |||||||
| 	ctx.Data["Title"] = ctx.Tr("new_migrate") | 	ctx.Data["Title"] = ctx.Tr("new_migrate") | ||||||
| 	ctx.Data["private"] = ctx.User.LastRepoVisibility | 	ctx.Data["private"] = ctx.User.LastRepoVisibility | ||||||
| 	ctx.Data["IsForcedPrivate"] = setting.Repository.ForcePrivate | 	ctx.Data["IsForcedPrivate"] = setting.Repository.ForcePrivate | ||||||
|  | 	ctx.Data["mirror"] = ctx.Query("mirror") == "1" | ||||||
|  |  | ||||||
| 	ctxUser := checkContextUser(ctx, ctx.QueryInt64("org")) | 	ctxUser := checkContextUser(ctx, ctx.QueryInt64("org")) | ||||||
| 	if ctx.Written() { | 	if ctx.Written() { | ||||||
|   | |||||||
| @@ -89,7 +89,7 @@ | |||||||
| 					<h4 class="ui top attached header"> | 					<h4 class="ui top attached header"> | ||||||
| 						{{.i18n.Tr "home.my_mirrors"}} <span class="ui grey label">{{.MirrorCount}}</span> | 						{{.i18n.Tr "home.my_mirrors"}} <span class="ui grey label">{{.MirrorCount}}</span> | ||||||
| 						<div class="ui right"> | 						<div class="ui right"> | ||||||
| 							<a class="ui blue tiny show-panel button" href="{{AppSubUrl}}/repo/migrate">{{.i18n.Tr "new_migrate"}}</a> | 							<a class="ui blue tiny show-panel button" href="{{AppSubUrl}}/repo/migrate?mirror=1">{{.i18n.Tr "new_mirror"}}</a> | ||||||
| 						</div> | 						</div> | ||||||
| 					</h4> | 					</h4> | ||||||
| 					<div class="ui attached table segment"> | 					<div class="ui attached table segment"> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user