<commit_before>import { downloadFile, SystemInfoService, SystemInfo, ErrorHandler } from "@harbor/ui";
import {
  Component,
  OnInit,
  ChangeDetectionStrategy,
  Input,
  ChangeDetectorRef
} from "@angular/core";

import { Project } from "../../../project";
import { HelmChartService } from "../../helm-chart.service";
import { HelmChartDetail } from "../../helm-chart.interface.service";
import { finalize } from "rxjs/operators";

@Component({
  selector: "hbr-chart-detail",
  templateUrl: "./chart-detail.component.html",
  styleUrls: ["./chart-detail.component.scss"],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class ChartDetailComponent implements OnInit {
  @Input() projectId: number;
  @Input() project: Project;
  @Input() chartName: string;
  @Input() chartVersion: string;
  @Input() roleName: string;
  @Input() hasSignedIn: boolean;
  @Input() hasProjectAdminRole: boolean;

  loading = true;
  isMember = false;
  chartDetail: HelmChartDetail;
  systemInfo: SystemInfo;

  repoURL = "";

  constructor(
    private errorHandler: ErrorHandler,
    private systemInfoService: SystemInfoService,
    private helmChartService: HelmChartService,
    private cdr: ChangeDetectorRef
  ) { }

  ngOnInit(): void {
    this.systemInfoService.getSystemInfo()
      .subscribe(systemInfo => {
        let scheme = 'http://';
        this.systemInfo = systemInfo;
        if (this.systemInfo.has_ca_root) {
          scheme = 'https://';
        }
        this.repoURL = `${scheme}${this.systemInfo.registry_url}`;
      }, error => this.errorHandler.error(error));
    this.refresh();
  }
  public get chartNameWithVersion() {
    return `${this.chartName}:${this.chartVersion}`;
  }
<commit_msg>Use external_url if exists on Add Repo Command chart details page<commit_after>import { downloadFile, SystemInfoService, SystemInfo, ErrorHandler } from "@harbor/ui";
import {
  Component,
  OnInit,
  ChangeDetectionStrategy,
  Input,
  ChangeDetectorRef
} from "@angular/core";

import { Project } from "../../../project";
import { HelmChartService } from "../../helm-chart.service";
import { HelmChartDetail } from "../../helm-chart.interface.service";
import { finalize } from "rxjs/operators";

@Component({
  selector: "hbr-chart-detail",
  templateUrl: "./chart-detail.component.html",
  styleUrls: ["./chart-detail.component.scss"],
  changeDetection: ChangeDetectionStrategy.OnPush
})
export class ChartDetailComponent implements OnInit {
  @Input() projectId: number;
  @Input() project: Project;
  @Input() chartName: string;
  @Input() chartVersion: string;
  @Input() roleName: string;
  @Input() hasSignedIn: boolean;
  @Input() hasProjectAdminRole: boolean;

  loading = true;
  isMember = false;
  chartDetail: HelmChartDetail;
  systemInfo: SystemInfo;

  repoURL = "";

  constructor(
    private errorHandler: ErrorHandler,
    private systemInfoService: SystemInfoService,
    private helmChartService: HelmChartService,
    private cdr: ChangeDetectorRef
  ) { }

  ngOnInit(): void {
    this.systemInfoService.getSystemInfo()
      .subscribe(systemInfo => {
        this.systemInfo = systemInfo;
        if (this.systemInfo.external_url) {
          this.repoURL = `${this.systemInfo.external_url}`;
        } else {
          let scheme = 'http://';
          if (this.systemInfo.has_ca_root) {
            scheme = 'https://';
          }
          this.repoURL = `${scheme}${this.systemInfo.registry_url}`;
        }
      }, error => this.errorHandler.error(error));
    this.refresh();
  }
  public get chartNameWithVersion() {
    return `${this.chartName}:${this.chartVersion}`;
  }

{'fraction_non_alphanumeric': 0.13872832369942195, 'fraction_numerical': 0.0, 'mean_word_length': 3.6470588235294117, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2282225', 'n_tokens_mistral': 1084, 'n_tokens_neox': 1089, 'n_words': 237}