new version provision
This commit is contained in:
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import format from 'date-fns/format';
|
||||
|
||||
import { BaseEntity } from './BaseEntity';
|
||||
|
||||
export class Connectors extends BaseEntity {
|
||||
connName!: String;
|
||||
justInTime!: Number;
|
||||
filters!: String;
|
||||
scheduler!: String;
|
||||
providerUrl!: String;
|
||||
principal!: String;
|
||||
credentials!: String;
|
||||
|
||||
switch_justInTime: boolean = true;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this.status = 1;
|
||||
this.justInTime = 1;
|
||||
}
|
||||
|
||||
override init(data: any): void {
|
||||
Object.assign(this, data);
|
||||
if (this.status == 1) {
|
||||
this.switch_status = true;
|
||||
} else {
|
||||
this.switch_status = false;
|
||||
}
|
||||
|
||||
if (this.justInTime == 1) {
|
||||
this.switch_justInTime = true;
|
||||
} else {
|
||||
this.switch_justInTime = false;
|
||||
}
|
||||
}
|
||||
|
||||
override trans(): void {
|
||||
if (this.switch_status) {
|
||||
this.status = 1;
|
||||
} else {
|
||||
this.status = 0;
|
||||
}
|
||||
|
||||
if (this.switch_justInTime) {
|
||||
this.justInTime = 1;
|
||||
} else {
|
||||
this.justInTime = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
+27
-59
@@ -5,23 +5,19 @@
|
||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
||||
<div nz-col nzMd="8" nzSm="24">
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="username">{{ 'mxk.users.username' | i18n }}</nz-form-label>
|
||||
<nz-form-label nzFor="conName">{{ 'mxk.history.connector.conName' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input nz-input [(ngModel)]="query.params.username" [ngModelOptions]="{ standalone: true }" name="username" id="username" />
|
||||
<input nz-input [(ngModel)]="query.params.conName" [ngModelOptions]="{ standalone: true }" name="conName"
|
||||
id="conName" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
<div nz-col nzMd="8" nzSm="24">
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="displayName">{{ 'mxk.users.displayName' | i18n }}</nz-form-label>
|
||||
<nz-form-label nzFor="sourceName">{{ 'mxk.history.connector.sourceName' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input
|
||||
nz-input
|
||||
[(ngModel)]="query.params.displayName"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
id="displayName"
|
||||
name="displayName"
|
||||
/>
|
||||
<input nz-input [(ngModel)]="query.params.sourceName" [ngModelOptions]="{ standalone: true }"
|
||||
id="sourceName" name="sourceName" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@@ -29,13 +25,8 @@
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="employeeNumber">{{ 'mxk.users.employeeNumber' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input
|
||||
nz-input
|
||||
[(ngModel)]="query.params.employeeNumber"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
id="employeeNumber"
|
||||
name="employeeNumber"
|
||||
/>
|
||||
<input nz-input [(ngModel)]="query.params.employeeNumber" [ngModelOptions]="{ standalone: true }"
|
||||
id="employeeNumber" name="employeeNumber" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@@ -43,14 +34,9 @@
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="startDatePicker">{{ 'mxk.text.startDate' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<nz-date-picker
|
||||
nzShowTime
|
||||
nzFormat="yyyy-MM-dd HH:mm:ss"
|
||||
[(ngModel)]="query.params.startDatePicker"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
name="startDatePicker"
|
||||
nzPlaceHolder="startDatePicker"
|
||||
></nz-date-picker>
|
||||
<nz-date-picker nzShowTime nzFormat="yyyy-MM-dd HH:mm:ss" [(ngModel)]="query.params.startDatePicker"
|
||||
[ngModelOptions]="{ standalone: true }" name="startDatePicker" nzPlaceHolder="startDatePicker">
|
||||
</nz-date-picker>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@@ -58,54 +44,37 @@
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="endDatePicker">{{ 'mxk.text.endDate' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<nz-date-picker
|
||||
nzShowTime
|
||||
nzFormat="yyyy-MM-dd HH:mm:ss"
|
||||
[(ngModel)]="query.params.endDatePicker"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
name="endDatePicker"
|
||||
nzPlaceHolder="endDatePicker"
|
||||
></nz-date-picker>
|
||||
<nz-date-picker nzShowTime nzFormat="yyyy-MM-dd HH:mm:ss" [(ngModel)]="query.params.endDatePicker"
|
||||
[ngModelOptions]="{ standalone: true }" name="endDatePicker" nzPlaceHolder="endDatePicker">
|
||||
</nz-date-picker>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
|
||||
<div nz-col [nzSpan]="query.expandForm ? 24 : 8" [class.text-right]="query.expandForm">
|
||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' | i18n }}</button>
|
||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' |
|
||||
i18n }}</button>
|
||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm">{{ 'mxk.text.reset' | i18n }}</button>
|
||||
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm">
|
||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button
|
||||
>
|
||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</nz-card>
|
||||
<nz-card>
|
||||
<nz-table
|
||||
#dynamicTable
|
||||
nzTableLayout="auto"
|
||||
nzSize="small"
|
||||
nzShowSizeChanger
|
||||
[nzBordered]="true"
|
||||
[nzData]="query.results.rows"
|
||||
[nzFrontPagination]="false"
|
||||
[nzTotal]="query.results.records"
|
||||
[nzPageSizeOptions]="query.params.pageSizeOptions"
|
||||
[nzPageSize]="query.params.pageSize"
|
||||
[nzPageIndex]="query.params.pageNumber"
|
||||
[nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)"
|
||||
[nzScroll]="{ x: '100%', y: '100%' }"
|
||||
>
|
||||
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzShowSizeChanger [nzBordered]="true"
|
||||
[nzData]="query.results.rows" [nzFrontPagination]="false" [nzTotal]="query.results.records"
|
||||
[nzPageSizeOptions]="query.params.pageSizeOptions" [nzPageSize]="query.params.pageSize"
|
||||
[nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)">
|
||||
<thead>
|
||||
<tr>
|
||||
<th nzAlign="center">{{ 'mxk.history.connector.id' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.history.connector.conName' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.history.connector.conType' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.history.connector.topic' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.history.connector.actionType' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.history.connector.sourceId' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.history.connector.sourceName' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.history.connector.objectId' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.history.connector.objectName' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.history.connector.syncTime' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.history.connector.result' | i18n }}</th>
|
||||
</tr>
|
||||
@@ -116,14 +85,13 @@
|
||||
<span>{{ data.id }}</span>
|
||||
</td>
|
||||
<td nzAlign="left">{{ data.conName }}</td>
|
||||
<td nzAlign="left">{{ data.conType }}</td>
|
||||
<td nzAlign="left">{{ data.topic }}</td>
|
||||
<td nzAlign="left">{{ data.actionType }}</td>
|
||||
<td nzAlign="left">{{ data.sourceId }}</td>
|
||||
<td nzAlign="left">{{ data.syncName }}</td>
|
||||
<td nzAlign="left">{{ data.sourceName }}</td>
|
||||
<td nzAlign="left">{{ data.objectName }}</td>
|
||||
<td nzAlign="left">{{ data.syncTime }}</td>
|
||||
<td nzAlign="left">{{ data.result }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</nz-table>
|
||||
</nz-card>
|
||||
</nz-card>
|
||||
+7
-8
@@ -1,19 +1,18 @@
|
||||
/*
|
||||
* Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
|
||||
*
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
@@ -33,8 +32,8 @@ import { HistoryService } from '../../../service/history.service';
|
||||
export class AuditConnectorComponent implements OnInit {
|
||||
query: {
|
||||
params: {
|
||||
username: String;
|
||||
displayName: String;
|
||||
conName: String;
|
||||
sourceName: String;
|
||||
employeeNumber: String;
|
||||
startDate: String;
|
||||
endDate: String;
|
||||
@@ -53,8 +52,8 @@ export class AuditConnectorComponent implements OnInit {
|
||||
tableLoading: boolean;
|
||||
} = {
|
||||
params: {
|
||||
username: '',
|
||||
displayName: '',
|
||||
conName: '',
|
||||
sourceName: '',
|
||||
employeeNumber: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
|
||||
+21
-51
@@ -7,7 +7,8 @@
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="username">{{ 'mxk.users.username' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input nz-input [(ngModel)]="query.params.username" [ngModelOptions]="{ standalone: true }" name="username" id="username" />
|
||||
<input nz-input [(ngModel)]="query.params.username" [ngModelOptions]="{ standalone: true }" name="username"
|
||||
id="username" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@@ -15,13 +16,8 @@
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="displayName">{{ 'mxk.users.displayName' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input
|
||||
nz-input
|
||||
[(ngModel)]="query.params.displayName"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
id="displayName"
|
||||
name="displayName"
|
||||
/>
|
||||
<input nz-input [(ngModel)]="query.params.displayName" [ngModelOptions]="{ standalone: true }"
|
||||
id="displayName" name="displayName" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@@ -29,13 +25,8 @@
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="employeeNumber">{{ 'mxk.users.employeeNumber' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input
|
||||
nz-input
|
||||
[(ngModel)]="query.params.employeeNumber"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
id="employeeNumber"
|
||||
name="employeeNumber"
|
||||
/>
|
||||
<input nz-input [(ngModel)]="query.params.employeeNumber" [ngModelOptions]="{ standalone: true }"
|
||||
id="employeeNumber" name="employeeNumber" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@@ -43,14 +34,9 @@
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="startDatePicker">{{ 'mxk.text.startDate' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<nz-date-picker
|
||||
nzShowTime
|
||||
nzFormat="yyyy-MM-dd HH:mm:ss"
|
||||
[(ngModel)]="query.params.startDatePicker"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
name="startDatePicker"
|
||||
nzPlaceHolder="startDatePicker"
|
||||
></nz-date-picker>
|
||||
<nz-date-picker nzShowTime nzFormat="yyyy-MM-dd HH:mm:ss" [(ngModel)]="query.params.startDatePicker"
|
||||
[ngModelOptions]="{ standalone: true }" name="startDatePicker" nzPlaceHolder="startDatePicker">
|
||||
</nz-date-picker>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@@ -58,45 +44,29 @@
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="endDatePicker">{{ 'mxk.text.endDate' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<nz-date-picker
|
||||
nzShowTime
|
||||
nzFormat="yyyy-MM-dd HH:mm:ss"
|
||||
[(ngModel)]="query.params.endDatePicker"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
name="endDatePicker"
|
||||
nzPlaceHolder="endDatePicker"
|
||||
></nz-date-picker>
|
||||
<nz-date-picker nzShowTime nzFormat="yyyy-MM-dd HH:mm:ss" [(ngModel)]="query.params.endDatePicker"
|
||||
[ngModelOptions]="{ standalone: true }" name="endDatePicker" nzPlaceHolder="endDatePicker">
|
||||
</nz-date-picker>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
|
||||
<div nz-col [nzSpan]="query.expandForm ? 24 : 8" [class.text-right]="query.expandForm">
|
||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' | i18n }}</button>
|
||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' |
|
||||
i18n }}</button>
|
||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm">{{ 'mxk.text.reset' | i18n }}</button>
|
||||
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm">
|
||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button
|
||||
>
|
||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</nz-card>
|
||||
<nz-card>
|
||||
<nz-table
|
||||
#dynamicTable
|
||||
nzTableLayout="auto"
|
||||
nzSize="small"
|
||||
nzShowSizeChanger
|
||||
[nzBordered]="true"
|
||||
[nzData]="query.results.rows"
|
||||
[nzFrontPagination]="false"
|
||||
[nzTotal]="query.results.records"
|
||||
[nzPageSizeOptions]="query.params.pageSizeOptions"
|
||||
[nzPageSize]="query.params.pageSize"
|
||||
[nzPageIndex]="query.params.pageNumber"
|
||||
[nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)"
|
||||
[nzScroll]="{ x: '100%', y: '100%' }"
|
||||
>
|
||||
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzShowSizeChanger [nzBordered]="true"
|
||||
[nzData]="query.results.rows" [nzFrontPagination]="false" [nzTotal]="query.results.records"
|
||||
[nzPageSizeOptions]="query.params.pageSizeOptions" [nzPageSize]="query.params.pageSize"
|
||||
[nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)">
|
||||
<thead>
|
||||
<tr>
|
||||
<th nzAlign="center">{{ 'mxk.history.login.sessionId' | i18n }}</th>
|
||||
@@ -128,4 +98,4 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</nz-table>
|
||||
</nz-card>
|
||||
</nz-card>
|
||||
+23
-53
@@ -5,23 +5,19 @@
|
||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
||||
<div nz-col nzMd="8" nzSm="24">
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="username">{{ 'mxk.users.username' | i18n }}</nz-form-label>
|
||||
<nz-form-label nzFor="syncName">{{ 'mxk.history.synchronizer.syncName' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input nz-input [(ngModel)]="query.params.username" [ngModelOptions]="{ standalone: true }" name="username" id="username" />
|
||||
<input nz-input [(ngModel)]="query.params.syncName" [ngModelOptions]="{ standalone: true }" name="syncName"
|
||||
id="syncName" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
<div nz-col nzMd="8" nzSm="24">
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="displayName">{{ 'mxk.users.displayName' | i18n }}</nz-form-label>
|
||||
<nz-form-label nzFor="objectName">{{ 'mxk.history.synchronizer.objectName' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input
|
||||
nz-input
|
||||
[(ngModel)]="query.params.displayName"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
id="displayName"
|
||||
name="displayName"
|
||||
/>
|
||||
<input nz-input [(ngModel)]="query.params.objectName" [ngModelOptions]="{ standalone: true }"
|
||||
id="objectName" name="objectName" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@@ -29,13 +25,8 @@
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="employeeNumber">{{ 'mxk.users.employeeNumber' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input
|
||||
nz-input
|
||||
[(ngModel)]="query.params.employeeNumber"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
id="employeeNumber"
|
||||
name="employeeNumber"
|
||||
/>
|
||||
<input nz-input [(ngModel)]="query.params.employeeNumber" [ngModelOptions]="{ standalone: true }"
|
||||
id="employeeNumber" name="employeeNumber" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@@ -43,14 +34,9 @@
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="startDatePicker">{{ 'mxk.text.startDate' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<nz-date-picker
|
||||
nzShowTime
|
||||
nzFormat="yyyy-MM-dd HH:mm:ss"
|
||||
[(ngModel)]="query.params.startDatePicker"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
name="startDatePicker"
|
||||
nzPlaceHolder="startDatePicker"
|
||||
></nz-date-picker>
|
||||
<nz-date-picker nzShowTime nzFormat="yyyy-MM-dd HH:mm:ss" [(ngModel)]="query.params.startDatePicker"
|
||||
[ngModelOptions]="{ standalone: true }" name="startDatePicker" nzPlaceHolder="startDatePicker">
|
||||
</nz-date-picker>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
@@ -58,45 +44,29 @@
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="endDatePicker">{{ 'mxk.text.endDate' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<nz-date-picker
|
||||
nzShowTime
|
||||
nzFormat="yyyy-MM-dd HH:mm:ss"
|
||||
[(ngModel)]="query.params.endDatePicker"
|
||||
[ngModelOptions]="{ standalone: true }"
|
||||
name="endDatePicker"
|
||||
nzPlaceHolder="endDatePicker"
|
||||
></nz-date-picker>
|
||||
<nz-date-picker nzShowTime nzFormat="yyyy-MM-dd HH:mm:ss" [(ngModel)]="query.params.endDatePicker"
|
||||
[ngModelOptions]="{ standalone: true }" name="endDatePicker" nzPlaceHolder="endDatePicker">
|
||||
</nz-date-picker>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
|
||||
<div nz-col [nzSpan]="query.expandForm ? 24 : 8" [class.text-right]="query.expandForm">
|
||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' | i18n }}</button>
|
||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{ 'mxk.text.query' |
|
||||
i18n }}</button>
|
||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm">{{ 'mxk.text.reset' | i18n }}</button>
|
||||
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm">
|
||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button
|
||||
>
|
||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</nz-card>
|
||||
<nz-card>
|
||||
<nz-table
|
||||
#dynamicTable
|
||||
nzTableLayout="auto"
|
||||
nzSize="small"
|
||||
nzShowSizeChanger
|
||||
[nzBordered]="true"
|
||||
[nzData]="query.results.rows"
|
||||
[nzFrontPagination]="false"
|
||||
[nzTotal]="query.results.records"
|
||||
[nzPageSizeOptions]="query.params.pageSizeOptions"
|
||||
[nzPageSize]="query.params.pageSize"
|
||||
[nzPageIndex]="query.params.pageNumber"
|
||||
[nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)"
|
||||
[nzScroll]="{ x: '100%', y: '100%' }"
|
||||
>
|
||||
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzShowSizeChanger [nzBordered]="true"
|
||||
[nzData]="query.results.rows" [nzFrontPagination]="false" [nzTotal]="query.results.records"
|
||||
[nzPageSizeOptions]="query.params.pageSizeOptions" [nzPageSize]="query.params.pageSize"
|
||||
[nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)">
|
||||
<thead>
|
||||
<tr>
|
||||
<th nzAlign="center">{{ 'mxk.history.synchronizer.syncId' | i18n }}</th>
|
||||
@@ -122,4 +92,4 @@
|
||||
</tr>
|
||||
</tbody>
|
||||
</nz-table>
|
||||
</nz-card>
|
||||
</nz-card>
|
||||
+7
-8
@@ -1,19 +1,18 @@
|
||||
/*
|
||||
* Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
|
||||
*
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
@@ -33,8 +32,8 @@ import { HistoryService } from '../../../service/history.service';
|
||||
export class AuditSynchronizerComponent implements OnInit {
|
||||
query: {
|
||||
params: {
|
||||
username: String;
|
||||
displayName: String;
|
||||
syncName: String;
|
||||
objectName: String;
|
||||
employeeNumber: String;
|
||||
startDate: String;
|
||||
endDate: String;
|
||||
@@ -53,8 +52,8 @@ export class AuditSynchronizerComponent implements OnInit {
|
||||
tableLoading: boolean;
|
||||
} = {
|
||||
params: {
|
||||
username: '',
|
||||
displayName: '',
|
||||
syncName: '',
|
||||
objectName: '',
|
||||
employeeNumber: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
|
||||
@@ -1,19 +1,18 @@
|
||||
/*
|
||||
* Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
|
||||
*
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { NgModule } from '@angular/core';
|
||||
@@ -34,6 +33,8 @@ import { SelectAccountsStrategyComponent } from './accounts-strategy/select-acco
|
||||
import { AdapterEditerComponent } from './adapters/adapter-editer/adapter-editer.component';
|
||||
import { AdaptersComponent } from './adapters/adapters.component';
|
||||
import { SelectAdaptersComponent } from './adapters/select-adapters/select-adapters.component';
|
||||
import { ConnectorEditerComponent } from './connectors/connector-editer/connector-editer.component';
|
||||
import { ConnectorsComponent } from './connectors/connectors.component';
|
||||
import { EmailSendersComponent } from './email-senders/email-senders.component';
|
||||
import { InstitutionsComponent } from './institutions/institutions.component';
|
||||
import { LdapContextComponent } from './ldap-context/ldap-context.component';
|
||||
@@ -74,6 +75,10 @@ const routes: Routes = [
|
||||
path: 'synchronizers',
|
||||
component: SynchronizersComponent
|
||||
},
|
||||
{
|
||||
path: 'connectors',
|
||||
component: ConnectorsComponent
|
||||
},
|
||||
{
|
||||
path: 'accountsstrategys',
|
||||
component: AccountsStrategyComponent
|
||||
@@ -108,7 +113,9 @@ const COMPONENTS = [PasswordPolicyComponent, EmailSendersComponent, LdapContextC
|
||||
InstitutionsComponent,
|
||||
NoticesComponent,
|
||||
SelectAccountsStrategyComponent,
|
||||
SelectAdaptersComponent
|
||||
SelectAdaptersComponent,
|
||||
ConnectorsComponent,
|
||||
ConnectorEditerComponent
|
||||
],
|
||||
imports: [SharedModule, CommonModule, RouterModule.forChild(routes)],
|
||||
exports: [RouterModule]
|
||||
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
<div *nzModalTitle> {{ isEdit ? ('mxk.text.edit' | i18n) : ('mxk.text.add' | i18n) }} </div>
|
||||
<div>
|
||||
<form nz-form [formGroup]="formGroup" (ngSubmit)="onSubmit($event)" se-container="1">
|
||||
<nz-form-item>
|
||||
<nz-form-label [nzMd]="6" nzFor="id">{{ 'mxk.text.id' | i18n }}</nz-form-label>
|
||||
<nz-form-control [nzMd]="18" nzErrorTip="The input is not valid id!">
|
||||
<input [(ngModel)]="form.model.id" disabled="{{ isEdit }}" [ngModelOptions]="{ standalone: true }"
|
||||
nz-input name="id" id="id" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
<nz-form-item>
|
||||
<nz-form-label [nzMd]="6" nzFor="id">{{ 'mxk.connectors.connName' | i18n }}</nz-form-label>
|
||||
<nz-form-control [nzMd]="18" nzErrorTip="The input is not valid connName!">
|
||||
<input [(ngModel)]="form.model.connName" [ngModelOptions]="{ standalone: true }" nz-input
|
||||
name="connName" id="connName" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
<nz-form-item>
|
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="justInTime">{{ 'mxk.connectors.justInTime' | i18n }}
|
||||
</nz-form-label>
|
||||
<nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="The input is not valid justInTime!">
|
||||
<nz-switch [(ngModel)]="form.model.switch_justInTime" [ngModelOptions]="{ standalone: true }"
|
||||
name="justInTime" [nzCheckedChildren]="checkedTemplateJustInTime"
|
||||
[nzUnCheckedChildren]="unCheckedTemplateJustInTime">
|
||||
</nz-switch>
|
||||
<ng-template #checkedTemplateJustInTime><i nz-icon nzType="check"></i></ng-template>
|
||||
<ng-template #unCheckedTemplateJustInTime><i nz-icon nzType="close"></i></ng-template>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
<nz-form-item *ngIf="!form.model.switch_justInTime">
|
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzFor="scheduler">{{ 'mxk.connectors.scheduler' | i18n }}
|
||||
</nz-form-label>
|
||||
<nz-form-control [nzSm]="18" [nzMd]="18" [nzXs]="36" [nzXl]="48" nzErrorTip="The input is not valid icon!">
|
||||
<input [(ngModel)]="form.model.scheduler" [ngModelOptions]="{ standalone: true }" nz-input
|
||||
name="scheduler" placeholder="0 0 12 * * ?" id="scheduler" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
<nz-form-item>
|
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="providerUrl">{{ 'mxk.connectors.providerUrl' | i18n
|
||||
}} </nz-form-label>
|
||||
<nz-form-control [nzSm]="18" [nzMd]="18" [nzXs]="36" [nzXl]="48"
|
||||
nzErrorTip="The input is not valid providerUrl!">
|
||||
<input [(ngModel)]="form.model.providerUrl" [ngModelOptions]="{ standalone: true }" nz-input
|
||||
name="providerUrl" id="providerUrl" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
<nz-form-item>
|
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="principal">{{ 'mxk.connectors.principal' | i18n }}
|
||||
</nz-form-label>
|
||||
<nz-form-control [nzSm]="18" [nzMd]="18" [nzXs]="36" [nzXl]="48"
|
||||
nzErrorTip="The input is not valid principal!">
|
||||
<input [(ngModel)]="form.model.principal" [ngModelOptions]="{ standalone: true }" nz-input
|
||||
name="principal" id="principal" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
<nz-form-item>
|
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="credentials">{{ 'mxk.connectors.credentials' | i18n
|
||||
}} </nz-form-label>
|
||||
<nz-form-control [nzSm]="18" [nzMd]="18" [nzXs]="36" [nzXl]="48"
|
||||
nzErrorTip="The input is not valid credentials!">
|
||||
<input type="password" [(ngModel)]="form.model.credentials" [ngModelOptions]="{ standalone: true }"
|
||||
nz-input name="credentials" id="credentials" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
<nz-form-item>
|
||||
<nz-form-label [nzSm]="6" [nzXs]="24" nzRequired nzFor="status">{{ 'mxk.text.status' | i18n }}
|
||||
</nz-form-label>
|
||||
<nz-form-control [nzSm]="14" [nzXs]="24" nzErrorTip="The input is not valid status!">
|
||||
<nz-switch [(ngModel)]="form.model.switch_status" [ngModelOptions]="{ standalone: true }" name="status"
|
||||
[nzCheckedChildren]="checkedTemplate" [nzUnCheckedChildren]="unCheckedTemplate"></nz-switch>
|
||||
<ng-template #checkedTemplate><i nz-icon nzType="check"></i></ng-template>
|
||||
<ng-template #unCheckedTemplate><i nz-icon nzType="close"></i></ng-template>
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div *nzModalFooter>
|
||||
<button nz-button nzType="default" (click)="onClose($event)">{{ 'mxk.text.close' | i18n }}</button>
|
||||
<button nz-button nzType="primary" (click)="onSubmit($event)">{{ 'mxk.text.submit' | i18n }}</button>
|
||||
</div>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ConnectorEditerComponent } from './connector-editer.component';
|
||||
|
||||
describe('ConnectorEditerComponent', () => {
|
||||
let component: ConnectorEditerComponent;
|
||||
let fixture: ComponentFixture<ConnectorEditerComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ ConnectorEditerComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ConnectorEditerComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
+91
@@ -0,0 +1,91 @@
|
||||
/*
|
||||
* Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { Component, ChangeDetectorRef, Input, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { I18NService } from '@core';
|
||||
import { _HttpClient, ALAIN_I18N_TOKEN, SettingsService } from '@delon/theme';
|
||||
import format from 'date-fns/format';
|
||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
|
||||
import { Connectors } from '../../../../entity/Connectors';
|
||||
import { ConnectorsService } from '../../../../service/connectors.service';
|
||||
|
||||
@Component({
|
||||
selector: 'app-connector-editer',
|
||||
templateUrl: './connector-editer.component.html',
|
||||
styleUrls: ['./connector-editer.component.less'],
|
||||
styles: [
|
||||
`
|
||||
nz-form-item {
|
||||
width: 100%;
|
||||
}
|
||||
`
|
||||
]
|
||||
})
|
||||
export class ConnectorEditerComponent implements OnInit {
|
||||
@Input() id?: String;
|
||||
@Input() isEdit?: boolean;
|
||||
form: {
|
||||
submitting: boolean;
|
||||
model: Connectors;
|
||||
} = {
|
||||
submitting: false,
|
||||
model: new Connectors()
|
||||
};
|
||||
|
||||
formGroup: FormGroup = new FormGroup({});
|
||||
|
||||
constructor(
|
||||
private modalRef: NzModalRef,
|
||||
private connectorsService: ConnectorsService,
|
||||
private fb: FormBuilder,
|
||||
private msg: NzMessageService,
|
||||
@Inject(ALAIN_I18N_TOKEN) private i18n: I18NService,
|
||||
private cdr: ChangeDetectorRef
|
||||
) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
if (this.isEdit) {
|
||||
this.connectorsService.get(`${this.id}`).subscribe(res => {
|
||||
this.form.model.init(res.data);
|
||||
this.cdr.detectChanges();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
onClose(e: MouseEvent): void {
|
||||
e.preventDefault();
|
||||
this.modalRef.destroy({ refresh: false });
|
||||
}
|
||||
|
||||
onSubmit(e: MouseEvent): void {
|
||||
e.preventDefault();
|
||||
this.form.submitting = true;
|
||||
this.form.model.trans();
|
||||
(this.isEdit ? this.connectorsService.update(this.form.model) : this.connectorsService.add(this.form.model)).subscribe(res => {
|
||||
if (res.code == 0) {
|
||||
this.msg.success(this.i18n.fanyi(this.isEdit ? 'mxk.alert.update.success' : 'mxk.alert.add.success'));
|
||||
} else {
|
||||
this.msg.error(this.i18n.fanyi(this.isEdit ? 'mxk.alert.update.error' : 'mxk.alert.add.error'));
|
||||
}
|
||||
this.form.submitting = false;
|
||||
this.modalRef.destroy({ refresh: true });
|
||||
this.cdr.detectChanges();
|
||||
});
|
||||
}
|
||||
}
|
||||
+75
@@ -0,0 +1,75 @@
|
||||
<page-header> </page-header>
|
||||
|
||||
<nz-card [nzBordered]="false">
|
||||
<form nz-form [nzLayout]="'inline'" (ngSubmit)="onSearch()" class="search__form">
|
||||
<div nz-row [nzGutter]="{ xs: 8, sm: 8, md: 8, lg: 24, xl: 48, xxl: 48 }">
|
||||
<div nz-col nzMd="16" nzSm="24">
|
||||
<nz-form-item>
|
||||
<nz-form-label nzFor="connName">{{ 'mxk.connectors.connName' | i18n }}</nz-form-label>
|
||||
<nz-form-control>
|
||||
<input nz-input [(ngModel)]="query.params.connName" [ngModelOptions]="{ standalone: true }"
|
||||
name="connName" placeholder="" id="connName" />
|
||||
</nz-form-control>
|
||||
</nz-form-item>
|
||||
</div>
|
||||
|
||||
<div nz-col [nzSpan]="query.expandForm ? 24 : 8" [class.text-right]="query.expandForm">
|
||||
<button nz-button type="submit" [nzType]="'primary'" [nzLoading]="query.submitLoading">{{
|
||||
'mxk.text.query' | i18n }}</button>
|
||||
<button nz-button type="reset" (click)="onReset()" class="mx-sm" style="display: none">{{
|
||||
'mxk.text.reset' | i18n }}</button>
|
||||
<button nz-button (click)="query.expandForm = !query.expandForm" class="mx-sm" style="display: none">
|
||||
{{ query.expandForm ? ('mxk.text.collapse' | i18n) : ('mxk.text.expand' | i18n) }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</nz-card>
|
||||
<nz-card>
|
||||
<div nz-col [nzSpan]="24" class="table-list-toolbar">
|
||||
<button nz-button type="button" [nzType]="'primary'" (click)="onAdd($event)">{{ 'mxk.text.add' | i18n
|
||||
}}</button>
|
||||
<button nz-button type="button" (click)="onBatchDelete($event)" [nzType]="'primary'" nzDanger class="mx-sm">{{
|
||||
'mxk.text.delete' | i18n
|
||||
}}</button>
|
||||
</div>
|
||||
<nz-table #dynamicTable nzTableLayout="auto" nzSize="small" nzBordered nzShowSizeChanger
|
||||
[nzData]="query.results.rows" [nzFrontPagination]="false" [nzTotal]="query.results.records"
|
||||
[nzPageSizeOptions]="query.params.pageSizeOptions" [nzPageSize]="query.params.pageSize"
|
||||
[nzPageIndex]="query.params.pageNumber" [nzLoading]="this.query.tableLoading"
|
||||
(nzQueryParams)="onQueryParamsChange($event)" nzWidth="100%">
|
||||
<thead>
|
||||
<tr>
|
||||
<th [nzChecked]="query.checked" [nzIndeterminate]="query.indeterminate"
|
||||
(nzCheckedChange)="onTableAllChecked($event)"></th>
|
||||
<th nzAlign="center" style="display: none">Id</th>
|
||||
<th nzAlign="center">{{ 'mxk.connectors.connName' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.connectors.justInTime' | i18n }}</th>
|
||||
<th nzAlign="center">{{ 'mxk.text.status' | i18n }}</th>
|
||||
<th nzAlign="center"><a>{{ 'mxk.text.action' | i18n }}</a></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let data of query.results.rows">
|
||||
<td [nzChecked]="query.tableCheckedId.has(data.id)" [nzDisabled]="data.disabled"
|
||||
(nzCheckedChange)="onTableItemChecked(data.id, $event)"></td>
|
||||
<td nzAlign="left" style="display: none">
|
||||
<span>{{ data.id }}</span>
|
||||
</td>
|
||||
|
||||
<td nzAlign="left"> {{ data.connName }}</td>
|
||||
<td nzAlign="center" *ngIf="data.justInTime == 1">{{ 'mxk.text.yes' | i18n }}</td>
|
||||
<td nzAlign="center" *ngIf="data.justInTime == 0">{{ 'mxk.text.no' | i18n }}</td>
|
||||
<td nzAlign="center"> <i *ngIf="data.status == 1" nz-icon nzType="check-circle" nzTheme="fill"
|
||||
style="color: green"></i></td>
|
||||
<td nzAlign="left" nzBreakWord="false">
|
||||
<div nz-col>
|
||||
<button nz-button type="button" (click)="onEdit($event, data.id)" style="float: left">{{
|
||||
'mxk.text.edit' | i18n }}</button>
|
||||
<button nz-button type="button" (click)="onDelete($event, data.id)" nzDanger>{{
|
||||
'mxk.text.delete' | i18n }}</button>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</nz-table>
|
||||
</nz-card>
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
import { ComponentFixture, TestBed } from '@angular/core/testing';
|
||||
|
||||
import { ConnectorsComponent } from './connectors.component';
|
||||
|
||||
describe('ConnectorsComponent', () => {
|
||||
let component: ConnectorsComponent;
|
||||
let fixture: ComponentFixture<ConnectorsComponent>;
|
||||
|
||||
beforeEach(async () => {
|
||||
await TestBed.configureTestingModule({
|
||||
declarations: [ ConnectorsComponent ]
|
||||
})
|
||||
.compileComponents();
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
fixture = TestBed.createComponent(ConnectorsComponent);
|
||||
component = fixture.componentInstance;
|
||||
fixture.detectChanges();
|
||||
});
|
||||
|
||||
it('should create', () => {
|
||||
expect(component).toBeTruthy();
|
||||
});
|
||||
});
|
||||
+203
@@ -0,0 +1,203 @@
|
||||
import { ChangeDetectionStrategy, ViewContainerRef, ChangeDetectorRef, Component, OnInit, Inject } from '@angular/core';
|
||||
import { FormBuilder, FormGroup, Validators } from '@angular/forms';
|
||||
import { I18NService } from '@core';
|
||||
import { _HttpClient, ALAIN_I18N_TOKEN, SettingsService } from '@delon/theme';
|
||||
import { format, addDays } from 'date-fns';
|
||||
import { NzSafeAny } from 'ng-zorro-antd/core/types';
|
||||
import { NzMessageService } from 'ng-zorro-antd/message';
|
||||
import { NzModalRef, NzModalService } from 'ng-zorro-antd/modal';
|
||||
import { NzTableQueryParams } from 'ng-zorro-antd/table';
|
||||
|
||||
import { ConnectorsService } from '../../../service/connectors.service';
|
||||
import { set2String } from '../../../shared/index';
|
||||
import { ConnectorEditerComponent } from './connector-editer/connector-editer.component';
|
||||
|
||||
@Component({
|
||||
selector: 'app-connectors',
|
||||
templateUrl: './connectors.component.html',
|
||||
styleUrls: ['./connectors.component.less']
|
||||
})
|
||||
export class ConnectorsComponent implements OnInit {
|
||||
query: {
|
||||
params: {
|
||||
connName: String;
|
||||
displayName: String;
|
||||
protocol: String;
|
||||
startDate: String;
|
||||
endDate: String;
|
||||
startDatePicker: Date;
|
||||
endDatePicker: Date;
|
||||
pageSize: number;
|
||||
pageNumber: number;
|
||||
pageSizeOptions: number[];
|
||||
};
|
||||
results: {
|
||||
records: number;
|
||||
rows: NzSafeAny[];
|
||||
};
|
||||
expandForm: Boolean;
|
||||
submitLoading: boolean;
|
||||
tableLoading: boolean;
|
||||
tableCheckedId: Set<String>;
|
||||
indeterminate: boolean;
|
||||
checked: boolean;
|
||||
} = {
|
||||
params: {
|
||||
connName: '',
|
||||
displayName: '',
|
||||
protocol: '',
|
||||
startDate: '',
|
||||
endDate: '',
|
||||
startDatePicker: addDays(new Date(), -30),
|
||||
endDatePicker: new Date(),
|
||||
pageSize: 10,
|
||||
pageNumber: 1,
|
||||
pageSizeOptions: [10, 20, 50]
|
||||
},
|
||||
results: {
|
||||
records: 0,
|
||||
rows: []
|
||||
},
|
||||
expandForm: false,
|
||||
submitLoading: false,
|
||||
tableLoading: false,
|
||||
tableCheckedId: new Set<String>(),
|
||||
indeterminate: false,
|
||||
checked: false
|
||||
};
|
||||
|
||||
constructor(
|
||||
private modalService: NzModalService,
|
||||
private connectorsService: ConnectorsService,
|
||||
private viewContainerRef: ViewContainerRef,
|
||||
private fb: FormBuilder,
|
||||
private msg: NzMessageService,
|
||||
@Inject(ALAIN_I18N_TOKEN) private i18n: I18NService,
|
||||
private cdr: ChangeDetectorRef
|
||||
) { }
|
||||
|
||||
ngOnInit(): void {
|
||||
this.fetch();
|
||||
}
|
||||
|
||||
onQueryParamsChange(tableQueryParams: NzTableQueryParams): void {
|
||||
this.query.params.pageNumber = tableQueryParams.pageIndex;
|
||||
this.query.params.pageSize = tableQueryParams.pageSize;
|
||||
this.fetch();
|
||||
}
|
||||
|
||||
onSearch(): void {
|
||||
this.fetch();
|
||||
}
|
||||
|
||||
onReset(): void { }
|
||||
|
||||
onBatchDelete(e: MouseEvent): void {
|
||||
e.preventDefault();
|
||||
this.connectorsService.delete(set2String(this.query.tableCheckedId)).subscribe(res => {
|
||||
if (res.code == 0) {
|
||||
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
||||
this.fetch();
|
||||
} else {
|
||||
this.msg.error(this.i18n.fanyi('mxk.alert.delete.error'));
|
||||
}
|
||||
this.cdr.detectChanges();
|
||||
});
|
||||
}
|
||||
|
||||
onAdd(e: MouseEvent): void {
|
||||
e.preventDefault();
|
||||
const modal = this.modalService.create({
|
||||
nzContent: ConnectorEditerComponent,
|
||||
nzViewContainerRef: this.viewContainerRef,
|
||||
nzComponentParams: {
|
||||
isEdit: false,
|
||||
id: ''
|
||||
},
|
||||
nzOnOk: () => new Promise(resolve => setTimeout(resolve, 1000))
|
||||
});
|
||||
// Return a result when closed
|
||||
modal.afterClose.subscribe(result => {
|
||||
if (result.refresh) {
|
||||
this.fetch();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onEdit(e: MouseEvent, editId: String): void {
|
||||
e.preventDefault();
|
||||
const modal = this.modalService.create({
|
||||
nzContent: ConnectorEditerComponent,
|
||||
nzViewContainerRef: this.viewContainerRef,
|
||||
nzComponentParams: {
|
||||
isEdit: true,
|
||||
id: editId
|
||||
},
|
||||
nzOnOk: () => new Promise(resolve => setTimeout(resolve, 1000))
|
||||
});
|
||||
// Return a result when closed
|
||||
modal.afterClose.subscribe(result => {
|
||||
if (result.refresh) {
|
||||
this.fetch();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onDelete(e: MouseEvent, deleteId: String): void {
|
||||
e.preventDefault();
|
||||
this.connectorsService.delete(deleteId).subscribe(res => {
|
||||
if (res.code == 0) {
|
||||
this.msg.success(this.i18n.fanyi('mxk.alert.delete.success'));
|
||||
this.fetch();
|
||||
} else {
|
||||
this.msg.error(this.i18n.fanyi('mxk.alert.delete.error'));
|
||||
}
|
||||
this.cdr.detectChanges();
|
||||
});
|
||||
}
|
||||
|
||||
fetch(): void {
|
||||
this.query.submitLoading = true;
|
||||
this.query.tableLoading = true;
|
||||
this.query.indeterminate = false;
|
||||
this.query.checked = false;
|
||||
this.query.tableCheckedId.clear();
|
||||
if (this.query.expandForm) {
|
||||
this.query.params.endDate = format(this.query.params.endDatePicker, 'yyyy-MM-dd HH:mm:ss');
|
||||
this.query.params.startDate = format(this.query.params.startDatePicker, 'yyyy-MM-dd HH:mm:ss');
|
||||
} else {
|
||||
this.query.params.endDate = '';
|
||||
this.query.params.startDate = '';
|
||||
}
|
||||
this.connectorsService.fetch(this.query.params).subscribe(res => {
|
||||
this.query.results = res.data;
|
||||
this.query.submitLoading = false;
|
||||
this.query.tableLoading = false;
|
||||
this.cdr.detectChanges();
|
||||
});
|
||||
}
|
||||
|
||||
updateTableCheckedSet(id: String, checked: boolean): void {
|
||||
if (checked) {
|
||||
this.query.tableCheckedId.add(id);
|
||||
} else {
|
||||
this.query.tableCheckedId.delete(id);
|
||||
}
|
||||
}
|
||||
|
||||
refreshTableCheckedStatus(): void {
|
||||
const listOfEnabledData = this.query.results.rows.filter(({ disabled }) => !disabled);
|
||||
this.query.checked = listOfEnabledData.every(({ id }) => this.query.tableCheckedId.has(id));
|
||||
this.query.indeterminate = listOfEnabledData.some(({ id }) => this.query.tableCheckedId.has(id)) && !this.query.checked;
|
||||
}
|
||||
|
||||
onTableItemChecked(id: String, checked: boolean): void {
|
||||
this.updateTableCheckedSet(id, checked);
|
||||
this.refreshTableCheckedStatus();
|
||||
}
|
||||
|
||||
onTableAllChecked(checked: boolean): void {
|
||||
this.query.results.rows.filter(({ disabled }) => !disabled).forEach(({ id }) => this.updateTableCheckedSet(id, checked));
|
||||
this.refreshTableCheckedStatus();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
import { NzSafeAny } from 'ng-zorro-antd/core/types';
|
||||
import { Observable } from 'rxjs';
|
||||
|
||||
import { Connectors } from '../entity/Connectors';
|
||||
import { Message } from '../entity/Message';
|
||||
import { BaseService } from './base.service';
|
||||
|
||||
@Injectable({
|
||||
providedIn: 'root'
|
||||
})
|
||||
export class ConnectorsService extends BaseService<Connectors> {
|
||||
constructor(private _httpClient: HttpClient) {
|
||||
super(_httpClient, '/config/connectors');
|
||||
}
|
||||
}
|
||||
@@ -1,19 +1,18 @@
|
||||
/*
|
||||
* Copyright [2022] [MaxKey of copyright http://www.maxkey.top]
|
||||
*
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
import { HttpClient } from '@angular/common/http';
|
||||
import { Injectable } from '@angular/core';
|
||||
|
||||
@@ -117,13 +117,6 @@
|
||||
"icon": "anticon-idcard",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"text": "社交服务",
|
||||
"i18n": "mxk.menu.config.socialsproviders",
|
||||
"link": "/config/socialsproviders",
|
||||
"icon": "anticon-comment",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"text": "同步器管理",
|
||||
"i18n": "mxk.menu.config.synchronizers",
|
||||
@@ -131,6 +124,20 @@
|
||||
"icon": "anticon-partition",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"text": "连接器管理",
|
||||
"i18n": "mxk.menu.config.connectors",
|
||||
"link": "/config/connectors",
|
||||
"icon": "anticon-api",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"text": "社交服务",
|
||||
"i18n": "mxk.menu.config.socialsproviders",
|
||||
"link": "/config/socialsproviders",
|
||||
"icon": "anticon-comment",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"text": "LDAP配置",
|
||||
"i18n": "mxk.menu.config.ldapcontext",
|
||||
@@ -188,6 +195,13 @@
|
||||
"icon": "anticon-audit",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"text": "连接器日志",
|
||||
"i18n": "mxk.menu.audit.connector",
|
||||
"link": "/audit/audit-connector",
|
||||
"icon": "anticon-audit",
|
||||
"children": []
|
||||
},
|
||||
{
|
||||
"text": "管理日志",
|
||||
"i18n": "mxk.menu.audit.operate",
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
"accountsstrategys": "Strategys",
|
||||
"socialsproviders": "Socials",
|
||||
"synchronizers": "Synchronizers",
|
||||
"connectors":"Connectors",
|
||||
"adapters": "Adapters",
|
||||
"notices": "Notices",
|
||||
"ldapcontext": "LDAP",
|
||||
@@ -537,6 +538,15 @@
|
||||
"resumeTime": "Join Time",
|
||||
"suspendTime": "Suspend Time"
|
||||
},
|
||||
"connectors": {
|
||||
"connName": "Name",
|
||||
"scheduler": "Scheduler",
|
||||
"justInTime":"JustInTime",
|
||||
"providerUrl": "ProviderUrl",
|
||||
"principal": "Principal",
|
||||
"credentials": "Credentials",
|
||||
"filters": "Filters"
|
||||
},
|
||||
"password": {
|
||||
"id": "Id",
|
||||
"displayName": "DisplayName",
|
||||
@@ -610,7 +620,8 @@
|
||||
|
||||
"connector.id": "Id",
|
||||
"connector.conName": "Connector",
|
||||
"connector.conType": "Type",
|
||||
"connector.topic": "Topic",
|
||||
"connector.actionType": "ActionType",
|
||||
"connector.sourceId": "SourceId",
|
||||
"connector.sourceName": "SourceName",
|
||||
"connector.objectId": "ObjectId",
|
||||
|
||||
@@ -45,6 +45,7 @@
|
||||
"accountsstrategys": "账号策略",
|
||||
"socialsproviders": "社交服务",
|
||||
"synchronizers": "同步器管理",
|
||||
"connectors":"连接器管理",
|
||||
"adapters": "适配器注册",
|
||||
"notices": "通知公告",
|
||||
"ldapcontext": "LDAP配置",
|
||||
@@ -535,6 +536,15 @@
|
||||
"resumeTime": "执行时间",
|
||||
"suspendTime": "挂起时间"
|
||||
},
|
||||
"connectors": {
|
||||
"connName": "名称",
|
||||
"scheduler": "定时任务",
|
||||
"justInTime":"实时同步",
|
||||
"providerUrl": "地址",
|
||||
"principal": "账号",
|
||||
"credentials": "凭证",
|
||||
"filters": "过滤条件"
|
||||
},
|
||||
"password": {
|
||||
"id": "用户编码",
|
||||
"displayName": "姓名",
|
||||
@@ -608,7 +618,8 @@
|
||||
|
||||
"connector.id": "编号",
|
||||
"connector.conName": "连接器",
|
||||
"connector.conType": "类型",
|
||||
"connector.topic": "主题",
|
||||
"connector.actionType": "操作",
|
||||
"connector.sourceId": "源编码",
|
||||
"connector.sourceName": "源名称",
|
||||
"connector.objectId": "对象编号",
|
||||
|
||||
@@ -46,6 +46,7 @@
|
||||
"accountsstrategys": "賬號策略",
|
||||
"socialsproviders": "社交服務",
|
||||
"synchronizers": "同步器管理",
|
||||
"connectors":"連接器管理",
|
||||
"adapters": "適配器註冊",
|
||||
"notices": "通知公告",
|
||||
"ldapcontext": "LDAP配置",
|
||||
@@ -536,6 +537,15 @@
|
||||
"resumeTime": "執行時間",
|
||||
"suspendTime": "掛起時間"
|
||||
},
|
||||
"connectors": {
|
||||
"connName": "名稱",
|
||||
"scheduler": "定時任務",
|
||||
"justInTime":"實时同步",
|
||||
"providerUrl": "地址",
|
||||
"principal": "賬號",
|
||||
"credentials": "憑證",
|
||||
"filters": "過濾條件"
|
||||
},
|
||||
"password": {
|
||||
"id": "用戶編碼",
|
||||
"displayName": "姓名",
|
||||
@@ -609,7 +619,8 @@
|
||||
|
||||
"connector.id": "編號",
|
||||
"connector.conName": "連接器",
|
||||
"connector.conType": "類型",
|
||||
"connector.topic": "主題",
|
||||
"connector.actionType": "操作",
|
||||
"connector.sourceId": "源編碼",
|
||||
"connector.sourceName": "源名稱",
|
||||
"connector.objectId": "對象編號",
|
||||
|
||||
Reference in New Issue
Block a user