mirror of
https://github.com/goharbor/harbor.git
synced 2024-12-22 16:48:30 +01:00
Merge pull request #8605 from jwangyangls/fix-Link-to-license-hardcoded
Fix issue width Link to license in the about dialog should not be hardcoded to master
This commit is contained in:
commit
fd6a422bf8
@ -1,7 +1,8 @@
|
||||
FROM node:10.15.0 as nodeportal
|
||||
|
||||
COPY src/portal /portal_src
|
||||
COPY ./docs/swagger.yaml /portal_src
|
||||
COPY ./docs/swagger.yaml /portal_src
|
||||
COPY ./LICENSE /portal_src
|
||||
|
||||
WORKDIR /build_dir
|
||||
|
||||
@ -21,6 +22,7 @@ FROM photon:2.0
|
||||
COPY --from=nodeportal /build_dir/dist /usr/share/nginx/html
|
||||
COPY --from=nodeportal /build_dir/swagger.yaml /usr/share/nginx/html
|
||||
COPY --from=nodeportal /build_dir/swagger.json /usr/share/nginx/html
|
||||
COPY --from=nodeportal /build_dir/LICENSE /usr/share/nginx/html
|
||||
|
||||
COPY make/photon/portal/nginx.conf /etc/nginx/nginx.conf
|
||||
|
||||
|
@ -37,6 +37,7 @@ import { DevCenterComponent } from './dev-center/dev-center.component';
|
||||
import { VulnerabilityPageComponent } from './vulnerability-page/vulnerability-page.component';
|
||||
import { GcPageComponent } from './gc-page/gc-page.component';
|
||||
import { OidcOnboardModule } from './oidc-onboard/oidc-onboard.module';
|
||||
import { LicenseModule } from './license/license.module';
|
||||
registerLocaleData(zh, 'zh-cn');
|
||||
registerLocaleData(es, 'es-es');
|
||||
registerLocaleData(localeFr, 'fr-fr');
|
||||
@ -70,7 +71,8 @@ export function getCurrentLanguage(translateService: TranslateService) {
|
||||
HarborRoutingModule,
|
||||
ConfigurationModule,
|
||||
DeveloperCenterModule,
|
||||
OidcOnboardModule
|
||||
OidcOnboardModule,
|
||||
LicenseModule
|
||||
],
|
||||
exports: [
|
||||
],
|
||||
|
@ -57,6 +57,7 @@ import { ListChartsComponent } from './project/helm-chart/list-charts.component'
|
||||
import { ListChartVersionsComponent } from './project/helm-chart/list-chart-versions/list-chart-versions.component';
|
||||
import { HelmChartDetailComponent } from './project/helm-chart/helm-chart-detail/chart-detail.component';
|
||||
import { OidcOnboardComponent } from './oidc-onboard/oidc-onboard.component';
|
||||
import { LicenseComponent } from './license/license.component';
|
||||
import { SummaryComponent } from './project/summary/summary.component';
|
||||
import { TagRetentionComponent } from "./project/tag-retention/tag-retention.component";
|
||||
|
||||
@ -73,6 +74,10 @@ const harborRoutes: Routes = [
|
||||
component: OidcOnboardComponent,
|
||||
canActivate: [OidcGuard, SignInGuard]
|
||||
},
|
||||
{
|
||||
path: 'license',
|
||||
component: LicenseComponent
|
||||
},
|
||||
{
|
||||
path: 'harbor/sign-in',
|
||||
component: SignInComponent,
|
||||
|
1
src/portal/src/app/license/license.component.html
Normal file
1
src/portal/src/app/license/license.component.html
Normal file
@ -0,0 +1 @@
|
||||
<div class="license" >{{licenseContent}}</div>
|
8
src/portal/src/app/license/license.component.scss
Normal file
8
src/portal/src/app/license/license.component.scss
Normal file
@ -0,0 +1,8 @@
|
||||
.license {
|
||||
display: block;
|
||||
font-family: monospace;
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
margin: 1em 0px;
|
||||
font-size: 1rem;
|
||||
}
|
25
src/portal/src/app/license/license.component.spec.ts
Normal file
25
src/portal/src/app/license/license.component.spec.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { async, ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { LicenseComponent } from './license.component';
|
||||
|
||||
describe('LicenseComponent', () => {
|
||||
let component: LicenseComponent;
|
||||
let fixture: ComponentFixture<LicenseComponent>;
|
||||
|
||||
beforeEach(async(() => {
|
||||
TestBed.configureTestingModule({
|
||||
declarations: [ LicenseComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
}));
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(LicenseComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
25
src/portal/src/app/license/license.component.ts
Normal file
25
src/portal/src/app/license/license.component.ts
Normal file
@ -0,0 +1,25 @@
|
||||
import { Component, OnInit } from '@angular/core';
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { throwError as observableThrowError } from 'rxjs';
|
||||
import { catchError } from 'rxjs/operators';
|
||||
import { Title } from '@angular/platform-browser';
|
||||
@Component({
|
||||
selector: 'app-license',
|
||||
viewProviders: [Title],
|
||||
templateUrl: './license.component.html',
|
||||
styleUrls: ['./license.component.scss']
|
||||
})
|
||||
export class LicenseComponent implements OnInit {
|
||||
|
||||
constructor(
|
||||
private http: HttpClient
|
||||
) { }
|
||||
public licenseContent: any;
|
||||
ngOnInit() {
|
||||
this.http.get("/LICENSE", { responseType: 'text'})
|
||||
.pipe(catchError(error => observableThrowError(error)))
|
||||
.subscribe(json => {
|
||||
this.licenseContent = json;
|
||||
});
|
||||
}
|
||||
}
|
11
src/portal/src/app/license/license.module.ts
Normal file
11
src/portal/src/app/license/license.module.ts
Normal file
@ -0,0 +1,11 @@
|
||||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { LicenseComponent } from './license.component';
|
||||
|
||||
@NgModule({
|
||||
declarations: [LicenseComponent],
|
||||
imports: [
|
||||
CommonModule
|
||||
]
|
||||
})
|
||||
export class LicenseModule { }
|
@ -11,7 +11,7 @@
|
||||
<div *ngIf="!customIntroduction">
|
||||
<p class="p5">{{'ABOUT.COPYRIGHT' | translate}}</p>
|
||||
<p class="p5">
|
||||
<a href="https://raw.githubusercontent.com/goharbor/harbor/master/LICENSE" target="_blank">{{'ABOUT.OPEN_SOURCE_LICENSE' | translate}}</a>
|
||||
<a href="/license" target="_blank">{{'ABOUT.OPEN_SOURCE_LICENSE' | translate}}</a>
|
||||
</p>
|
||||
</div>
|
||||
<div *ngIf="customIntroduction">
|
||||
|
Loading…
Reference in New Issue
Block a user