mirror of
https://github.com/goharbor/harbor.git
synced 2025-01-31 03:51:23 +01:00
Merge pull request #5439 from zhoumeina/pr/fix_new_group_disable
New group button should disabled when login without ldap
This commit is contained in:
commit
3c0bd20d7e
@ -9,22 +9,20 @@
|
|||||||
<link rel="icon" type="image/x-icon" href="favicon.ico?v=2">
|
<link rel="icon" type="image/x-icon" href="favicon.ico?v=2">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body style="overflow-y: hidden;">
|
<body>
|
||||||
<harbor-app>
|
<harbor-app>
|
||||||
<div class="spinner spinner-lg app-loading">
|
<div class="spinner spinner-lg app-loading">
|
||||||
Loading...
|
Loading...
|
||||||
</div>
|
</div>
|
||||||
</harbor-app>
|
</harbor-app>
|
||||||
|
<link rel="stylesheet" href="/static/clarity-ui.min.css">
|
||||||
|
<link rel="stylesheet" href="/static/clarity-icons.min.css">
|
||||||
|
<link rel="stylesheet" href="/static/styles.css">
|
||||||
|
|
||||||
<link rel="stylesheet" href="/static/clarity-ui.min.css">
|
<script src="/static/mutationobserver.min.js"></script>
|
||||||
<link rel="stylesheet" href="/static/clarity-icons.min.css">
|
<script src="/static/custom-elements.min.js"></script>
|
||||||
<link rel="stylesheet" href="/static/styles.css">
|
<script src="/static/clarity-icons.min.js"></script>
|
||||||
|
<script src="/static/build.min.js"></script>
|
||||||
<script src="/static/mutationobserver.min.js"></script>
|
|
||||||
<script src="/static/custom-elements.min.js"></script>
|
|
||||||
<script src="/static/clarity-icons.min.js"></script>
|
|
||||||
|
|
||||||
<script src="/static/build.min.js"></script>
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
@ -64,6 +64,10 @@ export class AppConfigService {
|
|||||||
this.configurations.admiral_endpoint.trim() !== "";
|
this.configurations.admiral_endpoint.trim() !== "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public isLdapMode(): boolean {
|
||||||
|
return this.configurations && this.configurations.auth_mode === 'ldap_auth';
|
||||||
|
}
|
||||||
|
|
||||||
// Return the reconstructed admiral url
|
// Return the reconstructed admiral url
|
||||||
public getAdmiralEndpoint(currentHref: string): string {
|
public getAdmiralEndpoint(currentHref: string): string {
|
||||||
let admiralUrl: string = this.configurations.admiral_endpoint;
|
let admiralUrl: string = this.configurations.admiral_endpoint;
|
||||||
|
@ -16,7 +16,7 @@
|
|||||||
<button class="btn btn-sm btn-secondary" (click)="openAddMemberModal()" [disabled]="!hasProjectAdminRole">
|
<button class="btn btn-sm btn-secondary" (click)="openAddMemberModal()" [disabled]="!hasProjectAdminRole">
|
||||||
<span><clr-icon shape="plus" size="16"></clr-icon> {{'MEMBER.NEW_USER' | translate }}</span>
|
<span><clr-icon shape="plus" size="16"></clr-icon> {{'MEMBER.NEW_USER' | translate }}</span>
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-sm btn-secondary" (click)="openAddGroupModal()" [disabled]="!hasProjectAdminRole">
|
<button class="btn btn-sm btn-secondary" (click)="openAddGroupModal()" [disabled]="!hasProjectAdminRole || !isLdapMode">
|
||||||
<span><clr-icon shape="plus" size="16"></clr-icon> {{'MEMBER.NEW_GROUP' | translate}}</span>
|
<span><clr-icon shape="plus" size="16"></clr-icon> {{'MEMBER.NEW_GROUP' | translate}}</span>
|
||||||
</button>
|
</button>
|
||||||
<clr-dropdown id='member-action' [clrCloseMenuOnItemClick]="false" class="btn btn-sm btn-link" clrDropdownTrigger>
|
<clr-dropdown id='member-action' [clrCloseMenuOnItemClick]="false" class="btn btn-sm btn-link" clrDropdownTrigger>
|
||||||
|
@ -34,6 +34,7 @@ import { SessionUser } from "../../shared/session-user";
|
|||||||
import { AddGroupComponent } from './add-group/add-group.component';
|
import { AddGroupComponent } from './add-group/add-group.component';
|
||||||
import { MemberService } from "./member.service";
|
import { MemberService } from "./member.service";
|
||||||
import { AddMemberComponent } from "./add-member/add-member.component";
|
import { AddMemberComponent } from "./add-member/add-member.component";
|
||||||
|
import {AppConfigService} from "../../app-config.service";
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
templateUrl: "member.component.html",
|
templateUrl: "member.component.html",
|
||||||
@ -57,6 +58,7 @@ export class MemberComponent implements OnInit, OnDestroy {
|
|||||||
isDelete = false;
|
isDelete = false;
|
||||||
isChangeRole = false;
|
isChangeRole = false;
|
||||||
loading = false;
|
loading = false;
|
||||||
|
isLdapMode: boolean = false;
|
||||||
|
|
||||||
isChangingRole = false;
|
isChangingRole = false;
|
||||||
batchChangeRoleInfos = {};
|
batchChangeRoleInfos = {};
|
||||||
@ -76,6 +78,7 @@ export class MemberComponent implements OnInit, OnDestroy {
|
|||||||
private OperateDialogService: ConfirmationDialogService,
|
private OperateDialogService: ConfirmationDialogService,
|
||||||
private session: SessionService,
|
private session: SessionService,
|
||||||
private operationService: OperationService,
|
private operationService: OperationService,
|
||||||
|
private appConfigService: AppConfigService,
|
||||||
private ref: ChangeDetectorRef) {
|
private ref: ChangeDetectorRef) {
|
||||||
|
|
||||||
this.delSub = OperateDialogService.confirmationConfirm$.subscribe(message => {
|
this.delSub = OperateDialogService.confirmationConfirm$.subscribe(message => {
|
||||||
@ -107,6 +110,9 @@ export class MemberComponent implements OnInit, OnDestroy {
|
|||||||
this.hasProjectAdminRole = (<Project>resolverData["projectResolver"]).has_project_admin_role;
|
this.hasProjectAdminRole = (<Project>resolverData["projectResolver"]).has_project_admin_role;
|
||||||
}
|
}
|
||||||
this.retrieve(this.projectId, "");
|
this.retrieve(this.projectId, "");
|
||||||
|
if (this.appConfigService.isLdapMode()) {
|
||||||
|
this.isLdapMode = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
doSearch(searchMember: string) {
|
doSearch(searchMember: string) {
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<link rel="icon" type="image/x-icon" href="favicon.ico?v=2">
|
<link rel="icon" type="image/x-icon" href="favicon.ico?v=2">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body style="overflow-y: hidden;">
|
<body>
|
||||||
<harbor-app>
|
<harbor-app>
|
||||||
<div class="spinner spinner-lg app-loading">
|
<div class="spinner spinner-lg app-loading">
|
||||||
Loading...
|
Loading...
|
||||||
|
@ -1,9 +1,13 @@
|
|||||||
|
body {
|
||||||
|
overflow-y: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
.app-loading {
|
.app-loading {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 50%;
|
top: 0;
|
||||||
left: 50%;
|
left: 0;
|
||||||
margin-top: -54px;
|
right:0;
|
||||||
margin-left: -54px;
|
bottom:0;
|
||||||
width: 108px !important;
|
width: 108px !important;
|
||||||
height: 108px !important;
|
height: 108px !important;
|
||||||
}
|
}
|
||||||
@ -51,7 +55,8 @@
|
|||||||
|
|
||||||
/* set overflow bar style */
|
/* set overflow bar style */
|
||||||
::-webkit-scrollbar {
|
::-webkit-scrollbar {
|
||||||
width: 8px;background:transparent;
|
width: 8px;
|
||||||
|
background:transparent;
|
||||||
}
|
}
|
||||||
::-webkit-scrollbar-track {
|
::-webkit-scrollbar-track {
|
||||||
-webkit-box-shadow: inset 0 0 2px rgba(0,0,0,0.3);
|
-webkit-box-shadow: inset 0 0 2px rgba(0,0,0,0.3);
|
||||||
@ -66,6 +71,6 @@
|
|||||||
background: rgba(255,0,0,0.4);
|
background: rgba(255,0,0,0.4);
|
||||||
}
|
}
|
||||||
.custom-h2 {
|
.custom-h2 {
|
||||||
margin-top: 0px !important;
|
margin-top: 0 !important;
|
||||||
line-height: 24px;
|
line-height: 24px;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user