Skip to content

Commit

Permalink
Transfer - Relocate folders and delay counters
Browse files Browse the repository at this point in the history
  • Loading branch information
yahavi committed Oct 22, 2023
1 parent ce4d3c7 commit d368d3a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 16 deletions.
6 changes: 4 additions & 2 deletions artifactory/commands/transferfiles/transferfileprogress.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ func initTransferProgressMng(allSourceLocalRepos []string, tdc *TransferFilesCom
transfer.runningTime = transfer.transferMng.NewRunningTimeProgressBar()
transfer.speedBar = transfer.transferMng.NewSpeedProgBar()
transfer.timeEstBar = transfer.transferMng.NewTimeEstBar()
transfer.visitedFoldersBar = transfer.transferMng.NewVisitedFoldersBar()
transfer.delayedBar = transfer.transferMng.NewDelayedBar()
// Init global error count for the process
transfer.errorBar = transfer.transferMng.NewErrorBar()
tdc.progressbar = &transfer
Expand All @@ -90,6 +88,8 @@ func (t *TransferProgressMng) NewRepository(name string) {
}
t.emptyLine = t.barsMng.NewHeadlineBar("")
t.currentRepoHeadline = t.barsMng.NewHeadlineBarWithSpinner("Current repository: " + color.Green.Render(name))
t.visitedFoldersBar = t.transferMng.NewVisitedFoldersBar()
t.delayedBar = t.transferMng.NewDelayedBar()
t.transferMng.StopCurrentRepoProgressBars(false)
}

Expand Down Expand Up @@ -209,6 +209,8 @@ func (t *TransferProgressMng) RemoveRepository() {
// Abort all current repository's bars
t.currentRepoHeadline.Abort(true)
t.currentRepoHeadline = nil
t.visitedFoldersBar.GetBar().Abort(true)
t.delayedBar.GetBar().Abort(true)
t.emptyLine.Abort(true)
t.emptyLine = nil
// Abort all phases bars
Expand Down
18 changes: 4 additions & 14 deletions utils/progressbar/transferprogressbarmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,13 @@ type transferLabels struct {
Repositories string
Files string
Storage string
Note string
TransferSpeed string
EstimatedTime string
VisitedFolders string
DelayedFiles string
TransferFailures string
WorkingThreads string
RunningFor string
DiffStorage string
DiffFiles string
FailedStorage string
FailedFiles string
}

func formatString(emoji, key string, windows bool) string {
Expand All @@ -47,23 +42,18 @@ func formatString(emoji, key string, windows bool) string {
return key
}

func initSProgressBarLabels(windows bool) transferLabels {
func initProgressBarLabels(windows bool) transferLabels {
pbs := transferLabels{}
pbs.Repositories = formatString("πŸ“¦", " Repositories", windows)
pbs.Files = formatString("πŸ“„", " Files", windows)
pbs.Storage = formatString("πŸ—„ ", " Storage", windows)
pbs.Note = formatString(" 🟠", " Note: ", windows)
pbs.TransferSpeed = formatString(" ⚑", " Transfer speed: ", windows)
pbs.EstimatedTime = formatString(" βŒ›", " Estimated time remaining: ", windows)
pbs.VisitedFolders = formatString(" πŸ“", " Visited folders: ", windows)
pbs.DelayedFiles = formatString(" βœ‹", " Delayed files: ", windows)
pbs.TransferFailures = formatString(" ❌", " Transfer failures: ", windows)
pbs.WorkingThreads = formatString(" 🧡", " Working threads: ", windows)
pbs.RunningFor = formatString(" πŸƒπŸΌ", " Running for: ", windows)
pbs.DiffStorage = formatString("πŸ—„ ", " Diff Storage", windows)
pbs.DiffFiles = formatString("πŸ“„", " Diff Files", windows)
pbs.FailedFiles = formatString("πŸ“„", " Failed Files", windows)
pbs.FailedStorage = formatString("πŸ—„ ", " Failed Storage", windows)
pbs.VisitedFolders = formatString(" πŸ“", " Visited folders: ", windows)
pbs.DelayedFiles = formatString(" βœ‹", " Delayed files: ", windows)
return pbs
}

Expand All @@ -85,7 +75,7 @@ func InitTransferProgressBarMng(state *state.TransferStateManager, allRepos []st
mng.stateMng = state
mng.allRepos = allRepos
mng.generalShouldStop = false
mng.transferLabels = initSProgressBarLabels(coreutils.IsWindows())
mng.transferLabels = initProgressBarLabels(coreutils.IsWindows())
return
}

Expand Down

0 comments on commit d368d3a

Please sign in to comment.