@alauda-fe/dynamic-plugin-shared 0.0.4-alpha.3 → 0.0.4-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as i1 from '@alauda/ui';
|
|
2
|
-
import { rgbColor, ThemeService, coerceAttrBoolean, FormItemControlDirective, observeResizeOn, MessageService, NotificationService, DIALOG_DATA, DialogModule, ButtonModule, InputModule, IconModule, FormModule, handlePixel, isTemplateRef, ThemePickerPipe, TooltipModule, TooltipType, ButtonComponent, IconComponent, TagComponent, TooltipDirective, DateNavRange, InputGroupComponent, InputSuffixDirective, InputComponent, DateRangePickerPanelComponent, TagType, TagModule, TooltipComponent, BaseTooltip, TooltipTrigger, INPUT_GROUP_MODULE, SelectModule, FORM_MODULE, DropdownModule, CheckboxModule, CardComponent, TOOLTIP_MODULE, CheckboxComponent, BackTopComponent, SortDirective, SortHeaderComponent, PaginatorComponent, TABLE_MODULE, DROPDOWN_MODULE, DialogRef, DIALOG_MODULE, CARD_MODULE, CHECKBOX_MODULE } from '@alauda/ui';
|
|
3
|
-
import { last, cloneDeep, has, unset, get, isBoolean, sortBy, set, trim, isFunction, range, debounce, uniq, identity, first, isString, isEmpty, isObjectLike, snakeCase } from 'lodash-es';
|
|
2
|
+
import { rgbColor, ThemeService, coerceAttrBoolean, FormItemControlDirective, observeResizeOn, MessageService, NotificationService, DIALOG_DATA, DialogModule, ButtonModule, InputModule, IconModule, FormModule, handlePixel, isTemplateRef, ThemePickerPipe, TooltipModule, TooltipType, ButtonComponent, IconComponent, TagComponent, TooltipDirective, DateNavRange, InputGroupComponent, InputSuffixDirective, InputComponent, DateRangePickerPanelComponent, TagType, TagModule, TooltipComponent, BaseTooltip, TooltipTrigger, INPUT_GROUP_MODULE, SelectModule, FORM_MODULE, DropdownModule, CheckboxModule, CardComponent, TOOLTIP_MODULE, CheckboxComponent, BackTopComponent, SortDirective, SortHeaderComponent, PaginatorComponent, TABLE_MODULE, DROPDOWN_MODULE, DialogRef, DIALOG_MODULE, CARD_MODULE, CHECKBOX_MODULE, TabsModule } from '@alauda/ui';
|
|
3
|
+
import { last, cloneDeep, has, unset, get, isBoolean, sortBy, set, trim, isFunction, range, debounce, uniq, identity, first, isString, isEmpty, isObjectLike, snakeCase, memoize, findKey, some } from 'lodash-es';
|
|
4
4
|
import * as i2$1 from '@alauda-fe/dynamic-plugin-sdk';
|
|
5
|
-
import { parseBase64Type, isBlank, publishRef, TOKEN_BASE_DOMAIN, stringify as stringify$1, isEqual, TimeService, TranslateService, isZhLang, FALLBACK_LANGUAGE, TranslatePipe, ObservableInput, FeatureGateService, FieldNotAvailablePipe, ValueHook, LoadingMaskComponent, PurePipe, StandardTimePipe, RelativeTimePipe, skipError, CURR_ESCAPE_DEACTIVATE_GUARD, ESCAPE_DEACTIVATE_GUARD, parseAll, FIELD_NOT_AVAILABLE_PLACEHOLDER, noop, SafePipe, WatchEvent, K8sUtilService, isFieldNotAvailable, K8S_UTIL_PIPES_MODULE, K8sApiService, TRANSLATE_MODULE } from '@alauda-fe/dynamic-plugin-sdk';
|
|
6
|
-
import { Observable, finalize, map, startWith, catchError, of, isObservable, switchMap, animationFrameScheduler, fromEvent, auditTime, Subject, takeUntil, distinctUntilChanged, combineLatest, filter, debounceTime, take, merge, pairwise, tap, BehaviorSubject, from, timer, ReplaySubject, delay, withLatestFrom, scan, takeWhile, concat, exhaustMap, EMPTY as EMPTY$1, interval, NEVER, switchScan, mapTo } from 'rxjs';
|
|
5
|
+
import { parseBase64Type, isBlank, publishRef, TOKEN_BASE_DOMAIN, stringify as stringify$1, isEqual, TimeService, TranslateService, isZhLang, FALLBACK_LANGUAGE, TranslatePipe, ObservableInput, FeatureGateService, FieldNotAvailablePipe, ValueHook, LoadingMaskComponent, PurePipe, StandardTimePipe, RelativeTimePipe, skipError, CURR_ESCAPE_DEACTIVATE_GUARD, ESCAPE_DEACTIVATE_GUARD, parseAll, FIELD_NOT_AVAILABLE_PLACEHOLDER, noop, SafePipe, WatchEvent, K8sUtilService, NAMESPACE as NAMESPACE$1, isFieldNotAvailable, K8S_UTIL_PIPES_MODULE, ResourceSelectorPopupService, ProjectService, ConfigurableField, API_GATEWAY as API_GATEWAY$1, ClusterListComponent, K8sApiService, TRANSLATE_MODULE } from '@alauda-fe/dynamic-plugin-sdk';
|
|
6
|
+
import { Observable, finalize, map, startWith, catchError, of, isObservable, switchMap, animationFrameScheduler, fromEvent, auditTime, Subject, takeUntil, distinctUntilChanged, combineLatest, filter, debounceTime, take, merge, pairwise, tap, BehaviorSubject, from, timer, ReplaySubject, delay, withLatestFrom, scan, takeWhile, concat, exhaustMap, EMPTY as EMPTY$1, interval, NEVER, switchScan, shareReplay, mapTo } from 'rxjs';
|
|
7
7
|
import * as i2$2 from '@angular/router';
|
|
8
8
|
import { ActivatedRoute, Router, RouterLink } from '@angular/router';
|
|
9
9
|
import { dissocPath, converge, mergeAll, mergeDeepRight, path, assocPath, identity as identity$1, equals } from 'ramda';
|
|
10
10
|
import { compare } from 'compare-versions';
|
|
11
11
|
export { compareVersions as compareVersionToNum, satisfies as satisfiesVersion } from 'compare-versions';
|
|
12
12
|
import * as i0 from '@angular/core';
|
|
13
|
-
import { inject, Directive, NgZone, Injectable, IterableDiffers, isDevMode, Pipe, ChangeDetectorRef, Input, ViewContainerRef, TemplateRef, ɵstringify as _stringify, ElementRef,
|
|
13
|
+
import { inject, Directive, NgZone, Injectable, IterableDiffers, isDevMode, Pipe, ChangeDetectorRef, Input, ViewContainerRef, TemplateRef, ɵstringify as _stringify, ElementRef, Injector, HostBinding, ChangeDetectionStrategy, Component, EventEmitter, Output, HostListener, Inject, Host, booleanAttribute, forwardRef, ContentChild, Optional, ViewEncapsulation, ViewChild, ApplicationRef, ViewChildren, ContentChildren, InjectionToken, input, NgModule, computed } from '@angular/core';
|
|
14
14
|
import parser from 'cron-parser';
|
|
15
15
|
import dayjs from 'dayjs';
|
|
16
16
|
import timezone from 'dayjs/plugin/timezone';
|
|
@@ -20,23 +20,25 @@ import cronstrue from 'cronstrue';
|
|
|
20
20
|
import 'cronstrue/locales/zh_CN';
|
|
21
21
|
import 'cronstrue/locales/en';
|
|
22
22
|
import * as i1$1 from '@angular/common';
|
|
23
|
-
import { DecimalPipe, NgTemplateOutlet, AsyncPipe, NgClass, NgStyle, CommonModule, Location } from '@angular/common';
|
|
23
|
+
import { DecimalPipe, NgTemplateOutlet, AsyncPipe, NgClass, NgStyle, CommonModule, Location, KeyValuePipe } from '@angular/common';
|
|
24
24
|
import duration from 'dayjs/plugin/duration';
|
|
25
25
|
import { __decorate, __metadata } from 'tslib';
|
|
26
26
|
import * as i2 from '@angular/forms';
|
|
27
27
|
import { ControlContainer, NgControl, Validators, NG_VALIDATORS, DefaultValueAccessor, NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule, NG_ASYNC_VALIDATORS, MaxLengthValidator, MinLengthValidator, NgForm, FormGroupDirective, FormBuilder, FormGroup, FormArray } from '@angular/forms';
|
|
28
|
-
import { CdkPortalOutlet, TemplatePortal, ComponentPortal, DomPortalOutlet } from '@angular/cdk/portal';
|
|
29
28
|
import * as i1$3 from '@angular/cdk/scrolling';
|
|
30
29
|
import { CdkScrollable, ScrollingModule, CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
31
30
|
import * as i1$2 from '@angular/cdk/overlay';
|
|
32
31
|
import { ScrollDispatcher } from '@angular/cdk/overlay';
|
|
33
32
|
import { decode, encode } from 'ab64';
|
|
33
|
+
import { DomPortalOutlet, ComponentPortal } from '@angular/cdk/portal';
|
|
34
34
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
35
35
|
import { takeUntilDestroyed, toObservable, toSignal } from '@angular/core/rxjs-interop';
|
|
36
36
|
import { BaseResourceFormComponent } from 'ng-resource-form-util';
|
|
37
37
|
import { MonacoEditorConfig } from 'ng-monaco-editor';
|
|
38
|
-
import
|
|
39
|
-
import
|
|
38
|
+
import { HttpClient } from '@angular/common/http';
|
|
39
|
+
import * as i3 from '@alauda/code-editor';
|
|
40
|
+
import { CodeEditorModule, MonacoLanguageService } from '@alauda/code-editor';
|
|
41
|
+
import { yamlDefaults } from 'monaco-yaml';
|
|
40
42
|
|
|
41
43
|
/**
|
|
42
44
|
* @packageDocumentation
|
|
@@ -3365,7 +3367,6 @@ class ReadonlyFieldDirective {
|
|
|
3365
3367
|
this.templateContext = {};
|
|
3366
3368
|
this.destroy$ = new Subject();
|
|
3367
3369
|
this.control = inject(NgControl);
|
|
3368
|
-
this.cfr = inject(ComponentFactoryResolver);
|
|
3369
3370
|
this.viewContainerRef = inject(ViewContainerRef);
|
|
3370
3371
|
this.injector = inject(Injector);
|
|
3371
3372
|
// 仅考虑当前control,子control无法知晓父FormItemControl元素 ,包裹了多少个control,以及各自处于什么状态,该情况自行处理
|
|
@@ -3383,9 +3384,10 @@ class ReadonlyFieldDirective {
|
|
|
3383
3384
|
$implicit: value,
|
|
3384
3385
|
...this.context,
|
|
3385
3386
|
});
|
|
3387
|
+
this.templateViewRef?.detectChanges();
|
|
3386
3388
|
}
|
|
3387
3389
|
else {
|
|
3388
|
-
this.spanComponentRef
|
|
3390
|
+
this.spanComponentRef?.instance.setData(value);
|
|
3389
3391
|
}
|
|
3390
3392
|
}
|
|
3391
3393
|
ngOnInit() {
|
|
@@ -3393,31 +3395,20 @@ class ReadonlyFieldDirective {
|
|
|
3393
3395
|
// formControl will compose multi validators to 1, no matter defined in template nor FormBuilder
|
|
3394
3396
|
const { validator, asyncValidator } = controlEntity;
|
|
3395
3397
|
this.isControlRequired = this.controlDirective?.required || false;
|
|
3396
|
-
const portalOutlet = runInInjectionContext(this.injector, () => {
|
|
3397
|
-
return new CdkPortalOutlet(this.cfr, this.viewContainerRef);
|
|
3398
|
-
});
|
|
3399
|
-
const portal = this.template
|
|
3400
|
-
? new TemplatePortal(this.template, this.viewContainerRef, this.templateContext)
|
|
3401
|
-
: new ComponentPortal(SpanComponent, this.viewContainerRef);
|
|
3402
3398
|
const containerAttached$ = this.aclReadonlyField$.pipe(distinctUntilChanged(), map(isUpdate => {
|
|
3403
3399
|
if (!isUpdate) {
|
|
3404
3400
|
// 重置
|
|
3405
3401
|
if (this.controlDirective) {
|
|
3406
3402
|
this.controlDirective.required = this.isControlRequired;
|
|
3407
3403
|
}
|
|
3408
|
-
|
|
3409
|
-
portalOutlet.detach();
|
|
3410
|
-
}
|
|
3404
|
+
this.detachReadonlyView();
|
|
3411
3405
|
this.applyValidators(controlEntity, validator, asyncValidator);
|
|
3412
3406
|
return false;
|
|
3413
3407
|
}
|
|
3414
3408
|
if (this.controlDirective) {
|
|
3415
3409
|
this.controlDirective.required = false;
|
|
3416
3410
|
}
|
|
3417
|
-
|
|
3418
|
-
if (!this.template) {
|
|
3419
|
-
this.spanComponentRef = attachPoint;
|
|
3420
|
-
}
|
|
3411
|
+
this.attachReadonlyView();
|
|
3421
3412
|
this.clearValidators(controlEntity);
|
|
3422
3413
|
return true;
|
|
3423
3414
|
}));
|
|
@@ -3451,6 +3442,30 @@ class ReadonlyFieldDirective {
|
|
|
3451
3442
|
ngOnDestroy() {
|
|
3452
3443
|
this.destroy$.next();
|
|
3453
3444
|
}
|
|
3445
|
+
attachReadonlyView() {
|
|
3446
|
+
if (this.template) {
|
|
3447
|
+
if (!this.templateViewRef) {
|
|
3448
|
+
this.templateViewRef = this.viewContainerRef.createEmbeddedView(this.template, this.templateContext);
|
|
3449
|
+
}
|
|
3450
|
+
return;
|
|
3451
|
+
}
|
|
3452
|
+
if (!this.spanComponentRef) {
|
|
3453
|
+
this.spanComponentRef = this.viewContainerRef.createComponent(SpanComponent, {
|
|
3454
|
+
injector: this.injector,
|
|
3455
|
+
});
|
|
3456
|
+
}
|
|
3457
|
+
}
|
|
3458
|
+
detachReadonlyView() {
|
|
3459
|
+
if (this.templateViewRef) {
|
|
3460
|
+
this.templateViewRef.destroy();
|
|
3461
|
+
this.templateViewRef = undefined;
|
|
3462
|
+
}
|
|
3463
|
+
if (this.spanComponentRef) {
|
|
3464
|
+
this.spanComponentRef.destroy();
|
|
3465
|
+
this.spanComponentRef = undefined;
|
|
3466
|
+
}
|
|
3467
|
+
this.viewContainerRef.clear();
|
|
3468
|
+
}
|
|
3454
3469
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ReadonlyFieldDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
3455
3470
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: ReadonlyFieldDirective, isStandalone: true, selector: "[aclReadonlyField]", inputs: { aclReadonlyField: "aclReadonlyField", hidden: "hidden", template: ["aclReadonlyFieldTemplate", "template"], context: ["aclReadonlyFieldTemplateContext", "context"] }, host: { properties: { "hidden": "this.isHidden" } }, ngImport: i0 }); }
|
|
3456
3471
|
}
|
|
@@ -6669,6 +6684,16 @@ const textWriteOptions = {
|
|
|
6669
6684
|
language: 'text',
|
|
6670
6685
|
...commonOptions,
|
|
6671
6686
|
};
|
|
6687
|
+
const yamlWriteMinimapOptions = {
|
|
6688
|
+
language: 'yaml',
|
|
6689
|
+
...commonOptions,
|
|
6690
|
+
minimap: { enabled: true },
|
|
6691
|
+
};
|
|
6692
|
+
const yamlReadMinimapOptions = {
|
|
6693
|
+
language: 'yaml',
|
|
6694
|
+
...readonlyOptions,
|
|
6695
|
+
minimap: { enabled: true },
|
|
6696
|
+
};
|
|
6672
6697
|
// for logs
|
|
6673
6698
|
const logsReadOptions = {
|
|
6674
6699
|
wordWrap: 'on',
|
|
@@ -8423,7 +8448,7 @@ class MultiSearchActionInputComponent extends BaseResourceFormComponent {
|
|
|
8423
8448
|
// 键盘delete事件。
|
|
8424
8449
|
this.delete = new EventEmitter();
|
|
8425
8450
|
// 键盘enter事件
|
|
8426
|
-
this.
|
|
8451
|
+
this.search = new EventEmitter();
|
|
8427
8452
|
this._conditionsModel = '';
|
|
8428
8453
|
this.conditionsModel$$ = new BehaviorSubject('');
|
|
8429
8454
|
this.hasFilteredConditions$ = combineLatest([
|
|
@@ -8625,7 +8650,7 @@ class MultiSearchActionInputComponent extends BaseResourceFormComponent {
|
|
|
8625
8650
|
this.conditionsModel = currentLabel;
|
|
8626
8651
|
// 如果是单选,则需要在选中时抛出complete事件,并抛出search事件
|
|
8627
8652
|
this.ifComplete(false, true);
|
|
8628
|
-
this.
|
|
8653
|
+
this.search.emit();
|
|
8629
8654
|
}
|
|
8630
8655
|
}
|
|
8631
8656
|
// 多选
|
|
@@ -8816,7 +8841,7 @@ class MultiSearchActionInputComponent extends BaseResourceFormComponent {
|
|
|
8816
8841
|
else {
|
|
8817
8842
|
// 当前操作内容已完成,,则会抛出enter事件
|
|
8818
8843
|
if (this.ifComplete(false, true)) {
|
|
8819
|
-
this.
|
|
8844
|
+
this.search.emit();
|
|
8820
8845
|
}
|
|
8821
8846
|
else if (this.conditionCreatable && this.isConditionSelecting) {
|
|
8822
8847
|
this.setConditionByModel();
|
|
@@ -8934,7 +8959,7 @@ class MultiSearchActionInputComponent extends BaseResourceFormComponent {
|
|
|
8934
8959
|
return conditionsModel === current;
|
|
8935
8960
|
}
|
|
8936
8961
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: MultiSearchActionInputComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
8937
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: MultiSearchActionInputComponent, isStandalone: true, selector: "acl-multi-search-action-input", inputs: { placeholder: "placeholder", conditionCreatable: "conditionCreatable", isEditing: "isEditing", hidden: "hidden", autoScroll: "autoScroll", conditionConfig: "conditionConfig", showFootAction: "showFootAction", existingConditions: "existingConditions" }, outputs: { completed: "completed", editing: "editing", delete: "delete", searchEvent: "searchEvent" }, host: { properties: { "hidden": "this.hiddenState" } }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true }, { propertyName: "toolTipRef", first: true, predicate: ["toolTipRef"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"tw-flex tw-items-center tw-text-m\">\n @if (form.value; as activeCondition) {\n <span\n class=\"tw-ml-6 tw-max-w-[45%] tw-flex-shrink-0 tw-text-ellipsis tw-overflow-hidden\"\n (click)=\"activeConditionClick(); $event.stopPropagation()\"\n >\n {{ activeCondition | pure: getConditionLabel }}\n </span>\n @if (activeCondition.operator) {\n <span\n class=\"tw-ml-6\"\n (click)=\"activeOperatorClick(); $event.stopPropagation()\"\n >\n {{ activeCondition.operator }}\n </span>\n }\n @if (!isEditing) {\n <span\n class=\"tw-ml-6 tw-max-w-[45%] tw-flex-shrink-0 tw-text-ellipsis tw-overflow-hidden\"\n (click)=\"activeValueClick(); $event.stopPropagation()\"\n >\n {{ getValueContent(activeCondition) }}\n </span>\n }\n }\n <input\n class=\"search-input\"\n [ngClass]=\"{\n 'mock-input':\n (!isEditing && !isConditionSelecting) || isOperatorSelecting,\n }\"\n [maxlength]=\"isOperatorSelecting ? 0 : MAX_SAFE_INTEGER\"\n aui-input\n #inputRef\n #toolTipRef=\"auiTooltip\"\n [placeholder]=\"isConditionSelecting ? placeholder : ''\"\n [(ngModel)]=\"conditionsModel\"\n (ngModelChange)=\"conditionsModel$$.next($event)\"\n (keydown)=\"inputKeydown($event)\"\n (focus)=\"inputFocus()\"\n [auiTooltip]=\"templateRef\"\n auiTooltipAnimType=\"none\"\n auiTooltipTrigger=\"manual\"\n auiTooltipType=\"info\"\n auiTooltipClass=\"multi-search-dropdown\"\n auiTooltipPosition=\"bottom start\"\n />\n</div>\n\n<ng-template #templateRef>\n <div\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"$event.stopPropagation()\"\n >\n <!-- \u7C7B\u76EE\u9009\u62E9 -->\n @if (isConditionSelecting && (conditionsShouldShow$ | async)) {\n @if (hasFilteredConditions$ | async) {\n <ul class=\"tw-min-w-[260px] tw-max-w-[400px]\">\n <ng-container\n [ngTemplateOutlet]=\"categoriesTemp\"\n [ngTemplateOutletContext]=\"{\n normal: (normalConditions$ | async),\n groups: groupConditions$ | async,\n }\"\n ></ng-container>\n </ul>\n } @else {\n <ul class=\"tw-min-w-[260px] tw-max-w-[400px]\">\n <div class=\"no-match-categories-tip\">\n {{ 'no_match_categories_tip' | translate }}\n </div>\n <ng-container\n [ngTemplateOutlet]=\"categoriesTemp\"\n [ngTemplateOutletContext]=\"{\n normal: normalConditionsResource$ | async,\n groups: groupConditionsResource$ | async,\n }\"\n ></ng-container>\n </ul>\n }\n <ng-template\n #categoriesTemp\n let-normal=\"normal\"\n let-groups=\"groups\"\n >\n <ng-container\n [ngTemplateOutlet]=\"liConditionTemp\"\n [ngTemplateOutletContext]=\"{ conditions: normal }\"\n ></ng-container>\n @for (group of groups; track group) {\n @if (group.member?.length) {\n <div\n [title]=\"group.group\"\n class=\"dropdown-group-label dropdown-content\"\n >\n {{ group.group }}\n </div>\n <ng-container\n [ngTemplateOutlet]=\"liConditionTemp\"\n [ngTemplateOutletContext]=\"{ conditions: group.member }\"\n ></ng-container>\n }\n }\n </ng-template>\n }\n\n @if (form.value; as activeCondition) {\n <!-- operator\u9009\u62E9 -->\n @if (isOperatorSelecting) {\n <ul class=\"tw-min-w-[160px]\">\n @for (\n operator of activeCondition.operators || [DEFAULT_OPERATOR];\n track operator\n ) {\n <li (click)=\"selectActiveOperator($any(operator))\">\n <ng-container\n [ngTemplateOutlet]=\"basicLiContentTemp\"\n [ngTemplateOutletContext]=\"{\n isSelect: operator === conditionsModel,\n label: operator,\n }\"\n >\n </ng-container>\n </li>\n }\n </ul>\n }\n <!-- \u5177\u4F53\u6761\u4EF6\u9009\u62E9 -->\n @if (isValueSelecting) {\n @if (\n activeCondition\n | pure\n : hasFilteredValues\n : conditionsModel\n : activeCondition.isMulti\n ) {\n <ul class=\"tw-min-w-[260px] tw-max-w-[400px]\">\n @if (activeCondition.allowSelectAll && activeCondition.isMulti) {\n <li class=\"dropdown-content select-all\">\n <div\n class=\"search-dropdown-item\"\n [ngClass]=\"{\n 'tw-text-p-2': isSelectAll,\n 'tw-bg-p-6': isSelectAll,\n }\"\n (click)=\"selectAllClick()\"\n >\n <div class=\"multi-item\">\n <aui-checkbox\n [value]=\"isSelectAll\"\n [indeterminate]=\"isIndeterminate\"\n ></aui-checkbox>\n <div class=\"search-dropdown-item-label\">\n {{ 'all' | translate }}\n </div>\n </div>\n </div>\n </li>\n }\n <ng-container\n [ngTemplateOutlet]=\"liValueTemp\"\n [ngTemplateOutletContext]=\"{\n values:\n activeCondition\n | pure\n : getNormalValues\n : conditionsModel\n : activeCondition.isMulti,\n activeCondition: activeCondition,\n }\"\n >\n </ng-container>\n @for (\n group of activeCondition\n | pure\n : getValuesGroup\n : conditionsModel\n : activeCondition.isMulti;\n track group\n ) {\n @if (group.member?.length) {\n <div\n [title]=\"group.group\"\n class=\"dropdown-group-label dropdown-content\"\n >\n {{ group.group }}\n </div>\n <ng-container\n [ngTemplateOutlet]=\"liValueTemp\"\n [ngTemplateOutletContext]=\"{\n values: group.member,\n activeCondition: activeCondition,\n }\"\n ></ng-container>\n }\n }\n </ul>\n }\n }\n }\n @if (showFootAction && form?.value?.isMulti) {\n <div class=\"footer\">\n <button\n aui-button=\"text\"\n size=\"mini\"\n (click)=\"confirmSelection()\"\n >\n {{ 'confirm' | translate }}\n </button>\n <button\n aui-button=\"text\"\n size=\"mini\"\n class=\"cancel\"\n (click)=\"toolTipHide()\"\n >\n {{ 'cancel' | translate }}\n </button>\n </div>\n }\n </div>\n</ng-template>\n\n<ng-template\n #liConditionTemp\n let-conditions=\"conditions\"\n>\n @for (condition of conditions; track condition) {\n <li\n class=\"dropdown-content\"\n (click)=\"selectActiveCondition(condition)\"\n >\n <ng-container\n [ngTemplateOutlet]=\"basicLiContentTemp\"\n [ngTemplateOutletContext]=\"{\n isSelect:\n condition\n | pure: getConditionLabel\n | pure: isConditionSelected : conditionsModel,\n label: condition | pure: getConditionLabel,\n }\"\n >\n </ng-container>\n </li>\n }\n</ng-template>\n\n<ng-template\n #liValueTemp\n let-values=\"values\"\n let-activeCondition=\"activeCondition\"\n>\n @for (value of values; track value) {\n <li\n class=\"dropdown-content\"\n (click)=\"\n selectValue(value, activeCondition.isMulti);\n $event.stopPropagation();\n $event.preventDefault()\n \"\n >\n <ng-container\n [ngTemplateOutlet]=\"basicLiContentTemp\"\n [ngTemplateOutletContext]=\"{\n isSelect:\n value\n | pure: getValueLabel\n | pure\n : isValueSelected\n : conditionsModel || (form.value | pure: getValueContent)\n : activeCondition,\n label: value | pure: getValueLabel,\n isMulti: activeCondition.isMulti,\n }\"\n >\n </ng-container>\n </li>\n }\n</ng-template>\n\n<ng-template\n #basicLiContentTemp\n let-isSelect=\"isSelect\"\n let-label=\"label\"\n let-isMulti=\"isMulti\"\n>\n <div\n [class]=\"DROPDOWN_ITEM_CLASS\"\n [ngClass]=\"{\n 'is-multi-value-select': isSelect,\n }\"\n >\n @if (isMulti) {\n <div class=\"multi-item\">\n <aui-checkbox [value]=\"isSelect\"></aui-checkbox>\n <div\n [title]=\"label\"\n class=\"search-dropdown-item-label\"\n >\n {{ label }}\n </div>\n </div>\n }\n @if (!isMulti) {\n <div\n [title]=\"label\"\n class=\"search-dropdown-item-label\"\n >\n {{ label }}\n </div>\n }\n </div>\n</ng-template>\n", styles: [":host{display:block;padding-top:5px}.search-input{border:none;box-shadow:none!important;height:22px}.mock-input{width:1px!important;flex-shrink:0;padding:0;margin-left:7px}::ng-deep .multi-search-dropdown{padding:0!important;margin-top:8px!important;cursor:pointer;max-height:284px;overflow-y:auto}::ng-deep .multi-search-dropdown ul .dropdown-content:first-child{border:none;padding-top:0;margin-top:0}::ng-deep .multi-search-dropdown .cursor-light{background-color:rgb(var(--aui-color-p-6))}::ng-deep .multi-search-dropdown .is-multi-value-select{background-color:rgb(var(--aui-color-p-6));color:rgb(var(--aui-color-p-2))}::ng-deep .multi-search-dropdown .search-dropdown-item{padding:0 8px}::ng-deep .multi-search-dropdown .search-dropdown-item:hover{background-color:rgb(var(--aui-color-p-6))}::ng-deep .multi-search-dropdown .search-dropdown-item .multi-item{display:flex;height:28px;align-items:center}::ng-deep .multi-search-dropdown .search-dropdown-item .multi-item aui-checkbox{width:24px}::ng-deep .multi-search-dropdown .search-dropdown-item-label{height:28px;line-height:28px;white-space:nowrap;word-break:break-all;overflow:hidden;text-overflow:ellipsis;font-size:var(--aui-font-size-m)}::ng-deep .multi-search-dropdown .dropdown-group-label{font-size:12px;color:rgb(var(--aui-color-n-4));padding-bottom:8px;padding-top:12px;margin-top:12px;margin-left:8px;margin-right:8px;border-top:1px solid rgb(var(--aui-color-n-8));white-space:nowrap;word-break:break-all;overflow:hidden;text-overflow:ellipsis}::ng-deep .multi-search-dropdown .no-match-categories-tip{text-align:center;font-size:12px;color:rgb(var(--aui-color-n-4));border-bottom:1px solid rgb(var(--aui-color-n-8));margin-left:8px;margin-right:8px;margin-bottom:8px;padding-top:4px;padding-bottom:12px}::ng-deep .multi-search-dropdown .select-all{border-bottom:1px solid rgb(var(--aui-color-n-8))!important;margin-bottom:8px}::ng-deep .multi-search-dropdown .footer{display:flex;background:rgb(var(--aui-color-n-10));justify-content:flex-end;border-top:1px solid rgb(var(--aui-color-n-8));position:sticky;bottom:0;height:30px;padding:0 8px;align-items:center}::ng-deep .multi-search-dropdown .footer .cancel{color:rgb(var(--aui-color-n-1))!important}\n"], dependencies: [{ kind: "component", type: InputComponent, selector: "input[aui-input],textarea[aui-input]", inputs: ["size", "disabled"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: TooltipDirective, selector: "[auiTooltip]", inputs: ["auiTooltip", "auiTooltipContext", "auiTooltipClass", "auiTooltipType", "auiTooltipPosition", "auiTooltipTrigger", "auiTooltipDisabled", "auiTooltipHideOnClick", "auiTooltipAnimType"], outputs: ["auiTooltipVisibleChange"], exportAs: ["auiTooltip"] }, { kind: "component", type: CheckboxComponent, selector: "aui-checkbox", inputs: ["name", "type", "label", "indeterminate"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ButtonComponent, selector: "button[aui-button]", inputs: ["aui-button", "size", "plain", "loading", "round", "square"] }, { kind: "pipe", type: PurePipe, name: "pure" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8962
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: MultiSearchActionInputComponent, isStandalone: true, selector: "acl-multi-search-action-input", inputs: { placeholder: "placeholder", conditionCreatable: "conditionCreatable", isEditing: "isEditing", hidden: "hidden", autoScroll: "autoScroll", conditionConfig: "conditionConfig", showFootAction: "showFootAction", existingConditions: "existingConditions" }, outputs: { completed: "completed", editing: "editing", delete: "delete", search: "search" }, host: { properties: { "hidden": "this.hiddenState" } }, viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["inputRef"], descendants: true }, { propertyName: "toolTipRef", first: true, predicate: ["toolTipRef"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div class=\"tw-flex tw-items-center tw-text-m\">\n @if (form.value; as activeCondition) {\n <span\n class=\"tw-ml-6 tw-max-w-[45%] tw-flex-shrink-0 tw-text-ellipsis tw-overflow-hidden\"\n (click)=\"activeConditionClick(); $event.stopPropagation()\"\n >\n {{ activeCondition | pure: getConditionLabel }}\n </span>\n @if (activeCondition.operator) {\n <span\n class=\"tw-ml-6\"\n (click)=\"activeOperatorClick(); $event.stopPropagation()\"\n >\n {{ activeCondition.operator }}\n </span>\n }\n @if (!isEditing) {\n <span\n class=\"tw-ml-6 tw-max-w-[45%] tw-flex-shrink-0 tw-text-ellipsis tw-overflow-hidden\"\n (click)=\"activeValueClick(); $event.stopPropagation()\"\n >\n {{ getValueContent(activeCondition) }}\n </span>\n }\n }\n <input\n class=\"search-input\"\n [ngClass]=\"{\n 'mock-input':\n (!isEditing && !isConditionSelecting) || isOperatorSelecting,\n }\"\n [maxlength]=\"isOperatorSelecting ? 0 : MAX_SAFE_INTEGER\"\n aui-input\n #inputRef\n #toolTipRef=\"auiTooltip\"\n [placeholder]=\"isConditionSelecting ? placeholder : ''\"\n [(ngModel)]=\"conditionsModel\"\n (ngModelChange)=\"conditionsModel$$.next($event)\"\n (keydown)=\"inputKeydown($event)\"\n (focus)=\"inputFocus()\"\n [auiTooltip]=\"templateRef\"\n auiTooltipAnimType=\"none\"\n auiTooltipTrigger=\"manual\"\n auiTooltipType=\"info\"\n auiTooltipClass=\"multi-search-dropdown\"\n auiTooltipPosition=\"bottom start\"\n />\n</div>\n\n<ng-template #templateRef>\n <div\n (mousedown)=\"$event.preventDefault()\"\n (click)=\"$event.stopPropagation()\"\n >\n <!-- \u7C7B\u76EE\u9009\u62E9 -->\n @if (isConditionSelecting && (conditionsShouldShow$ | async)) {\n @if (hasFilteredConditions$ | async) {\n <ul class=\"tw-min-w-[260px] tw-max-w-[400px]\">\n <ng-container\n [ngTemplateOutlet]=\"categoriesTemp\"\n [ngTemplateOutletContext]=\"{\n normal: (normalConditions$ | async),\n groups: groupConditions$ | async,\n }\"\n ></ng-container>\n </ul>\n } @else {\n <ul class=\"tw-min-w-[260px] tw-max-w-[400px]\">\n <div class=\"no-match-categories-tip\">\n {{ 'no_match_categories_tip' | translate }}\n </div>\n <ng-container\n [ngTemplateOutlet]=\"categoriesTemp\"\n [ngTemplateOutletContext]=\"{\n normal: normalConditionsResource$ | async,\n groups: groupConditionsResource$ | async,\n }\"\n ></ng-container>\n </ul>\n }\n <ng-template\n #categoriesTemp\n let-normal=\"normal\"\n let-groups=\"groups\"\n >\n <ng-container\n [ngTemplateOutlet]=\"liConditionTemp\"\n [ngTemplateOutletContext]=\"{ conditions: normal }\"\n ></ng-container>\n @for (group of groups; track group) {\n @if (group.member?.length) {\n <div\n [title]=\"group.group\"\n class=\"dropdown-group-label dropdown-content\"\n >\n {{ group.group }}\n </div>\n <ng-container\n [ngTemplateOutlet]=\"liConditionTemp\"\n [ngTemplateOutletContext]=\"{ conditions: group.member }\"\n ></ng-container>\n }\n }\n </ng-template>\n }\n\n @if (form.value; as activeCondition) {\n <!-- operator\u9009\u62E9 -->\n @if (isOperatorSelecting) {\n <ul class=\"tw-min-w-[160px]\">\n @for (\n operator of activeCondition.operators || [DEFAULT_OPERATOR];\n track operator\n ) {\n <li (click)=\"selectActiveOperator($any(operator))\">\n <ng-container\n [ngTemplateOutlet]=\"basicLiContentTemp\"\n [ngTemplateOutletContext]=\"{\n isSelect: operator === conditionsModel,\n label: operator,\n }\"\n >\n </ng-container>\n </li>\n }\n </ul>\n }\n <!-- \u5177\u4F53\u6761\u4EF6\u9009\u62E9 -->\n @if (isValueSelecting) {\n @if (\n activeCondition\n | pure\n : hasFilteredValues\n : conditionsModel\n : activeCondition.isMulti\n ) {\n <ul class=\"tw-min-w-[260px] tw-max-w-[400px]\">\n @if (activeCondition.allowSelectAll && activeCondition.isMulti) {\n <li class=\"dropdown-content select-all\">\n <div\n class=\"search-dropdown-item\"\n [ngClass]=\"{\n 'tw-text-p-2': isSelectAll,\n 'tw-bg-p-6': isSelectAll,\n }\"\n (click)=\"selectAllClick()\"\n >\n <div class=\"multi-item\">\n <aui-checkbox\n [value]=\"isSelectAll\"\n [indeterminate]=\"isIndeterminate\"\n ></aui-checkbox>\n <div class=\"search-dropdown-item-label\">\n {{ 'all' | translate }}\n </div>\n </div>\n </div>\n </li>\n }\n <ng-container\n [ngTemplateOutlet]=\"liValueTemp\"\n [ngTemplateOutletContext]=\"{\n values:\n activeCondition\n | pure\n : getNormalValues\n : conditionsModel\n : activeCondition.isMulti,\n activeCondition: activeCondition,\n }\"\n >\n </ng-container>\n @for (\n group of activeCondition\n | pure\n : getValuesGroup\n : conditionsModel\n : activeCondition.isMulti;\n track group\n ) {\n @if (group.member?.length) {\n <div\n [title]=\"group.group\"\n class=\"dropdown-group-label dropdown-content\"\n >\n {{ group.group }}\n </div>\n <ng-container\n [ngTemplateOutlet]=\"liValueTemp\"\n [ngTemplateOutletContext]=\"{\n values: group.member,\n activeCondition: activeCondition,\n }\"\n ></ng-container>\n }\n }\n </ul>\n }\n }\n }\n @if (showFootAction && form?.value?.isMulti) {\n <div class=\"footer\">\n <button\n aui-button=\"text\"\n size=\"mini\"\n (click)=\"confirmSelection()\"\n >\n {{ 'confirm' | translate }}\n </button>\n <button\n aui-button=\"text\"\n size=\"mini\"\n class=\"cancel\"\n (click)=\"toolTipHide()\"\n >\n {{ 'cancel' | translate }}\n </button>\n </div>\n }\n </div>\n</ng-template>\n\n<ng-template\n #liConditionTemp\n let-conditions=\"conditions\"\n>\n @for (condition of conditions; track condition) {\n <li\n class=\"dropdown-content\"\n (click)=\"selectActiveCondition(condition)\"\n >\n <ng-container\n [ngTemplateOutlet]=\"basicLiContentTemp\"\n [ngTemplateOutletContext]=\"{\n isSelect:\n condition\n | pure: getConditionLabel\n | pure: isConditionSelected : conditionsModel,\n label: condition | pure: getConditionLabel,\n }\"\n >\n </ng-container>\n </li>\n }\n</ng-template>\n\n<ng-template\n #liValueTemp\n let-values=\"values\"\n let-activeCondition=\"activeCondition\"\n>\n @for (value of values; track value) {\n <li\n class=\"dropdown-content\"\n (click)=\"\n selectValue(value, activeCondition.isMulti);\n $event.stopPropagation();\n $event.preventDefault()\n \"\n >\n <ng-container\n [ngTemplateOutlet]=\"basicLiContentTemp\"\n [ngTemplateOutletContext]=\"{\n isSelect:\n value\n | pure: getValueLabel\n | pure\n : isValueSelected\n : conditionsModel || (form.value | pure: getValueContent)\n : activeCondition,\n label: value | pure: getValueLabel,\n isMulti: activeCondition.isMulti,\n }\"\n >\n </ng-container>\n </li>\n }\n</ng-template>\n\n<ng-template\n #basicLiContentTemp\n let-isSelect=\"isSelect\"\n let-label=\"label\"\n let-isMulti=\"isMulti\"\n>\n <div\n [class]=\"DROPDOWN_ITEM_CLASS\"\n [ngClass]=\"{\n 'is-multi-value-select': isSelect,\n }\"\n >\n @if (isMulti) {\n <div class=\"multi-item\">\n <aui-checkbox [value]=\"isSelect\"></aui-checkbox>\n <div\n [title]=\"label\"\n class=\"search-dropdown-item-label\"\n >\n {{ label }}\n </div>\n </div>\n }\n @if (!isMulti) {\n <div\n [title]=\"label\"\n class=\"search-dropdown-item-label\"\n >\n {{ label }}\n </div>\n }\n </div>\n</ng-template>\n", styles: [":host{display:block;padding-top:5px}.search-input{border:none;box-shadow:none!important;height:22px}.mock-input{width:1px!important;flex-shrink:0;padding:0;margin-left:7px}::ng-deep .multi-search-dropdown{padding:0!important;margin-top:8px!important;cursor:pointer;max-height:284px;overflow-y:auto}::ng-deep .multi-search-dropdown ul .dropdown-content:first-child{border:none;padding-top:0;margin-top:0}::ng-deep .multi-search-dropdown .cursor-light{background-color:rgb(var(--aui-color-p-6))}::ng-deep .multi-search-dropdown .is-multi-value-select{background-color:rgb(var(--aui-color-p-6));color:rgb(var(--aui-color-p-2))}::ng-deep .multi-search-dropdown .search-dropdown-item{padding:0 8px}::ng-deep .multi-search-dropdown .search-dropdown-item:hover{background-color:rgb(var(--aui-color-p-6))}::ng-deep .multi-search-dropdown .search-dropdown-item .multi-item{display:flex;height:28px;align-items:center}::ng-deep .multi-search-dropdown .search-dropdown-item .multi-item aui-checkbox{width:24px}::ng-deep .multi-search-dropdown .search-dropdown-item-label{height:28px;line-height:28px;white-space:nowrap;word-break:break-all;overflow:hidden;text-overflow:ellipsis;font-size:var(--aui-font-size-m)}::ng-deep .multi-search-dropdown .dropdown-group-label{font-size:12px;color:rgb(var(--aui-color-n-4));padding-bottom:8px;padding-top:12px;margin-top:12px;margin-left:8px;margin-right:8px;border-top:1px solid rgb(var(--aui-color-n-8));white-space:nowrap;word-break:break-all;overflow:hidden;text-overflow:ellipsis}::ng-deep .multi-search-dropdown .no-match-categories-tip{text-align:center;font-size:12px;color:rgb(var(--aui-color-n-4));border-bottom:1px solid rgb(var(--aui-color-n-8));margin-left:8px;margin-right:8px;margin-bottom:8px;padding-top:4px;padding-bottom:12px}::ng-deep .multi-search-dropdown .select-all{border-bottom:1px solid rgb(var(--aui-color-n-8))!important;margin-bottom:8px}::ng-deep .multi-search-dropdown .footer{display:flex;background:rgb(var(--aui-color-n-10));justify-content:flex-end;border-top:1px solid rgb(var(--aui-color-n-8));position:sticky;bottom:0;height:30px;padding:0 8px;align-items:center}::ng-deep .multi-search-dropdown .footer .cancel{color:rgb(var(--aui-color-n-1))!important}\n"], dependencies: [{ kind: "component", type: InputComponent, selector: "input[aui-input],textarea[aui-input]", inputs: ["size", "disabled"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: TooltipDirective, selector: "[auiTooltip]", inputs: ["auiTooltip", "auiTooltipContext", "auiTooltipClass", "auiTooltipType", "auiTooltipPosition", "auiTooltipTrigger", "auiTooltipDisabled", "auiTooltipHideOnClick", "auiTooltipAnimType"], outputs: ["auiTooltipVisibleChange"], exportAs: ["auiTooltip"] }, { kind: "component", type: CheckboxComponent, selector: "aui-checkbox", inputs: ["name", "type", "label", "indeterminate"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.MaxLengthValidator, selector: "[maxlength][formControlName],[maxlength][formControl],[maxlength][ngModel]", inputs: ["maxlength"] }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: ButtonComponent, selector: "button[aui-button]", inputs: ["aui-button", "size", "plain", "loading", "round", "square"] }, { kind: "pipe", type: PurePipe, name: "pure" }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
8938
8963
|
}
|
|
8939
8964
|
__decorate([
|
|
8940
8965
|
ObservableInput(),
|
|
@@ -8984,7 +9009,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
8984
9009
|
type: Output
|
|
8985
9010
|
}], delete: [{
|
|
8986
9011
|
type: Output
|
|
8987
|
-
}],
|
|
9012
|
+
}], search: [{
|
|
8988
9013
|
type: Output
|
|
8989
9014
|
}], inputRef: [{
|
|
8990
9015
|
type: ViewChild,
|
|
@@ -9002,7 +9027,7 @@ class MultiSearchTagsComponent {
|
|
|
9002
9027
|
this.removeCondition = new EventEmitter();
|
|
9003
9028
|
this.setConditionEditing = new EventEmitter();
|
|
9004
9029
|
this.setConditionDeleting = new EventEmitter();
|
|
9005
|
-
this.
|
|
9030
|
+
this.search = new EventEmitter();
|
|
9006
9031
|
this.completed = new EventEmitter();
|
|
9007
9032
|
}
|
|
9008
9033
|
conditionInAction(condition) {
|
|
@@ -9017,7 +9042,7 @@ class MultiSearchTagsComponent {
|
|
|
9017
9042
|
?.join(condition.separator ?? ' | ');
|
|
9018
9043
|
}
|
|
9019
9044
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: MultiSearchTagsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
9020
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: MultiSearchTagsComponent, isStandalone: true, selector: "acl-multi-search-tags", inputs: { placeholder: "placeholder", conditionCreatable: "conditionCreatable", conditionConfig: "conditionConfig", existingConditions: "existingConditions", showFootAction: "showFootAction" }, outputs: { removeCondition: "removeCondition", setConditionEditing: "setConditionEditing", setConditionDeleting: "setConditionDeleting",
|
|
9045
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: MultiSearchTagsComponent, isStandalone: true, selector: "acl-multi-search-tags", inputs: { placeholder: "placeholder", conditionCreatable: "conditionCreatable", conditionConfig: "conditionConfig", existingConditions: "existingConditions", showFootAction: "showFootAction" }, outputs: { removeCondition: "removeCondition", setConditionEditing: "setConditionEditing", setConditionDeleting: "setConditionDeleting", search: "search", completed: "completed" }, viewQueries: [{ propertyName: "inputComponent", first: true, predicate: ["inputRef"], descendants: true }], ngImport: i0, template: "<div class=\"search-content\">\n @for (condition of existingConditions; track condition; let index = $index) {\n @if (!conditionInAction(condition)) {\n <aui-tag\n class=\"tw-ml-6 tw-h-[22px] tw-mb-4\"\n [ngClass]=\"condition.tagClass\"\n [type]=\"condition.tagType || 'info'\"\n [border]=\"true\"\n [closeable]=\"true\"\n (close)=\"removeCondition.emit(condition); search.emit()\"\n (click)=\"setConditionEditing.emit(condition)\"\n size=\"mini\"\n >\n <span\n [title]=\"\n (condition | pure: getConditionLabel) +\n ' ' +\n condition.operator +\n ' ' +\n (condition | pure: getValueContent)\n \"\n >\n {{ condition | pure: getConditionLabel }}\n {{ condition.operator }}\n {{ condition | pure: getValueContent }}\n </span>\n </aui-tag>\n } @else {\n <acl-multi-search-action-input\n #inputRef\n class=\"input-wrapper\"\n [ngClass]=\"{ 'deleting-input': condition.isDeleting }\"\n [isEditing]=\"condition.isEditing\"\n [conditionCreatable]=\"conditionCreatable\"\n [placeholder]=\"placeholder\"\n [conditionConfig]=\"conditionConfig\"\n [existingConditions]=\"existingConditions\"\n [showFootAction]=\"showFootAction\"\n [(ngModel)]=\"condition.actionModel\"\n (completed)=\"\n completed.emit({\n activeCondition: $event.activeCondition,\n toContinue: $event.toContinue,\n manualFocus: $event.manualFocus,\n index: index,\n })\n \"\n (delete)=\"setConditionDeleting.emit(index - 1)\"\n (editing)=\"setConditionEditing.emit(condition)\"\n (search)=\"search.emit()\"\n ></acl-multi-search-action-input>\n }\n }\n <ng-content></ng-content>\n</div>\n", styles: [":host{display:block}:host .search-content{width:100%;min-height:30px;max-height:160px;flex:1;display:flex;flex-wrap:wrap;align-items:center}:host .search-content ::ng-deep aui-tag{max-width:calc(100% - 8px)}:host .search-content ::ng-deep .aui-tag{margin-left:0;max-width:100%}:host .search-content ::ng-deep .input-wrapper{padding-bottom:4px;max-width:100%;width:max-content;min-width:180px;white-space:nowrap;word-break:break-all;overflow:hidden;text-overflow:ellipsis;flex-grow:1;flex-shrink:0}\n"], dependencies: [{ kind: "ngmodule", type: TagModule }, { kind: "component", type: i1.TagComponent, selector: "aui-tag", inputs: ["type", "size", "closeable", "border", "solid", "invalid", "round", "color", "allowClick"], outputs: ["close"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MultiSearchActionInputComponent, selector: "acl-multi-search-action-input", inputs: ["placeholder", "conditionCreatable", "isEditing", "hidden", "autoScroll", "conditionConfig", "showFootAction", "existingConditions"], outputs: ["completed", "editing", "delete", "search"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: PurePipe, name: "pure" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
9021
9046
|
}
|
|
9022
9047
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: MultiSearchTagsComponent, decorators: [{
|
|
9023
9048
|
type: Component,
|
|
@@ -9027,7 +9052,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
9027
9052
|
PurePipe,
|
|
9028
9053
|
MultiSearchActionInputComponent,
|
|
9029
9054
|
FormsModule,
|
|
9030
|
-
], template: "<div class=\"search-content\">\n @for (condition of existingConditions; track condition; let index = $index) {\n @if (!conditionInAction(condition)) {\n <aui-tag\n class=\"tw-ml-6 tw-h-[22px] tw-mb-4\"\n [ngClass]=\"condition.tagClass\"\n [type]=\"condition.tagType || 'info'\"\n [border]=\"true\"\n [closeable]=\"true\"\n (close)=\"removeCondition.emit(condition);
|
|
9055
|
+
], template: "<div class=\"search-content\">\n @for (condition of existingConditions; track condition; let index = $index) {\n @if (!conditionInAction(condition)) {\n <aui-tag\n class=\"tw-ml-6 tw-h-[22px] tw-mb-4\"\n [ngClass]=\"condition.tagClass\"\n [type]=\"condition.tagType || 'info'\"\n [border]=\"true\"\n [closeable]=\"true\"\n (close)=\"removeCondition.emit(condition); search.emit()\"\n (click)=\"setConditionEditing.emit(condition)\"\n size=\"mini\"\n >\n <span\n [title]=\"\n (condition | pure: getConditionLabel) +\n ' ' +\n condition.operator +\n ' ' +\n (condition | pure: getValueContent)\n \"\n >\n {{ condition | pure: getConditionLabel }}\n {{ condition.operator }}\n {{ condition | pure: getValueContent }}\n </span>\n </aui-tag>\n } @else {\n <acl-multi-search-action-input\n #inputRef\n class=\"input-wrapper\"\n [ngClass]=\"{ 'deleting-input': condition.isDeleting }\"\n [isEditing]=\"condition.isEditing\"\n [conditionCreatable]=\"conditionCreatable\"\n [placeholder]=\"placeholder\"\n [conditionConfig]=\"conditionConfig\"\n [existingConditions]=\"existingConditions\"\n [showFootAction]=\"showFootAction\"\n [(ngModel)]=\"condition.actionModel\"\n (completed)=\"\n completed.emit({\n activeCondition: $event.activeCondition,\n toContinue: $event.toContinue,\n manualFocus: $event.manualFocus,\n index: index,\n })\n \"\n (delete)=\"setConditionDeleting.emit(index - 1)\"\n (editing)=\"setConditionEditing.emit(condition)\"\n (search)=\"search.emit()\"\n ></acl-multi-search-action-input>\n }\n }\n <ng-content></ng-content>\n</div>\n", styles: [":host{display:block}:host .search-content{width:100%;min-height:30px;max-height:160px;flex:1;display:flex;flex-wrap:wrap;align-items:center}:host .search-content ::ng-deep aui-tag{max-width:calc(100% - 8px)}:host .search-content ::ng-deep .aui-tag{margin-left:0;max-width:100%}:host .search-content ::ng-deep .input-wrapper{padding-bottom:4px;max-width:100%;width:max-content;min-width:180px;white-space:nowrap;word-break:break-all;overflow:hidden;text-overflow:ellipsis;flex-grow:1;flex-shrink:0}\n"] }]
|
|
9031
9056
|
}], propDecorators: { placeholder: [{
|
|
9032
9057
|
type: Input
|
|
9033
9058
|
}], conditionCreatable: [{
|
|
@@ -9044,7 +9069,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
9044
9069
|
type: Output
|
|
9045
9070
|
}], setConditionDeleting: [{
|
|
9046
9071
|
type: Output
|
|
9047
|
-
}],
|
|
9072
|
+
}], search: [{
|
|
9048
9073
|
type: Output
|
|
9049
9074
|
}], completed: [{
|
|
9050
9075
|
type: Output
|
|
@@ -9066,7 +9091,7 @@ class MultiSearchComponent {
|
|
|
9066
9091
|
this.autoScroll = true;
|
|
9067
9092
|
this.searchSuffix = true;
|
|
9068
9093
|
// 搜索操作
|
|
9069
|
-
this.
|
|
9094
|
+
this.search = new EventEmitter();
|
|
9070
9095
|
// 条件变化
|
|
9071
9096
|
this.conditionsChange = new EventEmitter();
|
|
9072
9097
|
// 当前multi-search组件是否focus
|
|
@@ -9198,7 +9223,7 @@ class MultiSearchComponent {
|
|
|
9198
9223
|
this.existingConditions$
|
|
9199
9224
|
.pipe(take(1), takeUntil(this.destroy$$))
|
|
9200
9225
|
.subscribe(exists => {
|
|
9201
|
-
this.
|
|
9226
|
+
this.search.emit(this.getConditionModel(exists?.filter(exist => !this.conditionInAction(exist))));
|
|
9202
9227
|
});
|
|
9203
9228
|
}
|
|
9204
9229
|
// 清除所有已选条件
|
|
@@ -9313,7 +9338,7 @@ class MultiSearchComponent {
|
|
|
9313
9338
|
this.destroy$$.next();
|
|
9314
9339
|
}
|
|
9315
9340
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: MultiSearchComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
9316
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: MultiSearchComponent, isStandalone: true, selector: "acl-multi-search", inputs: { placeholder: "placeholder", conditionCreatable: "conditionCreatable", conditions: "conditions", conditionConfig: "conditionConfig", autoScroll: "autoScroll", searchSuffix: "searchSuffix", showFootAction: "showFootAction" }, outputs: {
|
|
9341
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: MultiSearchComponent, isStandalone: true, selector: "acl-multi-search", inputs: { placeholder: "placeholder", conditionCreatable: "conditionCreatable", conditions: "conditions", conditionConfig: "conditionConfig", autoScroll: "autoScroll", searchSuffix: "searchSuffix", showFootAction: "showFootAction" }, outputs: { search: "search", conditionsChange: "conditionsChange" }, viewQueries: [{ propertyName: "normalInputComponent", first: true, predicate: ["inputRef"], descendants: true }, { propertyName: "tagsComponent", first: true, predicate: ["tagsRef"], descendants: true }, { propertyName: "multiSearchRef", first: true, predicate: ["multiSearch"], descendants: true, static: true }], ngImport: i0, template: "<div\n class=\"aui-input multi-search\"\n #multiSearch\n [ngClass]=\"{\n 'search-focus': focus$$ | async,\n }\"\n>\n <!-- \u5DF2\u9009\u62E9\u7C7B\u76EEtags -->\n <acl-multi-search-tags\n #tagsRef\n [ngClass]=\"{\n 'tags-width-with-delete': $any(existingConditions$ | async)?.length,\n 'tags-width': !$any(existingConditions$ | async)?.length,\n }\"\n [placeholder]=\"placeholder\"\n [conditionCreatable]=\"conditionCreatable\"\n [existingConditions]=\"existingConditions\"\n [conditionConfig]=\"conditionConfig\"\n (removeCondition)=\"removeCondition($event)\"\n (setConditionEditing)=\"setConditionEditing($event)\"\n (setConditionDeleting)=\"setConditionDeleting($event)\"\n [showFootAction]=\"showFootAction\"\n (search)=\"doSearch()\"\n (completed)=\"complete($event)\"\n >\n <!-- \u672B\u5C3E\u8F93\u5165\u6846 -->\n <acl-multi-search-action-input\n #inputRef\n class=\"input-wrapper\"\n [isEditing]=\"true\"\n [hidden]=\"addedInputShouldHidden$ | async\"\n [placeholder]=\"placeholder\"\n [conditionCreatable]=\"conditionCreatable\"\n [conditionConfig]=\"conditionConfig\"\n [existingConditions]=\"existingConditions$ | async\"\n [autoScroll]=\"autoScroll\"\n [(ngModel)]=\"addedCondition\"\n [showFootAction]=\"showFootAction\"\n (completed)=\"complete($event)\"\n (delete)=\"setConditionDeleting()\"\n (search)=\"doSearch()\"\n ></acl-multi-search-action-input>\n </acl-multi-search-tags>\n\n <div class=\"search-suffix\">\n @if ($any(existingConditions$ | async)?.length) {\n <div class=\"search-clear\">\n <aui-icon\n class=\"tw-text-n-4 tw-cursor-pointer\"\n [ngClass]=\"CLEAR_ICON_CLASS\"\n icon=\"xmark_small\"\n size=\"14\"\n (click)=\"clearConditions(); doSearch(); $event.stopPropagation()\"\n ></aui-icon>\n </div>\n }\n @if (searchSuffix) {\n <div class=\"search-suffix\">\n <div class=\"suffix-wrapper\">\n <aui-icon\n class=\"tw-text-n-4 tw-cursor-pointer\"\n [ngClass]=\"SEARCH_ICON_CLASS\"\n icon=\"magnifier\"\n (click)=\"doSearch(); $event.stopPropagation()\"\n ></aui-icon>\n </div>\n </div>\n }\n </div>\n</div>\n", styles: [":host{min-width:0}.multi-search{min-width:240px;height:max-content;display:flex;align-items:stretch;padding:0;overflow-y:auto}.multi-search .tags-width{width:calc(100% - 30px)}.multi-search .tags-width-with-delete{width:calc(100% - 48px)}.multi-search .search-clear{width:18px;display:flex;align-items:center}.multi-search .search-clear-icon ::ng-deep .aui-icon{border-radius:50%}.multi-search .search-clear-icon ::ng-deep .aui-icon:hover{color:rgb(var(--aui-color-n-10));background-color:rgb(var(--aui-color-n-5))!important}.multi-search .search-suffix{display:flex;text-align:center}.multi-search .search-suffix .suffix-wrapper{margin-top:4px;margin-bottom:4px;height:calc(100% - 8px);border-left:solid 1px rgb(var(--aui-color-n-7));min-width:30px;display:flex;align-items:center;justify-content:center}.multi-search .search-suffix .suffix-wrapper aui-icon:hover{color:rgb(var(--aui-color-blue))}.search-focus{border-color:rgb(var(--aui-color-primary));box-shadow:0 0 0 2px rgba(var(--aui-color-primary),.16)}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: MultiSearchActionInputComponent, selector: "acl-multi-search-action-input", inputs: ["placeholder", "conditionCreatable", "isEditing", "hidden", "autoScroll", "conditionConfig", "showFootAction", "existingConditions"], outputs: ["completed", "editing", "delete", "search"] }, { kind: "component", type: MultiSearchTagsComponent, selector: "acl-multi-search-tags", inputs: ["placeholder", "conditionCreatable", "conditionConfig", "existingConditions", "showFootAction"], outputs: ["removeCondition", "setConditionEditing", "setConditionDeleting", "search", "completed"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: IconComponent, selector: "aui-icon", inputs: ["icon", "light", "dark", "link", "margin", "size", "color", "background", "backgroundColor"] }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
9317
9342
|
}
|
|
9318
9343
|
__decorate([
|
|
9319
9344
|
ObservableInput(),
|
|
@@ -9345,7 +9370,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
9345
9370
|
type: Input
|
|
9346
9371
|
}], searchSuffix: [{
|
|
9347
9372
|
type: Input
|
|
9348
|
-
}],
|
|
9373
|
+
}], search: [{
|
|
9349
9374
|
type: Output
|
|
9350
9375
|
}], showFootAction: [{
|
|
9351
9376
|
type: Input
|
|
@@ -10486,11 +10511,26 @@ const DEFAULT_PAGE_SIZE = 10;
|
|
|
10486
10511
|
const DEFAULT_PAGE_SIZE_OPTIONS = [10, 20, 50, 100];
|
|
10487
10512
|
const DEFAULT_PAGINATION_LAYOUT = 'total,pager,sizes,jumper';
|
|
10488
10513
|
|
|
10514
|
+
class TableHeaderCellDefDirective {
|
|
10515
|
+
constructor() {
|
|
10516
|
+
this.templateRef = inject((TemplateRef));
|
|
10517
|
+
}
|
|
10518
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TableHeaderCellDefDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
10519
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: TableHeaderCellDefDirective, isStandalone: true, selector: "[aclTableHeaderCellDef]", inputs: { aclTableHeaderCellDef: "aclTableHeaderCellDef" }, ngImport: i0 }); }
|
|
10520
|
+
}
|
|
10521
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TableHeaderCellDefDirective, decorators: [{
|
|
10522
|
+
type: Directive,
|
|
10523
|
+
args: [{
|
|
10524
|
+
selector: '[aclTableHeaderCellDef]',
|
|
10525
|
+
}]
|
|
10526
|
+
}], propDecorators: { aclTableHeaderCellDef: [{
|
|
10527
|
+
type: Input
|
|
10528
|
+
}] } });
|
|
10489
10529
|
class TableCellDefDirective {
|
|
10490
|
-
constructor(
|
|
10491
|
-
this.templateRef =
|
|
10530
|
+
constructor() {
|
|
10531
|
+
this.templateRef = inject((TemplateRef));
|
|
10492
10532
|
}
|
|
10493
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TableCellDefDirective, deps: [
|
|
10533
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TableCellDefDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
10494
10534
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.1", type: TableCellDefDirective, isStandalone: true, selector: "[aclTableCellDef]", inputs: { aclTableCellDef: "aclTableCellDef" }, ngImport: i0 }); }
|
|
10495
10535
|
}
|
|
10496
10536
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TableCellDefDirective, decorators: [{
|
|
@@ -10499,7 +10539,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
10499
10539
|
selector: '[aclTableCellDef]',
|
|
10500
10540
|
standalone: true,
|
|
10501
10541
|
}]
|
|
10502
|
-
}],
|
|
10542
|
+
}], propDecorators: { aclTableCellDef: [{
|
|
10503
10543
|
type: Input
|
|
10504
10544
|
}] } });
|
|
10505
10545
|
|
|
@@ -10520,8 +10560,8 @@ function defaultSorter(a, b) {
|
|
|
10520
10560
|
|
|
10521
10561
|
const KNOWN_COLUMNS = new Set([NAME, CREATOR, CREATED_AT]);
|
|
10522
10562
|
class TableUtilService {
|
|
10523
|
-
constructor(
|
|
10524
|
-
this.k8sUtil =
|
|
10563
|
+
constructor() {
|
|
10564
|
+
this.k8sUtil = inject(K8sUtilService);
|
|
10525
10565
|
this.getValueFromPath = this.getValueFromPath.bind(this);
|
|
10526
10566
|
this.defaultFilterFn = this.defaultFilterFn.bind(this);
|
|
10527
10567
|
}
|
|
@@ -10545,6 +10585,11 @@ class TableUtilService {
|
|
|
10545
10585
|
? this.k8sUtil.getName(item)
|
|
10546
10586
|
: get(item, NAME);
|
|
10547
10587
|
}
|
|
10588
|
+
case NAMESPACE$1: {
|
|
10589
|
+
return isK8s
|
|
10590
|
+
? this.k8sUtil.getNamespace(item)
|
|
10591
|
+
: get(item, NAMESPACE$1);
|
|
10592
|
+
}
|
|
10548
10593
|
case CREATOR: {
|
|
10549
10594
|
return isK8s
|
|
10550
10595
|
? this.k8sUtil.getCreator(item)
|
|
@@ -10557,7 +10602,6 @@ class TableUtilService {
|
|
|
10557
10602
|
}
|
|
10558
10603
|
}
|
|
10559
10604
|
}
|
|
10560
|
-
// eslint-disable-next-line sonarjs/cognitive-complexity
|
|
10561
10605
|
defaultFilterFn(items, columnDefs, activeSort, filterParams, context) {
|
|
10562
10606
|
context = context ?? this;
|
|
10563
10607
|
if (items && filterParams) {
|
|
@@ -10579,7 +10623,7 @@ class TableUtilService {
|
|
|
10579
10623
|
}
|
|
10580
10624
|
return items;
|
|
10581
10625
|
}
|
|
10582
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TableUtilService, deps: [
|
|
10626
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TableUtilService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
10583
10627
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TableUtilService, providedIn: 'root' }); }
|
|
10584
10628
|
}
|
|
10585
10629
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TableUtilService, decorators: [{
|
|
@@ -10587,10 +10631,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
10587
10631
|
args: [{
|
|
10588
10632
|
providedIn: 'root',
|
|
10589
10633
|
}]
|
|
10590
|
-
}], ctorParameters: () => [
|
|
10591
|
-
type: Inject,
|
|
10592
|
-
args: [K8sUtilService]
|
|
10593
|
-
}] }] });
|
|
10634
|
+
}], ctorParameters: () => [] });
|
|
10594
10635
|
|
|
10595
10636
|
class TableComponent {
|
|
10596
10637
|
get finalContext() {
|
|
@@ -11180,6 +11221,116 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
11180
11221
|
}]
|
|
11181
11222
|
}] });
|
|
11182
11223
|
|
|
11224
|
+
class TerminatingTagComponent {
|
|
11225
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TerminatingTagComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
11226
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: TerminatingTagComponent, isStandalone: true, selector: "acl-deleting-tag", inputs: { resource: "resource" }, ngImport: i0, template: "@if (resource?.metadata?.deletionTimestamp) {\n <aui-tag\n type=\"error\"\n size=\"mini\"\n [border]=\"true\"\n >\n {{ 'deleting' | translate }}\n </aui-tag>\n}\n", styles: ["aui-tag{display:inline-block;margin-left:8px;vertical-align:2px}\n"], dependencies: [{ kind: "component", type: TagComponent, selector: "aui-tag", inputs: ["type", "size", "closeable", "border", "solid", "invalid", "round", "color", "allowClick"], outputs: ["close"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
11227
|
+
}
|
|
11228
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: TerminatingTagComponent, decorators: [{
|
|
11229
|
+
type: Component,
|
|
11230
|
+
args: [{ selector: 'acl-deleting-tag', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [TagComponent, TranslatePipe], template: "@if (resource?.metadata?.deletionTimestamp) {\n <aui-tag\n type=\"error\"\n size=\"mini\"\n [border]=\"true\"\n >\n {{ 'deleting' | translate }}\n </aui-tag>\n}\n", styles: ["aui-tag{display:inline-block;margin-left:8px;vertical-align:2px}\n"] }]
|
|
11231
|
+
}], propDecorators: { resource: [{
|
|
11232
|
+
type: Input
|
|
11233
|
+
}] } });
|
|
11234
|
+
|
|
11235
|
+
class PluginClusterSelectorComponent {
|
|
11236
|
+
constructor() {
|
|
11237
|
+
this.valueChange = new EventEmitter();
|
|
11238
|
+
this.isActive = false;
|
|
11239
|
+
this.popupService = inject(ResourceSelectorPopupService);
|
|
11240
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
11241
|
+
this.elementRef = inject(ElementRef);
|
|
11242
|
+
this.http = inject(HttpClient);
|
|
11243
|
+
this.projectApi = inject(ProjectService);
|
|
11244
|
+
this.displayFields = [
|
|
11245
|
+
ConfigurableField.Status,
|
|
11246
|
+
ConfigurableField.Time,
|
|
11247
|
+
];
|
|
11248
|
+
this.filterClusters$ = this.disabled$.pipe(distinctUntilChanged(isEqual), switchMap(disabled => disabled
|
|
11249
|
+
? EMPTY$1
|
|
11250
|
+
: this.projectApi
|
|
11251
|
+
.getProjects()
|
|
11252
|
+
.pipe(map(projects => projects
|
|
11253
|
+
?.find(p => p.metadata.name === this.projectName)
|
|
11254
|
+
?.spec?.clusters?.map(r => r.name)))), publishRef());
|
|
11255
|
+
}
|
|
11256
|
+
getFilterFn(filterClusters) {
|
|
11257
|
+
return (clusters) => {
|
|
11258
|
+
if (!filterClusters?.length) {
|
|
11259
|
+
return clusters;
|
|
11260
|
+
}
|
|
11261
|
+
return clusters.filter(c => filterClusters.includes(c.name));
|
|
11262
|
+
};
|
|
11263
|
+
}
|
|
11264
|
+
ngAfterViewInit() {
|
|
11265
|
+
this.http
|
|
11266
|
+
.get(`${API_GATEWAY$1}/auth/v1/clusters`)
|
|
11267
|
+
.pipe(map(list => list.items), catchError(() => of([])))
|
|
11268
|
+
.subscribe(clusters => {
|
|
11269
|
+
this.onSelect({ name: clusters[0].metadata.name });
|
|
11270
|
+
});
|
|
11271
|
+
}
|
|
11272
|
+
openPopup() {
|
|
11273
|
+
if (this.disabled) {
|
|
11274
|
+
return;
|
|
11275
|
+
}
|
|
11276
|
+
if (this.isActive) {
|
|
11277
|
+
this.closePopup();
|
|
11278
|
+
}
|
|
11279
|
+
else {
|
|
11280
|
+
this.isActive = true;
|
|
11281
|
+
this.popupRef = this.popupService.open({
|
|
11282
|
+
origin: this.elementRef,
|
|
11283
|
+
content: this.popupTemplate,
|
|
11284
|
+
});
|
|
11285
|
+
this.popupRef.afterClosed().subscribe(() => {
|
|
11286
|
+
this.isActive = false;
|
|
11287
|
+
this.cdr.markForCheck();
|
|
11288
|
+
});
|
|
11289
|
+
}
|
|
11290
|
+
}
|
|
11291
|
+
closePopup() {
|
|
11292
|
+
if (this.isActive) {
|
|
11293
|
+
this.isActive = false;
|
|
11294
|
+
this.popupRef.close();
|
|
11295
|
+
}
|
|
11296
|
+
}
|
|
11297
|
+
onSelect(item) {
|
|
11298
|
+
this.value = item.name;
|
|
11299
|
+
this.valueChange.emit(item.name);
|
|
11300
|
+
this.closePopup();
|
|
11301
|
+
}
|
|
11302
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: PluginClusterSelectorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
11303
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "16.1.0", version: "21.1.1", type: PluginClusterSelectorComponent, isStandalone: true, selector: "acl-plugin-cluster-selector", inputs: { value: "value", disabled: ["disabled", "disabled", booleanAttribute], projectName: "projectName", fields: "fields" }, outputs: { valueChange: "valueChange" }, viewQueries: [{ propertyName: "popupTemplate", first: true, predicate: ["popup"], descendants: true, static: true }], ngImport: i0, template: "<div\n class=\"acl-resource-selector acl-resource-selector--bg\"\n [ngClass]=\"{\n 'acl-resource-selector--active': isActive,\n 'acl-resource-selector--disabled': disabled,\n }\"\n (click)=\"openPopup()\"\n>\n <div class=\"acl-resource-selector__item project\">\n <span class=\"icon-wrapper tw-flex\">\n <aui-icon icon=\"bicolor:server\"></aui-icon>\n </span>\n <span class=\"with-colon\">\n {{ 'cluster' | translate }}\n </span>\n <span class=\"selected-name text-truncate\">{{ value }}</span>\n </div>\n <div class=\"acl-resource-selector__arrow\">\n <aui-icon icon=\"caret_down_s\"></aui-icon>\n </div>\n</div>\n\n<ng-template #popup>\n <acl-cluster-list\n context=\"popup\"\n [fields]=\"fields || displayFields\"\n [filterFn]=\"getFilterFn(filterClusters$ | async)\"\n [value]=\"value\"\n (selectItem)=\"onSelect($event)\"\n ></acl-cluster-list>\n</ng-template>\n", styles: [":host{display:flex}:host::ng-deep .icon-wrapper{position:relative;display:flex;justify-content:center;align-items:center;width:16px;height:16px;flex-shrink:0;font-size:var(--aui-icon-size-m)}:root :host::ng-deep .icon-wrapper{--bicolor-main: rgb(var(--aui-color-primary));--bicolor-secondary: rgb(var(--aui-color-p-3))}html[aui-theme-mode=light] :host::ng-deep .icon-wrapper{--bicolor-main: rgb(var(--aui-color-primary));--bicolor-secondary: rgb(var(--aui-color-p-3))}@media(prefers-color-scheme:dark){html[aui-theme-mode=system] :host::ng-deep .icon-wrapper{--bicolor-main: rgb(var(--aui-color-primary));--bicolor-secondary: rgb(var(--aui-color-p-3))}}html[aui-theme-mode=dark] :host::ng-deep .icon-wrapper{--bicolor-main: rgb(var(--aui-color-primary));--bicolor-secondary: rgb(var(--aui-color-p-3))}:host::ng-deep .with-colon{display:inline-flex;word-break:keep-all;flex-shrink:0;font-weight:500}:host::ng-deep .with-colon:after{content:\":\";margin-right:8px}:host::ng-deep .text-truncate{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}:host::ng-deep .acl-resource-selector{user-select:none;display:flex;color:var(--acl-page-header-title-color);cursor:pointer;padding:0 8px}:host::ng-deep .acl-resource-selector .selected-name{color:var(--acl-page-header-text-color)}:host::ng-deep .acl-resource-selector--active,:host::ng-deep .acl-resource-selector:not(.acl-resource-selector--disabled):hover{background-color:rgb(var(--aui-color-primary));color:#fff;border-radius:2px}:root :host::ng-deep .acl-resource-selector--active .icon-wrapper,:root :host::ng-deep .acl-resource-selector:not(.acl-resource-selector--disabled):hover .icon-wrapper{--bicolor-main: white;--bicolor-secondary: rgb(var(--aui-color-p-4))}html[aui-theme-mode=light] :host::ng-deep .acl-resource-selector--active .icon-wrapper,html[aui-theme-mode=light] :host::ng-deep .acl-resource-selector:not(.acl-resource-selector--disabled):hover .icon-wrapper{--bicolor-main: white;--bicolor-secondary: rgb(var(--aui-color-p-4))}@media(prefers-color-scheme:dark){html[aui-theme-mode=system] :host::ng-deep .acl-resource-selector--active .icon-wrapper,html[aui-theme-mode=system] :host::ng-deep .acl-resource-selector:not(.acl-resource-selector--disabled):hover .icon-wrapper{--bicolor-main: white;--bicolor-secondary: #b3d7fc}}html[aui-theme-mode=dark] :host::ng-deep .acl-resource-selector--active .icon-wrapper,html[aui-theme-mode=dark] :host::ng-deep .acl-resource-selector:not(.acl-resource-selector--disabled):hover .icon-wrapper{--bicolor-main: white;--bicolor-secondary: #b3d7fc}:host::ng-deep .acl-resource-selector--active .selected-name,:host::ng-deep .acl-resource-selector:not(.acl-resource-selector--disabled):hover .selected-name{color:#fff}:host::ng-deep .acl-resource-selector--disabled{cursor:not-allowed}:host::ng-deep .acl-resource-selector--bg{background-color:rgb(var(--aui-color-p-6));flex:1}:host::ng-deep .acl-resource-selector__item{margin-right:20px;height:32px;display:inline-flex;align-items:center;font-size:12px;max-width:270px}@media screen and (width<=1280px){:host::ng-deep .acl-resource-selector__item{max-width:178px;margin-right:8px}}:host::ng-deep .acl-resource-selector__item .icon-wrapper{margin-right:4px}:host::ng-deep .acl-resource-selector__arrow{margin-left:-16px;align-items:center;display:inline-flex;width:16px;justify-content:center}@media screen and (width<=1280px){:host::ng-deep .acl-resource-selector__arrow{margin-left:-4px}}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ClusterListComponent, selector: "acl-cluster-list", inputs: ["value", "filterFn"] }, { kind: "component", type: IconComponent, selector: "aui-icon", inputs: ["icon", "light", "dark", "link", "margin", "size", "color", "background", "backgroundColor"] }, { kind: "pipe", type: i1$1.AsyncPipe, name: "async" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
11304
|
+
}
|
|
11305
|
+
__decorate([
|
|
11306
|
+
ObservableInput(),
|
|
11307
|
+
__metadata("design:type", Observable)
|
|
11308
|
+
], PluginClusterSelectorComponent.prototype, "disabled$", void 0);
|
|
11309
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: PluginClusterSelectorComponent, decorators: [{
|
|
11310
|
+
type: Component,
|
|
11311
|
+
args: [{ selector: 'acl-plugin-cluster-selector', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
11312
|
+
CommonModule,
|
|
11313
|
+
ClusterListComponent,
|
|
11314
|
+
NgClass,
|
|
11315
|
+
IconComponent,
|
|
11316
|
+
TranslatePipe,
|
|
11317
|
+
], template: "<div\n class=\"acl-resource-selector acl-resource-selector--bg\"\n [ngClass]=\"{\n 'acl-resource-selector--active': isActive,\n 'acl-resource-selector--disabled': disabled,\n }\"\n (click)=\"openPopup()\"\n>\n <div class=\"acl-resource-selector__item project\">\n <span class=\"icon-wrapper tw-flex\">\n <aui-icon icon=\"bicolor:server\"></aui-icon>\n </span>\n <span class=\"with-colon\">\n {{ 'cluster' | translate }}\n </span>\n <span class=\"selected-name text-truncate\">{{ value }}</span>\n </div>\n <div class=\"acl-resource-selector__arrow\">\n <aui-icon icon=\"caret_down_s\"></aui-icon>\n </div>\n</div>\n\n<ng-template #popup>\n <acl-cluster-list\n context=\"popup\"\n [fields]=\"fields || displayFields\"\n [filterFn]=\"getFilterFn(filterClusters$ | async)\"\n [value]=\"value\"\n (selectItem)=\"onSelect($event)\"\n ></acl-cluster-list>\n</ng-template>\n", styles: [":host{display:flex}:host::ng-deep .icon-wrapper{position:relative;display:flex;justify-content:center;align-items:center;width:16px;height:16px;flex-shrink:0;font-size:var(--aui-icon-size-m)}:root :host::ng-deep .icon-wrapper{--bicolor-main: rgb(var(--aui-color-primary));--bicolor-secondary: rgb(var(--aui-color-p-3))}html[aui-theme-mode=light] :host::ng-deep .icon-wrapper{--bicolor-main: rgb(var(--aui-color-primary));--bicolor-secondary: rgb(var(--aui-color-p-3))}@media(prefers-color-scheme:dark){html[aui-theme-mode=system] :host::ng-deep .icon-wrapper{--bicolor-main: rgb(var(--aui-color-primary));--bicolor-secondary: rgb(var(--aui-color-p-3))}}html[aui-theme-mode=dark] :host::ng-deep .icon-wrapper{--bicolor-main: rgb(var(--aui-color-primary));--bicolor-secondary: rgb(var(--aui-color-p-3))}:host::ng-deep .with-colon{display:inline-flex;word-break:keep-all;flex-shrink:0;font-weight:500}:host::ng-deep .with-colon:after{content:\":\";margin-right:8px}:host::ng-deep .text-truncate{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}:host::ng-deep .acl-resource-selector{user-select:none;display:flex;color:var(--acl-page-header-title-color);cursor:pointer;padding:0 8px}:host::ng-deep .acl-resource-selector .selected-name{color:var(--acl-page-header-text-color)}:host::ng-deep .acl-resource-selector--active,:host::ng-deep .acl-resource-selector:not(.acl-resource-selector--disabled):hover{background-color:rgb(var(--aui-color-primary));color:#fff;border-radius:2px}:root :host::ng-deep .acl-resource-selector--active .icon-wrapper,:root :host::ng-deep .acl-resource-selector:not(.acl-resource-selector--disabled):hover .icon-wrapper{--bicolor-main: white;--bicolor-secondary: rgb(var(--aui-color-p-4))}html[aui-theme-mode=light] :host::ng-deep .acl-resource-selector--active .icon-wrapper,html[aui-theme-mode=light] :host::ng-deep .acl-resource-selector:not(.acl-resource-selector--disabled):hover .icon-wrapper{--bicolor-main: white;--bicolor-secondary: rgb(var(--aui-color-p-4))}@media(prefers-color-scheme:dark){html[aui-theme-mode=system] :host::ng-deep .acl-resource-selector--active .icon-wrapper,html[aui-theme-mode=system] :host::ng-deep .acl-resource-selector:not(.acl-resource-selector--disabled):hover .icon-wrapper{--bicolor-main: white;--bicolor-secondary: #b3d7fc}}html[aui-theme-mode=dark] :host::ng-deep .acl-resource-selector--active .icon-wrapper,html[aui-theme-mode=dark] :host::ng-deep .acl-resource-selector:not(.acl-resource-selector--disabled):hover .icon-wrapper{--bicolor-main: white;--bicolor-secondary: #b3d7fc}:host::ng-deep .acl-resource-selector--active .selected-name,:host::ng-deep .acl-resource-selector:not(.acl-resource-selector--disabled):hover .selected-name{color:#fff}:host::ng-deep .acl-resource-selector--disabled{cursor:not-allowed}:host::ng-deep .acl-resource-selector--bg{background-color:rgb(var(--aui-color-p-6));flex:1}:host::ng-deep .acl-resource-selector__item{margin-right:20px;height:32px;display:inline-flex;align-items:center;font-size:12px;max-width:270px}@media screen and (width<=1280px){:host::ng-deep .acl-resource-selector__item{max-width:178px;margin-right:8px}}:host::ng-deep .acl-resource-selector__item .icon-wrapper{margin-right:4px}:host::ng-deep .acl-resource-selector__arrow{margin-left:-16px;align-items:center;display:inline-flex;width:16px;justify-content:center}@media screen and (width<=1280px){:host::ng-deep .acl-resource-selector__arrow{margin-left:-4px}}\n"] }]
|
|
11318
|
+
}], propDecorators: { value: [{
|
|
11319
|
+
type: Input
|
|
11320
|
+
}], valueChange: [{
|
|
11321
|
+
type: Output
|
|
11322
|
+
}], disabled: [{
|
|
11323
|
+
type: Input,
|
|
11324
|
+
args: [{ transform: booleanAttribute }]
|
|
11325
|
+
}], disabled$: [], projectName: [{
|
|
11326
|
+
type: Input
|
|
11327
|
+
}], popupTemplate: [{
|
|
11328
|
+
type: ViewChild,
|
|
11329
|
+
args: ['popup', { static: true }]
|
|
11330
|
+
}], fields: [{
|
|
11331
|
+
type: Input
|
|
11332
|
+
}] } });
|
|
11333
|
+
|
|
11183
11334
|
class UpdateDescriptionDialogComponent {
|
|
11184
11335
|
constructor(dialogRef, k8sApi, k8sUtil, data) {
|
|
11185
11336
|
this.dialogRef = dialogRef;
|
|
@@ -12211,6 +12362,113 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
12211
12362
|
type: Input
|
|
12212
12363
|
}], kind: [{ type: i0.Input, args: [{ isSignal: true, alias: "kind", required: false }] }], apiVersion: [{ type: i0.Input, args: [{ isSignal: true, alias: "apiVersion", required: false }] }], resource: [{ type: i0.Input, args: [{ isSignal: true, alias: "resource", required: false }] }] } });
|
|
12213
12364
|
|
|
12365
|
+
class KubernetesSchemaService {
|
|
12366
|
+
constructor() {
|
|
12367
|
+
this.http = inject(HttpClient);
|
|
12368
|
+
this.initialized = false;
|
|
12369
|
+
this.schemaCache = new Map();
|
|
12370
|
+
this.schemaCache$$ = new BehaviorSubject(new Map());
|
|
12371
|
+
this.getDefinitionKey = memoize((k8sResourceDefinition, definitions) => {
|
|
12372
|
+
return findKey(definitions, (def) => {
|
|
12373
|
+
return some(def['x-kubernetes-group-version-kind'], ({ group, version, kind }) => {
|
|
12374
|
+
return ((k8sResourceDefinition?.apiGroup ?? '') === (group || '') &&
|
|
12375
|
+
k8sResourceDefinition?.apiVersion === version &&
|
|
12376
|
+
k8sResourceDefinition?.kind === kind);
|
|
12377
|
+
});
|
|
12378
|
+
});
|
|
12379
|
+
}, k8sResourceDefinition => {
|
|
12380
|
+
return [
|
|
12381
|
+
k8sResourceDefinition.apiGroup || 'core',
|
|
12382
|
+
k8sResourceDefinition.apiVersion,
|
|
12383
|
+
k8sResourceDefinition.kind,
|
|
12384
|
+
].join('~');
|
|
12385
|
+
});
|
|
12386
|
+
}
|
|
12387
|
+
// 延迟初始化方法
|
|
12388
|
+
ensureInitialized() {
|
|
12389
|
+
if (!this.initialized) {
|
|
12390
|
+
this.clearCache();
|
|
12391
|
+
this.initialized = true;
|
|
12392
|
+
}
|
|
12393
|
+
}
|
|
12394
|
+
/**
|
|
12395
|
+
* 获取当前集群的 OpenAPI schema
|
|
12396
|
+
*/
|
|
12397
|
+
getOpenAPISchema(cluster) {
|
|
12398
|
+
this.ensureInitialized();
|
|
12399
|
+
const cached = this.schemaCache.get(cluster);
|
|
12400
|
+
if (cached) {
|
|
12401
|
+
return of(cached);
|
|
12402
|
+
}
|
|
12403
|
+
return this.fetchOpenAPISchema(cluster).pipe(tap(schema => {
|
|
12404
|
+
if (schema) {
|
|
12405
|
+
this.schemaCache.set(cluster, schema);
|
|
12406
|
+
this.schemaCache$$.next(new Map(this.schemaCache));
|
|
12407
|
+
}
|
|
12408
|
+
}), catchError(error => {
|
|
12409
|
+
console.error(`Failed to fetch OpenAPI schema for cluster ${cluster}:`, error);
|
|
12410
|
+
return of(null);
|
|
12411
|
+
}), shareReplay(1));
|
|
12412
|
+
}
|
|
12413
|
+
/**
|
|
12414
|
+
* 根据 Kubernetes 资源类型获取对应的 schema
|
|
12415
|
+
*/
|
|
12416
|
+
getResourceSchema(apiVersion, kind, cluster) {
|
|
12417
|
+
return this.getOpenAPISchema(cluster).pipe(switchMap(openApiDoc => {
|
|
12418
|
+
if (!openApiDoc?.definitions) {
|
|
12419
|
+
return of(null);
|
|
12420
|
+
}
|
|
12421
|
+
const parts = apiVersion.split('/');
|
|
12422
|
+
const group = parts.length === 1 ? '' : parts[0];
|
|
12423
|
+
const version = parts.length === 1 ? parts[0] : parts[1];
|
|
12424
|
+
const definitionKey = this.getDefinitionKey({
|
|
12425
|
+
apiGroup: group,
|
|
12426
|
+
apiVersion: version,
|
|
12427
|
+
kind,
|
|
12428
|
+
}, openApiDoc.definitions);
|
|
12429
|
+
const schema = openApiDoc.definitions[definitionKey];
|
|
12430
|
+
return of(schema || null);
|
|
12431
|
+
}));
|
|
12432
|
+
}
|
|
12433
|
+
/**
|
|
12434
|
+
* 获取所有可用的资源定义
|
|
12435
|
+
*/
|
|
12436
|
+
getAllResourceDefinitions(cluster) {
|
|
12437
|
+
return this.getOpenAPISchema(cluster).pipe(switchMap(openApiDoc => {
|
|
12438
|
+
return of(openApiDoc?.definitions || null);
|
|
12439
|
+
}));
|
|
12440
|
+
}
|
|
12441
|
+
/**
|
|
12442
|
+
* 清理缓存
|
|
12443
|
+
*/
|
|
12444
|
+
clearCache() {
|
|
12445
|
+
this.schemaCache.clear();
|
|
12446
|
+
this.schemaCache$$.next(new Map());
|
|
12447
|
+
}
|
|
12448
|
+
/**
|
|
12449
|
+
* 获取缓存状态
|
|
12450
|
+
*/
|
|
12451
|
+
getCacheStatus() {
|
|
12452
|
+
return this.schemaCache$$.asObservable();
|
|
12453
|
+
}
|
|
12454
|
+
/**
|
|
12455
|
+
* 从 Kubernetes API 获取 OpenAPI schema
|
|
12456
|
+
*/
|
|
12457
|
+
fetchOpenAPISchema(cluster) {
|
|
12458
|
+
const url = `${API_GATEWAY$1}/kubernetes/${cluster}/openapi/v2`;
|
|
12459
|
+
return this.http.get(url).pipe(debounceTime(500), catchError(error => {
|
|
12460
|
+
console.error(`Failed to fetch OpenAPI schema for cluster ${cluster}:`, error);
|
|
12461
|
+
return of(null);
|
|
12462
|
+
}));
|
|
12463
|
+
}
|
|
12464
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: KubernetesSchemaService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
12465
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: KubernetesSchemaService, providedIn: 'root' }); }
|
|
12466
|
+
}
|
|
12467
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: KubernetesSchemaService, decorators: [{
|
|
12468
|
+
type: Injectable,
|
|
12469
|
+
args: [{ providedIn: 'root' }]
|
|
12470
|
+
}] });
|
|
12471
|
+
|
|
12214
12472
|
/**
|
|
12215
12473
|
* @packageDocumentation
|
|
12216
12474
|
* @module k8s-shared
|
|
@@ -12231,7 +12489,7 @@ class CodeDisplayDialogComponent {
|
|
|
12231
12489
|
};
|
|
12232
12490
|
}
|
|
12233
12491
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: CodeDisplayDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12234
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: CodeDisplayDialogComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<aui-dialog-header [divider]=\"false\">\n <div [class.ellipsis-dialog-header]=\"data.ellipsis\">\n <span [class.text-ellipsis]=\"data.ellipsis\">\n {{ data.title || ('view_yaml' | translate) }}\n </span>\n @if (data.extra) {\n <span class=\"extra\">{{ data.extra }}</span>\n }\n </div>\n</aui-dialog-header>\n<aui-dialog-content>\n <aui-code-editor\n style=\"display: block; height: 65vh\"\n [ngModel]=\"data.code || ''\"\n [options]=\"codeEditorOptions\"\n [actionsConfig]=\"editorActions\"\n ></aui-code-editor>\n</aui-dialog-content>\n", dependencies: [{ kind: "component", type: i1.DialogHeaderComponent, selector: "aui-dialog-header", inputs: ["divider", "closeable", "result"] }, { kind: "component", type: i1.DialogContentComponent, selector: "aui-dialog-content" }, { kind: "ngmodule", type: CodeEditorModule }, { kind: "component", type:
|
|
12492
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: CodeDisplayDialogComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<aui-dialog-header [divider]=\"false\">\n <div [class.ellipsis-dialog-header]=\"data.ellipsis\">\n <span [class.text-ellipsis]=\"data.ellipsis\">\n {{ data.title || ('view_yaml' | translate) }}\n </span>\n @if (data.extra) {\n <span class=\"extra\">{{ data.extra }}</span>\n }\n </div>\n</aui-dialog-header>\n<aui-dialog-content>\n <aui-code-editor\n style=\"display: block; height: 65vh\"\n [ngModel]=\"data.code || ''\"\n [options]=\"codeEditorOptions\"\n [actionsConfig]=\"editorActions\"\n ></aui-code-editor>\n</aui-dialog-content>\n", dependencies: [{ kind: "component", type: i1.DialogHeaderComponent, selector: "aui-dialog-header", inputs: ["divider", "closeable", "result"] }, { kind: "component", type: i1.DialogContentComponent, selector: "aui-dialog-content" }, { kind: "ngmodule", type: CodeEditorModule }, { kind: "component", type: i3.CodeEditorComponent, selector: "aui-code-editor", inputs: ["options", "plain", "showLanguageLabel", "value", "originalValue", "actionsConfig", "previewMode", "diffMode", "modelUri"], outputs: ["editorChange", "editorBlur"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
12235
12493
|
}
|
|
12236
12494
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: CodeDisplayDialogComponent, decorators: [{
|
|
12237
12495
|
type: Component,
|
|
@@ -12261,7 +12519,7 @@ class ResourceYamlDisplayComponent {
|
|
|
12261
12519
|
}
|
|
12262
12520
|
}
|
|
12263
12521
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceYamlDisplayComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
12264
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: ResourceYamlDisplayComponent, isStandalone: true, selector: "acl-resource-yaml-display", inputs: { hasWrapper: "hasWrapper", conciseEnable: "conciseEnable", manageFieldActionEnable: "manageFieldActionEnable", resource: "resource" }, ngImport: i0, template: "@if (hasWrapper) {\n <aui-card>\n <ng-container *ngTemplateOutlet=\"content\" />\n </aui-card>\n} @else {\n <aui-code-editor\n name=\"yaml\"\n [ngModel]=\"yaml$ | async\"\n [options]=\"editorOptions\"\n [actionsConfig]=\"viewActions\"\n >\n <ng-container auiCodeEditorToolbarLeft>\n @if (conciseEnable) {\n <aui-checkbox\n class=\"aui-code-editor-toolbar__control-button\"\n [ngModel]=\"concise$$ | async\"\n (ngModelChange)=\"conciseChange($event)\"\n >\n {{ 'preview_concise_yaml' | translate }}\n </aui-checkbox>\n }\n @if (manageFieldActionEnable) {\n <aui-checkbox\n [hidden]=\"concise$$ | async\"\n class=\"aui-code-editor-toolbar__control-button\"\n [ngModel]=\"reduce$$ | async\"\n (ngModelChange)=\"reduce$$.next($event)\"\n >\n {{ 'hide_manage_fields_field' | translate }}\n </aui-checkbox>\n }\n </ng-container>\n </aui-code-editor>\n}\n<ng-template #content>\n <aui-code-editor\n name=\"yaml\"\n [ngModel]=\"yaml$ | async\"\n [options]=\"editorOptions\"\n [actionsConfig]=\"viewActions\"\n >\n <ng-container auiCodeEditorToolbarLeft>\n @if (conciseEnable) {\n <aui-checkbox\n class=\"aui-code-editor-toolbar__control-button\"\n [ngModel]=\"concise$$ | async\"\n (ngModelChange)=\"conciseChange($event)\"\n >\n {{ 'preview_concise_yaml' | translate }}\n </aui-checkbox>\n }\n @if (manageFieldActionEnable) {\n <aui-checkbox\n [hidden]=\"concise$$ | async\"\n class=\"aui-code-editor-toolbar__control-button\"\n [ngModel]=\"reduce$$ | async\"\n (ngModelChange)=\"reduce$$.next($event)\"\n >\n {{ 'hide_manage_fields_field' | translate }}\n </aui-checkbox>\n }\n </ng-container>\n </aui-code-editor>\n</ng-template>\n", styles: [":host(:not(.dialog-content)) ::ng-deep .aui-code-editor{min-height:100%}:host(:not(.dialog-content)){display:block;height:calc(100vh - (var(--acl-page-header-height) + 44px) - 147px)}:host(:not(.dialog-content))>.aui-card{height:100%}:host(:not(.dialog-content))>.aui-card .aui-card__content,:host(:not(.dialog-content))>.aui-card aui-code-editor,:host(:not(.dialog-content))>.aui-card .aui-code-editor{height:100%;min-height:100%}:host{display:block}:host ::ng-deep aui-card,:host ::ng-deep .aui-card,:host ::ng-deep .aui-card__content{height:100%}:host ::ng-deep .aui-checkbox{margin-right:0}:host aui-code-editor{height:100%}\n"], dependencies: [{ kind: "component", type: i1.CardComponent, selector: "aui-card", inputs: ["divider"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1.CheckboxComponent, selector: "aui-checkbox", inputs: ["name", "type", "label", "indeterminate"] }, { kind: "ngmodule", type: CodeEditorModule }, { kind: "component", type:
|
|
12522
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: ResourceYamlDisplayComponent, isStandalone: true, selector: "acl-resource-yaml-display", inputs: { hasWrapper: "hasWrapper", conciseEnable: "conciseEnable", manageFieldActionEnable: "manageFieldActionEnable", resource: "resource" }, ngImport: i0, template: "@if (hasWrapper) {\n <aui-card>\n <ng-container *ngTemplateOutlet=\"content\" />\n </aui-card>\n} @else {\n <aui-code-editor\n name=\"yaml\"\n [ngModel]=\"yaml$ | async\"\n [options]=\"editorOptions\"\n [actionsConfig]=\"viewActions\"\n >\n <ng-container auiCodeEditorToolbarLeft>\n @if (conciseEnable) {\n <aui-checkbox\n class=\"aui-code-editor-toolbar__control-button\"\n [ngModel]=\"concise$$ | async\"\n (ngModelChange)=\"conciseChange($event)\"\n >\n {{ 'preview_concise_yaml' | translate }}\n </aui-checkbox>\n }\n @if (manageFieldActionEnable) {\n <aui-checkbox\n [hidden]=\"concise$$ | async\"\n class=\"aui-code-editor-toolbar__control-button\"\n [ngModel]=\"reduce$$ | async\"\n (ngModelChange)=\"reduce$$.next($event)\"\n >\n {{ 'hide_manage_fields_field' | translate }}\n </aui-checkbox>\n }\n </ng-container>\n </aui-code-editor>\n}\n<ng-template #content>\n <aui-code-editor\n name=\"yaml\"\n [ngModel]=\"yaml$ | async\"\n [options]=\"editorOptions\"\n [actionsConfig]=\"viewActions\"\n >\n <ng-container auiCodeEditorToolbarLeft>\n @if (conciseEnable) {\n <aui-checkbox\n class=\"aui-code-editor-toolbar__control-button\"\n [ngModel]=\"concise$$ | async\"\n (ngModelChange)=\"conciseChange($event)\"\n >\n {{ 'preview_concise_yaml' | translate }}\n </aui-checkbox>\n }\n @if (manageFieldActionEnable) {\n <aui-checkbox\n [hidden]=\"concise$$ | async\"\n class=\"aui-code-editor-toolbar__control-button\"\n [ngModel]=\"reduce$$ | async\"\n (ngModelChange)=\"reduce$$.next($event)\"\n >\n {{ 'hide_manage_fields_field' | translate }}\n </aui-checkbox>\n }\n </ng-container>\n </aui-code-editor>\n</ng-template>\n", styles: [":host(:not(.dialog-content)) ::ng-deep .aui-code-editor{min-height:100%}:host(:not(.dialog-content)){display:block;height:calc(100vh - (var(--acl-page-header-height) + 44px) - 147px)}:host(:not(.dialog-content))>.aui-card{height:100%}:host(:not(.dialog-content))>.aui-card .aui-card__content,:host(:not(.dialog-content))>.aui-card aui-code-editor,:host(:not(.dialog-content))>.aui-card .aui-code-editor{height:100%;min-height:100%}:host{display:block}:host ::ng-deep aui-card,:host ::ng-deep .aui-card,:host ::ng-deep .aui-card__content{height:100%}:host ::ng-deep .aui-checkbox{margin-right:0}:host aui-code-editor{height:100%}\n"], dependencies: [{ kind: "component", type: i1.CardComponent, selector: "aui-card", inputs: ["divider"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i1.CheckboxComponent, selector: "aui-checkbox", inputs: ["name", "type", "label", "indeterminate"] }, { kind: "ngmodule", type: CodeEditorModule }, { kind: "component", type: i3.CodeEditorComponent, selector: "aui-code-editor", inputs: ["options", "plain", "showLanguageLabel", "value", "originalValue", "actionsConfig", "previewMode", "diffMode", "modelUri"], outputs: ["editorChange", "editorBlur"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
12265
12523
|
}
|
|
12266
12524
|
__decorate([
|
|
12267
12525
|
ObservableInput(),
|
|
@@ -12304,6 +12562,1104 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImpor
|
|
|
12304
12562
|
args: [{ preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [DIALOG_MODULE, TranslatePipe, ResourceYamlDisplayComponent], template: "<aui-dialog-header [divider]=\"false\">\n <div [class.ellipsis-dialog-header]=\"data.ellipsis\">\n <span [class.text-ellipsis]=\"data.ellipsis\">\n {{ data.title || ('view_yaml' | translate) }}\n </span>\n @if (data.extra) {\n <span class=\"extra\">{{ data.extra }}</span>\n }\n </div>\n</aui-dialog-header>\n<aui-dialog-content>\n <acl-resource-yaml-display\n [resource]=\"data.resource\"\n [hasWrapper]=\"false\"\n class=\"dialog-content\"\n ></acl-resource-yaml-display>\n</aui-dialog-content>\n" }]
|
|
12305
12563
|
}] });
|
|
12306
12564
|
|
|
12565
|
+
/**
|
|
12566
|
+
* 自动折叠 managedFields 字段
|
|
12567
|
+
* @param monacoEditor Monaco 编辑器实例
|
|
12568
|
+
*/
|
|
12569
|
+
function foldManagedFields(monacoEditor) {
|
|
12570
|
+
if (!monacoEditor) {
|
|
12571
|
+
return;
|
|
12572
|
+
}
|
|
12573
|
+
const model = monacoEditor.getModel();
|
|
12574
|
+
if (!model) {
|
|
12575
|
+
return;
|
|
12576
|
+
}
|
|
12577
|
+
try {
|
|
12578
|
+
// 查找所有 managedFields 字段(只在 metadata 下的)
|
|
12579
|
+
const managedFieldsMatches = model.findMatches('^(\\s+)managedFields:', false, true, false, null, true);
|
|
12580
|
+
if (managedFieldsMatches && managedFieldsMatches.length > 0) {
|
|
12581
|
+
const foldingRanges = [];
|
|
12582
|
+
for (const match of managedFieldsMatches) {
|
|
12583
|
+
const startLine = match.range.startLineNumber;
|
|
12584
|
+
const endLine = findManagedFieldsEndLine(model, startLine);
|
|
12585
|
+
if (endLine > startLine) {
|
|
12586
|
+
foldingRanges.push({
|
|
12587
|
+
startLineNumber: startLine,
|
|
12588
|
+
startColumn: 1,
|
|
12589
|
+
endLineNumber: endLine,
|
|
12590
|
+
endColumn: model.getLineMaxColumn(endLine),
|
|
12591
|
+
});
|
|
12592
|
+
}
|
|
12593
|
+
}
|
|
12594
|
+
if (foldingRanges.length > 0) {
|
|
12595
|
+
// 递归折叠每个 managedFields 区域,确保每次折叠完成后再进行下一次
|
|
12596
|
+
foldRangesSequentially(monacoEditor, foldingRanges?.reverse(), 0);
|
|
12597
|
+
}
|
|
12598
|
+
}
|
|
12599
|
+
}
|
|
12600
|
+
catch (error) {
|
|
12601
|
+
console.warn('Failed to fold managedFields:', error);
|
|
12602
|
+
}
|
|
12603
|
+
}
|
|
12604
|
+
/**
|
|
12605
|
+
* 递归折叠多个区域,确保每次折叠完成后再进行下一次
|
|
12606
|
+
* @param monacoEditor Monaco 编辑器实例
|
|
12607
|
+
* @param foldingRanges 折叠区域数组
|
|
12608
|
+
* @param index 当前折叠的索引
|
|
12609
|
+
*/
|
|
12610
|
+
async function foldRangesSequentially(monacoEditor, foldingRanges, index) {
|
|
12611
|
+
if (index >= foldingRanges.length) {
|
|
12612
|
+
return;
|
|
12613
|
+
}
|
|
12614
|
+
const range = foldingRanges[index];
|
|
12615
|
+
monacoEditor.setSelection(range);
|
|
12616
|
+
await Promise.resolve(monacoEditor.getAction('editor.fold')?.run());
|
|
12617
|
+
return foldRangesSequentially(monacoEditor, foldingRanges, index + 1);
|
|
12618
|
+
}
|
|
12619
|
+
/**
|
|
12620
|
+
* 查找 managedFields 字段的结束行
|
|
12621
|
+
* @param model Monaco 编辑器模型
|
|
12622
|
+
* @param startLine 起始行号
|
|
12623
|
+
* @returns 结束行号
|
|
12624
|
+
*/
|
|
12625
|
+
function findManagedFieldsEndLine(model, startLine) {
|
|
12626
|
+
const totalLines = model.getLineCount();
|
|
12627
|
+
const startIndent = getLineIndentation(model, startLine);
|
|
12628
|
+
// 从下一行开始查找
|
|
12629
|
+
for (let line = startLine + 1; line <= totalLines; line++) {
|
|
12630
|
+
const lineContent = model.getLineContent(line).trim();
|
|
12631
|
+
// 跳过空行
|
|
12632
|
+
if (!lineContent) {
|
|
12633
|
+
continue;
|
|
12634
|
+
}
|
|
12635
|
+
const currentIndent = getLineIndentation(model, line);
|
|
12636
|
+
// 如果缩进小于等于起始行,说明 managedFields 字段结束
|
|
12637
|
+
if (currentIndent <= startIndent) {
|
|
12638
|
+
return line - 1;
|
|
12639
|
+
}
|
|
12640
|
+
}
|
|
12641
|
+
return totalLines;
|
|
12642
|
+
}
|
|
12643
|
+
/**
|
|
12644
|
+
* 获取行的缩进级别
|
|
12645
|
+
* @param model Monaco 编辑器模型
|
|
12646
|
+
* @param lineNumber 行号
|
|
12647
|
+
* @returns 缩进级别(空格数)
|
|
12648
|
+
*/
|
|
12649
|
+
function getLineIndentation(model, lineNumber) {
|
|
12650
|
+
const lineContent = model.getLineContent(lineNumber);
|
|
12651
|
+
const match = lineContent.match(/^(\s*)/);
|
|
12652
|
+
return match ? match[1].length : 0;
|
|
12653
|
+
}
|
|
12654
|
+
/**
|
|
12655
|
+
* ManagedFields 自动折叠器
|
|
12656
|
+
* 用于在内容变化时自动折叠 managedFields 字段
|
|
12657
|
+
*/
|
|
12658
|
+
class ManagedFieldsAutoFolder {
|
|
12659
|
+
constructor() {
|
|
12660
|
+
this.lastFoldedContent = '';
|
|
12661
|
+
}
|
|
12662
|
+
/**
|
|
12663
|
+
* 开始监听内容变化并自动折叠
|
|
12664
|
+
* @param editorProvider 编辑器实例提供者
|
|
12665
|
+
* @param contentObservable 内容变化的 Observable
|
|
12666
|
+
*/
|
|
12667
|
+
startAutoFold(editorProvider, contentObservable) {
|
|
12668
|
+
this.stopAutoFold();
|
|
12669
|
+
this.subscription = contentObservable.subscribe(() => {
|
|
12670
|
+
setTimeout(() => {
|
|
12671
|
+
const editor = editorProvider.getEditorInstance();
|
|
12672
|
+
if (editor) {
|
|
12673
|
+
const model = editor.getModel();
|
|
12674
|
+
if (model) {
|
|
12675
|
+
const currentContent = model.getValue();
|
|
12676
|
+
// 只有当内容真正发生变化时才执行折叠
|
|
12677
|
+
if (currentContent.includes('managedFields:') &&
|
|
12678
|
+
currentContent !== this.lastFoldedContent) {
|
|
12679
|
+
foldManagedFields(editor);
|
|
12680
|
+
this.lastFoldedContent = currentContent;
|
|
12681
|
+
}
|
|
12682
|
+
}
|
|
12683
|
+
}
|
|
12684
|
+
}, 100);
|
|
12685
|
+
});
|
|
12686
|
+
}
|
|
12687
|
+
/**
|
|
12688
|
+
* 停止自动折叠
|
|
12689
|
+
*/
|
|
12690
|
+
stopAutoFold() {
|
|
12691
|
+
if (this.subscription) {
|
|
12692
|
+
this.subscription.unsubscribe();
|
|
12693
|
+
this.subscription = undefined;
|
|
12694
|
+
}
|
|
12695
|
+
}
|
|
12696
|
+
/**
|
|
12697
|
+
* 手动执行一次折叠
|
|
12698
|
+
* @param editorProvider 编辑器实例提供者
|
|
12699
|
+
*/
|
|
12700
|
+
foldOnce(editorProvider) {
|
|
12701
|
+
const editor = editorProvider.getEditorInstance();
|
|
12702
|
+
if (editor) {
|
|
12703
|
+
foldManagedFields(editor);
|
|
12704
|
+
const model = editor.getModel();
|
|
12705
|
+
if (model) {
|
|
12706
|
+
this.lastFoldedContent = model.getValue();
|
|
12707
|
+
}
|
|
12708
|
+
}
|
|
12709
|
+
}
|
|
12710
|
+
}
|
|
12711
|
+
|
|
12712
|
+
/**
|
|
12713
|
+
* Kubernetes 资源的内置 YAML 示例
|
|
12714
|
+
* 按照 apiVersion.kind 的格式组织
|
|
12715
|
+
*/
|
|
12716
|
+
const BUILT_IN_YAML_EXAMPLES = {
|
|
12717
|
+
'apps/v1.Deployment': [
|
|
12718
|
+
{
|
|
12719
|
+
title: 'Basic Deployment',
|
|
12720
|
+
description: 'A basic deployment example with nginx container',
|
|
12721
|
+
yaml: `apiVersion: apps/v1
|
|
12722
|
+
kind: Deployment
|
|
12723
|
+
metadata:
|
|
12724
|
+
labels:
|
|
12725
|
+
app: nginx
|
|
12726
|
+
name: nginx-deployment
|
|
12727
|
+
namespace: ''
|
|
12728
|
+
spec:
|
|
12729
|
+
selector:
|
|
12730
|
+
matchLabels:
|
|
12731
|
+
app: nginx
|
|
12732
|
+
template:
|
|
12733
|
+
metadata:
|
|
12734
|
+
labels:
|
|
12735
|
+
app: nginx
|
|
12736
|
+
spec:
|
|
12737
|
+
containers:
|
|
12738
|
+
- image: nginx:1.7.9
|
|
12739
|
+
name: nginx
|
|
12740
|
+
ports:
|
|
12741
|
+
- containerPort: 80
|
|
12742
|
+
securityContext:
|
|
12743
|
+
allowPrivilegeEscalation: false
|
|
12744
|
+
capabilities:
|
|
12745
|
+
drop:
|
|
12746
|
+
- ALL
|
|
12747
|
+
runAsNonRoot: true
|
|
12748
|
+
seccompProfile:
|
|
12749
|
+
type: RuntimeDefault
|
|
12750
|
+
securityContext:
|
|
12751
|
+
runAsNonRoot: true
|
|
12752
|
+
seccompProfile:
|
|
12753
|
+
type: RuntimeDefault`,
|
|
12754
|
+
},
|
|
12755
|
+
],
|
|
12756
|
+
'v1.ConfigMap': [
|
|
12757
|
+
{
|
|
12758
|
+
title: 'Basic ConfigMap',
|
|
12759
|
+
description: 'A basic ConfigMap example with properties and file data',
|
|
12760
|
+
yaml: `apiVersion: v1
|
|
12761
|
+
kind: ConfigMap
|
|
12762
|
+
metadata:
|
|
12763
|
+
name: example
|
|
12764
|
+
namespace: ''
|
|
12765
|
+
data:
|
|
12766
|
+
example.property.1: hello
|
|
12767
|
+
example.property.2: world
|
|
12768
|
+
example.property.file: |-
|
|
12769
|
+
property.1=value-1
|
|
12770
|
+
property.2=value-2
|
|
12771
|
+
property.3=value-3`,
|
|
12772
|
+
},
|
|
12773
|
+
],
|
|
12774
|
+
'batch/v1.CronJob': [
|
|
12775
|
+
{
|
|
12776
|
+
title: 'Basic CronJob',
|
|
12777
|
+
description: 'A basic CronJob example that runs daily',
|
|
12778
|
+
yaml: `apiVersion: batch/v1
|
|
12779
|
+
kind: CronJob
|
|
12780
|
+
metadata:
|
|
12781
|
+
name: hello
|
|
12782
|
+
spec:
|
|
12783
|
+
jobTemplate:
|
|
12784
|
+
metadata:
|
|
12785
|
+
labels:
|
|
12786
|
+
cronjob.cpaas.io/name: hello
|
|
12787
|
+
spec:
|
|
12788
|
+
template:
|
|
12789
|
+
metadata:
|
|
12790
|
+
labels:
|
|
12791
|
+
cronjob.cpaas.io/name: hello
|
|
12792
|
+
spec:
|
|
12793
|
+
containers:
|
|
12794
|
+
- args:
|
|
12795
|
+
- /bin/sh
|
|
12796
|
+
- -c
|
|
12797
|
+
- date; echo Hello from the Kubernetes cluster
|
|
12798
|
+
image: busybox
|
|
12799
|
+
name: hello
|
|
12800
|
+
securityContext:
|
|
12801
|
+
allowPrivilegeEscalation: false
|
|
12802
|
+
capabilities:
|
|
12803
|
+
drop:
|
|
12804
|
+
- ALL
|
|
12805
|
+
runAsNonRoot: true
|
|
12806
|
+
seccompProfile:
|
|
12807
|
+
type: RuntimeDefault
|
|
12808
|
+
securityContext:
|
|
12809
|
+
runAsNonRoot: true
|
|
12810
|
+
seccompProfile:
|
|
12811
|
+
type: RuntimeDefault
|
|
12812
|
+
restartPolicy: Never
|
|
12813
|
+
schedule: "*/1 * * * *"`,
|
|
12814
|
+
},
|
|
12815
|
+
],
|
|
12816
|
+
'v1.PersistentVolume': [
|
|
12817
|
+
{
|
|
12818
|
+
title: 'Basic PersistentVolume',
|
|
12819
|
+
description: 'A basic PersistentVolume example with NFS storage',
|
|
12820
|
+
yaml: `apiVersion: v1
|
|
12821
|
+
kind: PersistentVolume
|
|
12822
|
+
metadata:
|
|
12823
|
+
name: example
|
|
12824
|
+
namespace: ''
|
|
12825
|
+
spec:
|
|
12826
|
+
capacity:
|
|
12827
|
+
storage: 5Gi
|
|
12828
|
+
accessModes:
|
|
12829
|
+
- ReadWriteOnce
|
|
12830
|
+
persistentVolumeReclaimPolicy: Retain
|
|
12831
|
+
storageClassName: slow
|
|
12832
|
+
nfs:
|
|
12833
|
+
path: /tmp
|
|
12834
|
+
server: 172.17.0.2`,
|
|
12835
|
+
},
|
|
12836
|
+
],
|
|
12837
|
+
'autoscaling/v2.HorizontalPodAutoscaler': [
|
|
12838
|
+
{
|
|
12839
|
+
title: 'Basic HorizontalPodAutoscaler',
|
|
12840
|
+
description: 'A basic HPA example with CPU utilization target',
|
|
12841
|
+
yaml: `apiVersion: autoscaling/v2
|
|
12842
|
+
kind: HorizontalPodAutoscaler
|
|
12843
|
+
metadata:
|
|
12844
|
+
name: example
|
|
12845
|
+
namespace: ''
|
|
12846
|
+
spec:
|
|
12847
|
+
scaleTargetRef:
|
|
12848
|
+
apiVersion: apps/v1
|
|
12849
|
+
kind: Deployment
|
|
12850
|
+
name: example
|
|
12851
|
+
minReplicas: 1
|
|
12852
|
+
maxReplicas: 3
|
|
12853
|
+
metrics:
|
|
12854
|
+
- type: Resource
|
|
12855
|
+
resource:
|
|
12856
|
+
name: cpu
|
|
12857
|
+
target:
|
|
12858
|
+
averageUtilization: 50
|
|
12859
|
+
type: Utilization`,
|
|
12860
|
+
},
|
|
12861
|
+
],
|
|
12862
|
+
'apps/v1.DaemonSet': [
|
|
12863
|
+
{
|
|
12864
|
+
title: 'Basic DaemonSet',
|
|
12865
|
+
description: 'A basic DaemonSet example with nginx container',
|
|
12866
|
+
yaml: `apiVersion: apps/v1
|
|
12867
|
+
kind: DaemonSet
|
|
12868
|
+
metadata:
|
|
12869
|
+
name: fluentd-elasticsearch
|
|
12870
|
+
namespace: ''
|
|
12871
|
+
labels:
|
|
12872
|
+
k8s-app: fluentd-logging
|
|
12873
|
+
spec:
|
|
12874
|
+
selector:
|
|
12875
|
+
matchLabels:
|
|
12876
|
+
name: fluentd-elasticsearch
|
|
12877
|
+
template:
|
|
12878
|
+
metadata:
|
|
12879
|
+
labels:
|
|
12880
|
+
name: fluentd-elasticsearch
|
|
12881
|
+
spec:
|
|
12882
|
+
tolerations:
|
|
12883
|
+
- key: node-role.kubernetes.io/control-plane
|
|
12884
|
+
operator: Exists
|
|
12885
|
+
effect: NoSchedule
|
|
12886
|
+
- key: node-role.kubernetes.io/master
|
|
12887
|
+
operator: Exists
|
|
12888
|
+
effect: NoSchedule
|
|
12889
|
+
containers:
|
|
12890
|
+
- name: fluentd-elasticsearch
|
|
12891
|
+
image: quay.io/fluentd_elasticsearch/fluentd:v2.5.2
|
|
12892
|
+
resources:
|
|
12893
|
+
limits:
|
|
12894
|
+
memory: 200Mi
|
|
12895
|
+
requests:
|
|
12896
|
+
cpu: 100m
|
|
12897
|
+
memory: 200Mi
|
|
12898
|
+
volumeMounts:
|
|
12899
|
+
- name: varlog
|
|
12900
|
+
mountPath: /var/log
|
|
12901
|
+
securityContext:
|
|
12902
|
+
allowPrivilegeEscalation: false
|
|
12903
|
+
capabilities:
|
|
12904
|
+
drop:
|
|
12905
|
+
- ALL
|
|
12906
|
+
runAsNonRoot: true
|
|
12907
|
+
runAsUser: 1000
|
|
12908
|
+
runAsGroup: 1000
|
|
12909
|
+
seccompProfile:
|
|
12910
|
+
type: RuntimeDefault
|
|
12911
|
+
securityContext:
|
|
12912
|
+
runAsNonRoot: true
|
|
12913
|
+
seccompProfile:
|
|
12914
|
+
type: RuntimeDefault
|
|
12915
|
+
terminationGracePeriodSeconds: 30
|
|
12916
|
+
volumes:
|
|
12917
|
+
- name: varlog
|
|
12918
|
+
emptyDir: {}`,
|
|
12919
|
+
},
|
|
12920
|
+
],
|
|
12921
|
+
'v1.PersistentVolumeClaim': [
|
|
12922
|
+
{
|
|
12923
|
+
title: 'Basic PersistentVolumeClaim',
|
|
12924
|
+
description: 'A basic PVC example requesting 1Gi storage',
|
|
12925
|
+
yaml: `apiVersion: v1
|
|
12926
|
+
kind: PersistentVolumeClaim
|
|
12927
|
+
metadata:
|
|
12928
|
+
name: example
|
|
12929
|
+
namespace:: ''
|
|
12930
|
+
spec:
|
|
12931
|
+
accessModes:
|
|
12932
|
+
- ReadWriteOnce
|
|
12933
|
+
volumeMode: Filesystem
|
|
12934
|
+
resources:
|
|
12935
|
+
requests:
|
|
12936
|
+
storage: 1Gi`,
|
|
12937
|
+
},
|
|
12938
|
+
],
|
|
12939
|
+
'v1.ResourceQuota': [
|
|
12940
|
+
{
|
|
12941
|
+
title: 'Compute ResourceQuota',
|
|
12942
|
+
description: 'A ResourceQuota example for compute resources',
|
|
12943
|
+
yaml: `apiVersion: v1
|
|
12944
|
+
kind: ResourceQuota
|
|
12945
|
+
metadata:
|
|
12946
|
+
name: compute-quota
|
|
12947
|
+
namespace: ''
|
|
12948
|
+
spec:
|
|
12949
|
+
hard:
|
|
12950
|
+
requests.cpu: '1'
|
|
12951
|
+
requests.memory: 1Gi
|
|
12952
|
+
limits.cpu: '2'
|
|
12953
|
+
limits.memory: 2Gi`,
|
|
12954
|
+
},
|
|
12955
|
+
{
|
|
12956
|
+
title: 'Storage Class ResourceQuota',
|
|
12957
|
+
description: 'A ResourceQuota example for storage class specific quotas',
|
|
12958
|
+
yaml: `apiVersion: v1
|
|
12959
|
+
kind: ResourceQuota
|
|
12960
|
+
metadata:
|
|
12961
|
+
name: storage-class-quota
|
|
12962
|
+
namespace: ''
|
|
12963
|
+
spec:
|
|
12964
|
+
hard:
|
|
12965
|
+
requests.storage: 100Gi
|
|
12966
|
+
persistentvolumeclaims: '100'
|
|
12967
|
+
# For quota specific to a storage class, the storage class must have the same name
|
|
12968
|
+
gold.storage-class.kubernetes.io/requests.storage: 3Gi
|
|
12969
|
+
gold.storage-class.kubernetes.io/persistentvolumeclaims: '5'
|
|
12970
|
+
silver.storage-class.kubernetes.io/requests.storage: 2Gi
|
|
12971
|
+
silver.storage-class.kubernetes.io/persistentvolumeclaims: '3'
|
|
12972
|
+
bronze.storage-class.kubernetes.io/requests.storage: 1Gi
|
|
12973
|
+
bronze.storage-class.kubernetes.io/persistentvolumeclaims: '1'`,
|
|
12974
|
+
},
|
|
12975
|
+
{
|
|
12976
|
+
title: 'Object Counts ResourceQuota',
|
|
12977
|
+
description: 'A ResourceQuota example for object count limits',
|
|
12978
|
+
yaml: `apiVersion: v1
|
|
12979
|
+
kind: ResourceQuota
|
|
12980
|
+
metadata:
|
|
12981
|
+
name: object-counts
|
|
12982
|
+
namespace: ''
|
|
12983
|
+
spec:
|
|
12984
|
+
hard:
|
|
12985
|
+
configmaps: "10"
|
|
12986
|
+
persistentvolumeclaims: "4"
|
|
12987
|
+
replicationcontrollers: "20"
|
|
12988
|
+
secrets: "10"
|
|
12989
|
+
services: "10"
|
|
12990
|
+
services.loadbalancers: "2"`,
|
|
12991
|
+
},
|
|
12992
|
+
],
|
|
12993
|
+
'v1.LimitRange': [
|
|
12994
|
+
{
|
|
12995
|
+
title: 'Memory LimitRange',
|
|
12996
|
+
description: 'A LimitRange example for container memory limits',
|
|
12997
|
+
yaml: `apiVersion: v1
|
|
12998
|
+
kind: LimitRange
|
|
12999
|
+
metadata:
|
|
13000
|
+
name: mem-limit-range
|
|
13001
|
+
namespace: ''
|
|
13002
|
+
spec:
|
|
13003
|
+
limits:
|
|
13004
|
+
- default:
|
|
13005
|
+
memory: 512Mi
|
|
13006
|
+
defaultRequest:
|
|
13007
|
+
memory: 256Mi
|
|
13008
|
+
type: Container`,
|
|
13009
|
+
},
|
|
13010
|
+
],
|
|
13011
|
+
'apps/v1.StatefulSet': [
|
|
13012
|
+
{
|
|
13013
|
+
title: 'Basic StatefulSet',
|
|
13014
|
+
description: 'A basic StatefulSet example with persistent storage',
|
|
13015
|
+
yaml: `apiVersion: apps/v1
|
|
13016
|
+
kind: StatefulSet
|
|
13017
|
+
metadata:
|
|
13018
|
+
name: example
|
|
13019
|
+
namespace: ''
|
|
13020
|
+
spec:
|
|
13021
|
+
replicas: 3
|
|
13022
|
+
selector:
|
|
13023
|
+
matchLabels:
|
|
13024
|
+
app: httpd
|
|
13025
|
+
serviceName: httpd
|
|
13026
|
+
template:
|
|
13027
|
+
metadata:
|
|
13028
|
+
labels:
|
|
13029
|
+
app: httpd
|
|
13030
|
+
spec:
|
|
13031
|
+
containers:
|
|
13032
|
+
- image: nginx:1.7.9
|
|
13033
|
+
name: httpd
|
|
13034
|
+
ports:
|
|
13035
|
+
- containerPort: 8080
|
|
13036
|
+
name: web
|
|
13037
|
+
volumeMounts:
|
|
13038
|
+
- mountPath: /var/www/html
|
|
13039
|
+
name: www
|
|
13040
|
+
securityContext:
|
|
13041
|
+
allowPrivilegeEscalation: false
|
|
13042
|
+
capabilities:
|
|
13043
|
+
drop:
|
|
13044
|
+
- ALL
|
|
13045
|
+
runAsNonRoot: true
|
|
13046
|
+
seccompProfile:
|
|
13047
|
+
type: RuntimeDefault
|
|
13048
|
+
securityContext:
|
|
13049
|
+
runAsNonRoot: true
|
|
13050
|
+
seccompProfile:
|
|
13051
|
+
type: RuntimeDefault
|
|
13052
|
+
terminationGracePeriodSeconds: 10
|
|
13053
|
+
volumeClaimTemplates:
|
|
13054
|
+
- metadata:
|
|
13055
|
+
name: www
|
|
13056
|
+
spec:
|
|
13057
|
+
accessModes:
|
|
13058
|
+
- ReadWriteOnce
|
|
13059
|
+
resources:
|
|
13060
|
+
requests:
|
|
13061
|
+
storage: 1Gi`,
|
|
13062
|
+
},
|
|
13063
|
+
],
|
|
13064
|
+
'storage.k8s.io/v1.StorageClass': [
|
|
13065
|
+
{
|
|
13066
|
+
title: 'Fast StorageClass',
|
|
13067
|
+
description: 'Ceph fast storage class example',
|
|
13068
|
+
yaml: `apiVersion: storage.k8s.io/v1
|
|
13069
|
+
kind: StorageClass
|
|
13070
|
+
metadata:
|
|
13071
|
+
name: example
|
|
13072
|
+
namespace: ''
|
|
13073
|
+
provisioner: my-provisioner
|
|
13074
|
+
reclaimPolicy: Delete
|
|
13075
|
+
`,
|
|
13076
|
+
},
|
|
13077
|
+
],
|
|
13078
|
+
'v1.Secret': [
|
|
13079
|
+
{
|
|
13080
|
+
title: 'Basic Secret',
|
|
13081
|
+
description: 'A basic Secret example with username and password',
|
|
13082
|
+
yaml: `apiVersion: v1
|
|
13083
|
+
kind: Secret
|
|
13084
|
+
metadata:
|
|
13085
|
+
name: example
|
|
13086
|
+
namespace: ''
|
|
13087
|
+
type: Opaque
|
|
13088
|
+
stringData:
|
|
13089
|
+
username: admin
|
|
13090
|
+
password: opensec`,
|
|
13091
|
+
},
|
|
13092
|
+
],
|
|
13093
|
+
'app.k8s.io/v1beta1.Application': [
|
|
13094
|
+
{
|
|
13095
|
+
title: 'Basic Application',
|
|
13096
|
+
description: 'A basic Application example with Deployment and Service',
|
|
13097
|
+
yaml: `apiVersion: apps/v1
|
|
13098
|
+
kind: Deployment
|
|
13099
|
+
metadata:
|
|
13100
|
+
labels:
|
|
13101
|
+
app: nginx
|
|
13102
|
+
name: nginx-deployment
|
|
13103
|
+
namespace: ''
|
|
13104
|
+
spec:
|
|
13105
|
+
replicas: 1
|
|
13106
|
+
selector:
|
|
13107
|
+
matchLabels:
|
|
13108
|
+
app: nginx
|
|
13109
|
+
template:
|
|
13110
|
+
metadata:
|
|
13111
|
+
labels:
|
|
13112
|
+
app: nginx
|
|
13113
|
+
spec:
|
|
13114
|
+
containers:
|
|
13115
|
+
- image: nginx:1.7.9
|
|
13116
|
+
name: nginx
|
|
13117
|
+
ports:
|
|
13118
|
+
- containerPort: 80
|
|
13119
|
+
securityContext:
|
|
13120
|
+
allowPrivilegeEscalation: false
|
|
13121
|
+
capabilities:
|
|
13122
|
+
drop:
|
|
13123
|
+
- ALL
|
|
13124
|
+
runAsNonRoot: true
|
|
13125
|
+
seccompProfile:
|
|
13126
|
+
type: RuntimeDefault
|
|
13127
|
+
securityContext:
|
|
13128
|
+
runAsNonRoot: true
|
|
13129
|
+
seccompProfile:
|
|
13130
|
+
type: RuntimeDefault
|
|
13131
|
+
---
|
|
13132
|
+
apiVersion: v1
|
|
13133
|
+
kind: Service
|
|
13134
|
+
metadata:
|
|
13135
|
+
labels:
|
|
13136
|
+
app: nginx
|
|
13137
|
+
name: nginx
|
|
13138
|
+
spec:
|
|
13139
|
+
ports:
|
|
13140
|
+
- port: 80
|
|
13141
|
+
protocol: TCP
|
|
13142
|
+
targetPort: 80
|
|
13143
|
+
selector:
|
|
13144
|
+
app: nginx
|
|
13145
|
+
type: ClusterIP`,
|
|
13146
|
+
},
|
|
13147
|
+
],
|
|
13148
|
+
};
|
|
13149
|
+
|
|
13150
|
+
class ResourceYamlSidebarComponent {
|
|
13151
|
+
constructor() {
|
|
13152
|
+
this.close = new EventEmitter();
|
|
13153
|
+
this.tryYaml = new EventEmitter();
|
|
13154
|
+
this.schemaEnable = true;
|
|
13155
|
+
this.exampleEnable = true;
|
|
13156
|
+
this.DEFINITIONS_PREFIX = '#/definitions/';
|
|
13157
|
+
this.path = [];
|
|
13158
|
+
this.examples = [];
|
|
13159
|
+
this.hasSchema = false;
|
|
13160
|
+
this.hasExamples = false;
|
|
13161
|
+
this.http = inject(HttpClient);
|
|
13162
|
+
this.cdr = inject(ChangeDetectorRef);
|
|
13163
|
+
this.host = inject((ElementRef));
|
|
13164
|
+
}
|
|
13165
|
+
ngOnInit() {
|
|
13166
|
+
this.refresh();
|
|
13167
|
+
this.loadExamples();
|
|
13168
|
+
}
|
|
13169
|
+
ngOnChanges(changes) {
|
|
13170
|
+
if (changes.schema || changes.resource) {
|
|
13171
|
+
this.refresh();
|
|
13172
|
+
this.loadExamples();
|
|
13173
|
+
}
|
|
13174
|
+
}
|
|
13175
|
+
refresh() {
|
|
13176
|
+
if (this.schema) {
|
|
13177
|
+
this.currentSchema = this.schema;
|
|
13178
|
+
this.currentSchemaDescription = this.schema.description;
|
|
13179
|
+
this.properties = this.schema.properties || {};
|
|
13180
|
+
this.path = [];
|
|
13181
|
+
this.hasSchema = true;
|
|
13182
|
+
}
|
|
13183
|
+
else {
|
|
13184
|
+
this.hasSchema = false;
|
|
13185
|
+
}
|
|
13186
|
+
if (this.resource) {
|
|
13187
|
+
this.resourceKind = this.resource.kind || 'Resource';
|
|
13188
|
+
}
|
|
13189
|
+
}
|
|
13190
|
+
loadExamples() {
|
|
13191
|
+
if (!this.resource) {
|
|
13192
|
+
this.examples = [];
|
|
13193
|
+
this.hasExamples = false;
|
|
13194
|
+
this.cdr.markForCheck();
|
|
13195
|
+
return;
|
|
13196
|
+
}
|
|
13197
|
+
const resourceKey = `${this.resource.apiVersion}.${this.resource.kind}`;
|
|
13198
|
+
const builtInExamples = BUILT_IN_YAML_EXAMPLES[resourceKey] || [];
|
|
13199
|
+
// 加载 ConsoleYAMLSample CRD 中的示例
|
|
13200
|
+
this.loadConsoleYAMLSamples().subscribe({
|
|
13201
|
+
next: crdExamples => {
|
|
13202
|
+
this.examples = [
|
|
13203
|
+
...builtInExamples,
|
|
13204
|
+
...(this.extraExamples || []),
|
|
13205
|
+
...crdExamples,
|
|
13206
|
+
];
|
|
13207
|
+
this.hasExamples = this.examples.length > 0;
|
|
13208
|
+
this.cdr.markForCheck();
|
|
13209
|
+
},
|
|
13210
|
+
error: () => {
|
|
13211
|
+
// 如果加载 CRD 示例失败,只使用内置示例
|
|
13212
|
+
this.examples = builtInExamples;
|
|
13213
|
+
this.hasExamples = this.examples.length > 0;
|
|
13214
|
+
this.cdr.markForCheck();
|
|
13215
|
+
},
|
|
13216
|
+
});
|
|
13217
|
+
}
|
|
13218
|
+
loadConsoleYAMLSamples() {
|
|
13219
|
+
if (!this.resource) {
|
|
13220
|
+
return of([]);
|
|
13221
|
+
}
|
|
13222
|
+
// 构建查询 ConsoleYAMLSample 的 API 路径
|
|
13223
|
+
const apiPath = '{{API_GATEWAY}}/kubernetes/business-1/apis/console.alauda.io/v1/consoleyamlsamples';
|
|
13224
|
+
return this.http.get(apiPath).pipe(map(response => {
|
|
13225
|
+
return response.items
|
|
13226
|
+
.filter(sample => {
|
|
13227
|
+
const target = sample.spec.targetResource;
|
|
13228
|
+
return (target.apiVersion === this.resource.apiVersion &&
|
|
13229
|
+
target.kind === this.resource.kind);
|
|
13230
|
+
})
|
|
13231
|
+
.map(sample => ({
|
|
13232
|
+
title: sample.spec.title,
|
|
13233
|
+
description: sample.spec.description,
|
|
13234
|
+
yaml: sample.spec.yaml,
|
|
13235
|
+
snippet: sample.spec.snippet,
|
|
13236
|
+
}));
|
|
13237
|
+
}), catchError(() => of([])));
|
|
13238
|
+
}
|
|
13239
|
+
drillDownToProperty(name) {
|
|
13240
|
+
const property = this.currentSchema.properties?.[name];
|
|
13241
|
+
if (property) {
|
|
13242
|
+
this.currentSchemaDescription = property.description;
|
|
13243
|
+
let targetSchema = null;
|
|
13244
|
+
// 处理 $ref 引用
|
|
13245
|
+
if (property.$ref || property.items?.$ref) {
|
|
13246
|
+
const ref = property.$ref || property.items?.$ref;
|
|
13247
|
+
if (ref.startsWith(this.DEFINITIONS_PREFIX)) {
|
|
13248
|
+
// const definitionName = ref.replace(this.DEFINITIONS_PREFIX, '');
|
|
13249
|
+
// 从根 schema 的 definitions 中获取定义
|
|
13250
|
+
// todo: 书勋
|
|
13251
|
+
// const rootDefinitions = this.schemaService.definitions;
|
|
13252
|
+
// targetSchema = rootDefinitions?.[definitionName] || null;
|
|
13253
|
+
}
|
|
13254
|
+
}
|
|
13255
|
+
// 处理普通的嵌套属性
|
|
13256
|
+
else if (property.properties || property.items?.properties) {
|
|
13257
|
+
targetSchema = property.items?.properties ? property.items : property;
|
|
13258
|
+
}
|
|
13259
|
+
if (targetSchema) {
|
|
13260
|
+
this.currentSchema = targetSchema;
|
|
13261
|
+
this.path.push(name);
|
|
13262
|
+
this.properties = targetSchema.properties || {};
|
|
13263
|
+
this.scrollTop();
|
|
13264
|
+
}
|
|
13265
|
+
}
|
|
13266
|
+
}
|
|
13267
|
+
navigateToPath(index) {
|
|
13268
|
+
const targetPath = this.path.slice(0, index + 1);
|
|
13269
|
+
this.path = [...targetPath];
|
|
13270
|
+
let currentObj = this.schema;
|
|
13271
|
+
for (const pathSegment of targetPath) {
|
|
13272
|
+
const property = currentObj.properties?.[pathSegment];
|
|
13273
|
+
if (property) {
|
|
13274
|
+
this.currentSchemaDescription = property.description;
|
|
13275
|
+
// 处理 $ref 引用
|
|
13276
|
+
if (property.$ref || property.items?.$ref) {
|
|
13277
|
+
const ref = property.$ref || property.items?.$ref;
|
|
13278
|
+
if (ref.startsWith(this.DEFINITIONS_PREFIX)) {
|
|
13279
|
+
// const definitionName = ref.replace(this.DEFINITIONS_PREFIX, '');
|
|
13280
|
+
// todo: 书勋
|
|
13281
|
+
// const rootDefinitions = this.schemaService.definitions;
|
|
13282
|
+
// const definition = rootDefinitions?.[definitionName];
|
|
13283
|
+
// if (definition) {
|
|
13284
|
+
// currentObj = definition;
|
|
13285
|
+
// }
|
|
13286
|
+
}
|
|
13287
|
+
}
|
|
13288
|
+
// 处理普通的嵌套属性
|
|
13289
|
+
else {
|
|
13290
|
+
currentObj = property.items?.properties ? property.items : property;
|
|
13291
|
+
}
|
|
13292
|
+
}
|
|
13293
|
+
}
|
|
13294
|
+
this.currentSchema = currentObj;
|
|
13295
|
+
this.properties = currentObj.properties || {};
|
|
13296
|
+
}
|
|
13297
|
+
/**
|
|
13298
|
+
* 检查属性是否有 $ref 引用或嵌套属性
|
|
13299
|
+
*/
|
|
13300
|
+
hasViewableContent(property) {
|
|
13301
|
+
return (
|
|
13302
|
+
// 有 properties 的对象
|
|
13303
|
+
(property.type === 'object' &&
|
|
13304
|
+
property.properties &&
|
|
13305
|
+
Object.keys(property.properties).length > 0) ||
|
|
13306
|
+
// 有 properties 的数组项
|
|
13307
|
+
(property.type === 'array' &&
|
|
13308
|
+
property.items &&
|
|
13309
|
+
typeof property.items === 'object' &&
|
|
13310
|
+
property.items.properties &&
|
|
13311
|
+
Object.keys(property.items.properties || {})
|
|
13312
|
+
.length > 0) ||
|
|
13313
|
+
// 有 $ref 引用
|
|
13314
|
+
!!property.$ref ||
|
|
13315
|
+
!!property?.items?.$ref);
|
|
13316
|
+
}
|
|
13317
|
+
// Examples 相关方法
|
|
13318
|
+
tryExample(example) {
|
|
13319
|
+
// 触发事件,让父组件处理 try it 功能,将 YAML 内容发送给父组件
|
|
13320
|
+
this.tryYaml.emit(example.yaml);
|
|
13321
|
+
}
|
|
13322
|
+
downloadYaml(example) {
|
|
13323
|
+
const blob = new Blob([example.yaml], { type: 'text/yaml' });
|
|
13324
|
+
const url = window.URL.createObjectURL(blob);
|
|
13325
|
+
const link = document.createElement('a');
|
|
13326
|
+
link.href = url;
|
|
13327
|
+
link.download = `${example.title.toLowerCase().replace(/\s+/g, '-')}.yaml`;
|
|
13328
|
+
document.body.appendChild(link);
|
|
13329
|
+
link.click();
|
|
13330
|
+
document.body.removeChild(link);
|
|
13331
|
+
window.URL.revokeObjectURL(url);
|
|
13332
|
+
}
|
|
13333
|
+
// 处理描述中的链接
|
|
13334
|
+
processDescription(description) {
|
|
13335
|
+
if (!description)
|
|
13336
|
+
return '';
|
|
13337
|
+
// 将 URL 转换为可点击的链接
|
|
13338
|
+
const urlRegex = /(https?:\/\/[^\s]+)/g;
|
|
13339
|
+
return description
|
|
13340
|
+
.replace(urlRegex, '<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>')
|
|
13341
|
+
.replace(/\n/g, '<br>'); // 保留换行符
|
|
13342
|
+
}
|
|
13343
|
+
scrollTop() {
|
|
13344
|
+
this.host.nativeElement.scrollTo({
|
|
13345
|
+
top: 0,
|
|
13346
|
+
});
|
|
13347
|
+
}
|
|
13348
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceYamlSidebarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
13349
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: ResourceYamlSidebarComponent, isStandalone: true, selector: "acl-resource-yaml-sidebar", inputs: { resource: "resource", schema: "schema", schemaEnable: "schemaEnable", exampleEnable: "exampleEnable", extraExamples: "extraExamples" }, outputs: { close: "close", tryYaml: "tryYaml" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"schema-header\">\n <span>{{ resourceKind }}</span>\n <aui-icon\n icon=\"xmark\"\n (click)=\"close.next()\"\n ></aui-icon>\n</div>\n<aui-tab-group type=\"card\">\n @if (schemaEnable && hasSchema) {\n <aui-tab>\n <ng-container *auiTabLabel> Schema </ng-container>\n <ng-container *auiTabContent>\n @if (schema) {\n <div class=\"schema-content\">\n <div class=\"schema-path\">\n @if (path.length) {\n <a\n href=\"javascript:\"\n (click)=\"refresh()\"\n >{{ resourceKind }}</a\n >\n }\n @for (p of path; track p; let i = $index; let isLast = $last) {\n @if (!isLast) {\n <span class=\"path-mark\">></span>\n <a\n href=\"javascript:\"\n (click)=\"navigateToPath(i)\"\n >{{ p }}</a\n >\n }\n @if (isLast) {\n <span class=\"path-mark\">></span>\n <span>{{ p }}</span>\n }\n }\n </div>\n @if (currentSchemaDescription) {\n <div\n class=\"schema-desc\"\n [innerHTML]=\"\n currentSchemaDescription\n | aclParseJsonTranslate\n | pure: processDescription\n \"\n ></div>\n }\n <div class=\"schema-list\">\n @for (item of properties | keyvalue; track item) {\n <div class=\"schema-item\">\n <h3>\n <span>{{ item.key }}</span>\n <span class=\"obj-type\">{{ item.value.type }}</span>\n </h3>\n <p\n [innerHTML]=\"\n item.value.description | pure: processDescription\n \"\n ></p>\n @if (item.value | pure: hasViewableContent) {\n <p>\n <a\n href=\"javascript:\"\n (click)=\"drillDownToProperty(item.key)\"\n >\n {{ 'view_detail' | translate }}\n </a>\n </p>\n }\n </div>\n }\n </div>\n </div>\n }\n </ng-container>\n </aui-tab>\n }\n @if (exampleEnable && hasExamples) {\n <aui-tab>\n <ng-container *auiTabLabel> Examples </ng-container>\n <ng-container *auiTabContent>\n <div class=\"example-list\">\n @for (example of examples; track example; let i = $index) {\n <div class=\"example-item\">\n <h3>\n {{ i + 1 }}. <span>{{ example.title }}</span>\n </h3>\n <p\n [innerHTML]=\"example.description | pure: processDescription\"\n ></p>\n <p class=\"tw-flex tw-justify-between\">\n <a\n href=\"javascript:\"\n (click)=\"tryExample(example)\"\n >\n <aui-icon\n icon=\"arrow_turn_up\"\n size=\"14\"\n margin=\"right\"\n ></aui-icon>\n <span>Try it</span>\n </a>\n <a\n href=\"javascript:\"\n (click)=\"downloadYaml(example)\"\n >\n <aui-icon\n icon=\"download\"\n size=\"14\"\n margin=\"right\"\n ></aui-icon>\n <span>Download YAML</span>\n </a>\n </p>\n </div>\n }\n </div>\n </ng-container>\n </aui-tab>\n }\n</aui-tab-group>\n", styles: [":host{display:block;box-sizing:border-box;min-width:360px;padding:16px;background-color:rgb(var(--aui-color-n-10));box-shadow:0 0 4px rgba(var(--aui-color-n-1),.16);margin-left:12px;overflow-y:scroll}:host::-webkit-scrollbar{width:8px;height:4px}:host::-webkit-scrollbar-thumb{border-radius:4px;background-color:rgb(var(--aui-color-n-7))}:host::-webkit-scrollbar-thumb:hover{background-color:rgb(var(--aui-color-n-5))}:host::-webkit-scrollbar-corner{background-color:transparent}aui-tab-group{display:block;margin-top:5px}.schema-header{height:40px;display:flex;justify-content:space-between;align-items:center;font-size:18px}.schema-header aui-icon{font-size:16px;color:rgb(var(--aui-color-n-6));cursor:pointer}.schema-header aui-icon:hover{color:rgb(var(--aui-color-primary))}.schema-content{line-height:20px;overflow-y:auto;height:calc(100% - 40px)}.schema-content::-webkit-scrollbar{width:8px;height:4px}.schema-content::-webkit-scrollbar-thumb{border-radius:4px;background-color:rgb(var(--aui-color-n-7))}.schema-content::-webkit-scrollbar-thumb:hover{background-color:rgb(var(--aui-color-n-5))}.schema-content::-webkit-scrollbar-corner{background-color:transparent}.schema-desc{margin-bottom:12px}.schema-desc a{color:#007bff;text-decoration:none}.schema-desc a:hover{text-decoration:underline}.schema-path{display:flex;flex-wrap:wrap}.schema-path *{margin-left:2px;word-break:break-all}.schema-path span:first-child{margin-right:2px}.schema-path .path-mark{margin:0 4px;color:rgb(var(--aui-color-n-6))}.schema-path{margin-bottom:12px}.schema-list .schema-item:not(:last-of-type),.schema-list .example-item:not(:last-of-type),.example-list .schema-item:not(:last-of-type),.example-list .example-item:not(:last-of-type){border-bottom:1px solid rgb(var(--aui-color-border));margin-bottom:12px}.schema-list .schema-item,.schema-list .example-item,.example-list .schema-item,.example-list .example-item{padding-left:16px}.schema-list .schema-item h3:before,.example-list .schema-item h3:before{content:\"\";display:block;width:6px;height:6px;border-radius:50%;background-color:rgb(var(--aui-color-n-6));position:absolute;left:-12px;top:8px}.schema-list h3,.example-list h3{position:relative;font-weight:500;margin-bottom:12px;word-break:break-word}.schema-list h3 span,.example-list h3 span{margin-right:4px}.schema-list h3 .obj-type,.example-list h3 .obj-type{color:rgb(var(--aui-color-n-4))}.schema-list p,.example-list p{margin-bottom:12px;word-break:break-word}.schema-list p a,.example-list p a{color:#007bff;text-decoration:none}.schema-list p a:hover,.example-list p a:hover{text-decoration:underline}.schema-examples{padding:16px}.examples-header{margin-bottom:16px}.examples-header h3{margin:0;font-size:18px;font-weight:600;color:#333}.examples-content .examples-list .example-item{margin-bottom:24px;border:1px solid #e1e5e9;border-radius:6px;overflow:hidden}.examples-content .examples-list .example-item:last-child{margin-bottom:0}.examples-content .examples-list .example-item .example-header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;background-color:#f8f9fa;border-bottom:1px solid #e1e5e9}.examples-content .examples-list .example-item .example-header .example-title{margin:0;font-size:16px;font-weight:600;color:#333}.examples-content .examples-list .example-item .example-header .example-actions{display:flex;gap:8px}.examples-content .examples-list .example-item .example-header .example-actions .btn{padding:4px 12px;font-size:12px;border-radius:4px;cursor:pointer;transition:all .2s ease}.examples-content .examples-list .example-item .example-header .example-actions .btn.btn-outline-primary{color:#007bff;border:1px solid #007bff;background-color:transparent}.examples-content .examples-list .example-item .example-header .example-actions .btn.btn-outline-primary:hover{color:#fff;background-color:#007bff}.examples-content .examples-list .example-item .example-header .example-actions .btn.btn-outline-secondary{color:#6c757d;border:1px solid #6c757d;background-color:transparent}.examples-content .examples-list .example-item .example-header .example-actions .btn.btn-outline-secondary:hover{color:#fff;background-color:#6c757d}.examples-content .examples-list .example-item .example-description{padding:12px 16px;color:#666;font-size:14px;line-height:1.5;border-bottom:1px solid #e1e5e9}.examples-content .examples-list .example-item .example-description a{color:#007bff;text-decoration:none}.examples-content .examples-list .example-item .example-description a:hover{text-decoration:underline}.examples-content .examples-list .example-item .example-yaml{background-color:#f8f9fa}.examples-content .examples-list .example-item .example-yaml pre{margin:0;padding:16px;background-color:transparent;border:none;font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:13px;line-height:1.4;color:#333;overflow-x:auto}.examples-content .examples-list .example-item .example-yaml pre code{background-color:transparent;padding:0;color:inherit}\n"], dependencies: [{ kind: "ngmodule", type: IconModule }, { kind: "component", type: i1.IconComponent, selector: "aui-icon", inputs: ["icon", "light", "dark", "link", "margin", "size", "color", "background", "backgroundColor"] }, { kind: "ngmodule", type: TabsModule }, { kind: "component", type: i1.TabGroupComponent, selector: "aui-tab-group", inputs: ["selectedIndex", "tab", "type", "title", "size", "lazy"], outputs: ["selectedIndexChange", "tabChange", "selectedTabChange", "focusChange"], exportAs: ["auiTabGroup"] }, { kind: "component", type: i1.TabComponent, selector: "aui-tab", inputs: ["name", "label", "closeable", "disabled"], outputs: ["close"], exportAs: ["auiTab"] }, { kind: "directive", type: i1.TabLabelDirective, selector: "[auiTabLabel]" }, { kind: "directive", type: i1.TabContentDirective, selector: "[auiTabContent]" }, { kind: "ngmodule", type: ButtonModule }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "pipe", type: KeyValuePipe, name: "keyvalue" }, { kind: "pipe", type: ParseJsonTranslatePipe, name: "aclParseJsonTranslate" }, { kind: "pipe", type: PurePipe, name: "pure" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
13350
|
+
}
|
|
13351
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceYamlSidebarComponent, decorators: [{
|
|
13352
|
+
type: Component,
|
|
13353
|
+
args: [{ selector: 'acl-resource-yaml-sidebar', changeDetection: ChangeDetectionStrategy.OnPush, standalone: true, imports: [
|
|
13354
|
+
TranslatePipe,
|
|
13355
|
+
KeyValuePipe,
|
|
13356
|
+
ParseJsonTranslatePipe,
|
|
13357
|
+
IconModule,
|
|
13358
|
+
TabsModule,
|
|
13359
|
+
ButtonModule,
|
|
13360
|
+
PurePipe,
|
|
13361
|
+
], template: "<div class=\"schema-header\">\n <span>{{ resourceKind }}</span>\n <aui-icon\n icon=\"xmark\"\n (click)=\"close.next()\"\n ></aui-icon>\n</div>\n<aui-tab-group type=\"card\">\n @if (schemaEnable && hasSchema) {\n <aui-tab>\n <ng-container *auiTabLabel> Schema </ng-container>\n <ng-container *auiTabContent>\n @if (schema) {\n <div class=\"schema-content\">\n <div class=\"schema-path\">\n @if (path.length) {\n <a\n href=\"javascript:\"\n (click)=\"refresh()\"\n >{{ resourceKind }}</a\n >\n }\n @for (p of path; track p; let i = $index; let isLast = $last) {\n @if (!isLast) {\n <span class=\"path-mark\">></span>\n <a\n href=\"javascript:\"\n (click)=\"navigateToPath(i)\"\n >{{ p }}</a\n >\n }\n @if (isLast) {\n <span class=\"path-mark\">></span>\n <span>{{ p }}</span>\n }\n }\n </div>\n @if (currentSchemaDescription) {\n <div\n class=\"schema-desc\"\n [innerHTML]=\"\n currentSchemaDescription\n | aclParseJsonTranslate\n | pure: processDescription\n \"\n ></div>\n }\n <div class=\"schema-list\">\n @for (item of properties | keyvalue; track item) {\n <div class=\"schema-item\">\n <h3>\n <span>{{ item.key }}</span>\n <span class=\"obj-type\">{{ item.value.type }}</span>\n </h3>\n <p\n [innerHTML]=\"\n item.value.description | pure: processDescription\n \"\n ></p>\n @if (item.value | pure: hasViewableContent) {\n <p>\n <a\n href=\"javascript:\"\n (click)=\"drillDownToProperty(item.key)\"\n >\n {{ 'view_detail' | translate }}\n </a>\n </p>\n }\n </div>\n }\n </div>\n </div>\n }\n </ng-container>\n </aui-tab>\n }\n @if (exampleEnable && hasExamples) {\n <aui-tab>\n <ng-container *auiTabLabel> Examples </ng-container>\n <ng-container *auiTabContent>\n <div class=\"example-list\">\n @for (example of examples; track example; let i = $index) {\n <div class=\"example-item\">\n <h3>\n {{ i + 1 }}. <span>{{ example.title }}</span>\n </h3>\n <p\n [innerHTML]=\"example.description | pure: processDescription\"\n ></p>\n <p class=\"tw-flex tw-justify-between\">\n <a\n href=\"javascript:\"\n (click)=\"tryExample(example)\"\n >\n <aui-icon\n icon=\"arrow_turn_up\"\n size=\"14\"\n margin=\"right\"\n ></aui-icon>\n <span>Try it</span>\n </a>\n <a\n href=\"javascript:\"\n (click)=\"downloadYaml(example)\"\n >\n <aui-icon\n icon=\"download\"\n size=\"14\"\n margin=\"right\"\n ></aui-icon>\n <span>Download YAML</span>\n </a>\n </p>\n </div>\n }\n </div>\n </ng-container>\n </aui-tab>\n }\n</aui-tab-group>\n", styles: [":host{display:block;box-sizing:border-box;min-width:360px;padding:16px;background-color:rgb(var(--aui-color-n-10));box-shadow:0 0 4px rgba(var(--aui-color-n-1),.16);margin-left:12px;overflow-y:scroll}:host::-webkit-scrollbar{width:8px;height:4px}:host::-webkit-scrollbar-thumb{border-radius:4px;background-color:rgb(var(--aui-color-n-7))}:host::-webkit-scrollbar-thumb:hover{background-color:rgb(var(--aui-color-n-5))}:host::-webkit-scrollbar-corner{background-color:transparent}aui-tab-group{display:block;margin-top:5px}.schema-header{height:40px;display:flex;justify-content:space-between;align-items:center;font-size:18px}.schema-header aui-icon{font-size:16px;color:rgb(var(--aui-color-n-6));cursor:pointer}.schema-header aui-icon:hover{color:rgb(var(--aui-color-primary))}.schema-content{line-height:20px;overflow-y:auto;height:calc(100% - 40px)}.schema-content::-webkit-scrollbar{width:8px;height:4px}.schema-content::-webkit-scrollbar-thumb{border-radius:4px;background-color:rgb(var(--aui-color-n-7))}.schema-content::-webkit-scrollbar-thumb:hover{background-color:rgb(var(--aui-color-n-5))}.schema-content::-webkit-scrollbar-corner{background-color:transparent}.schema-desc{margin-bottom:12px}.schema-desc a{color:#007bff;text-decoration:none}.schema-desc a:hover{text-decoration:underline}.schema-path{display:flex;flex-wrap:wrap}.schema-path *{margin-left:2px;word-break:break-all}.schema-path span:first-child{margin-right:2px}.schema-path .path-mark{margin:0 4px;color:rgb(var(--aui-color-n-6))}.schema-path{margin-bottom:12px}.schema-list .schema-item:not(:last-of-type),.schema-list .example-item:not(:last-of-type),.example-list .schema-item:not(:last-of-type),.example-list .example-item:not(:last-of-type){border-bottom:1px solid rgb(var(--aui-color-border));margin-bottom:12px}.schema-list .schema-item,.schema-list .example-item,.example-list .schema-item,.example-list .example-item{padding-left:16px}.schema-list .schema-item h3:before,.example-list .schema-item h3:before{content:\"\";display:block;width:6px;height:6px;border-radius:50%;background-color:rgb(var(--aui-color-n-6));position:absolute;left:-12px;top:8px}.schema-list h3,.example-list h3{position:relative;font-weight:500;margin-bottom:12px;word-break:break-word}.schema-list h3 span,.example-list h3 span{margin-right:4px}.schema-list h3 .obj-type,.example-list h3 .obj-type{color:rgb(var(--aui-color-n-4))}.schema-list p,.example-list p{margin-bottom:12px;word-break:break-word}.schema-list p a,.example-list p a{color:#007bff;text-decoration:none}.schema-list p a:hover,.example-list p a:hover{text-decoration:underline}.schema-examples{padding:16px}.examples-header{margin-bottom:16px}.examples-header h3{margin:0;font-size:18px;font-weight:600;color:#333}.examples-content .examples-list .example-item{margin-bottom:24px;border:1px solid #e1e5e9;border-radius:6px;overflow:hidden}.examples-content .examples-list .example-item:last-child{margin-bottom:0}.examples-content .examples-list .example-item .example-header{display:flex;justify-content:space-between;align-items:center;padding:12px 16px;background-color:#f8f9fa;border-bottom:1px solid #e1e5e9}.examples-content .examples-list .example-item .example-header .example-title{margin:0;font-size:16px;font-weight:600;color:#333}.examples-content .examples-list .example-item .example-header .example-actions{display:flex;gap:8px}.examples-content .examples-list .example-item .example-header .example-actions .btn{padding:4px 12px;font-size:12px;border-radius:4px;cursor:pointer;transition:all .2s ease}.examples-content .examples-list .example-item .example-header .example-actions .btn.btn-outline-primary{color:#007bff;border:1px solid #007bff;background-color:transparent}.examples-content .examples-list .example-item .example-header .example-actions .btn.btn-outline-primary:hover{color:#fff;background-color:#007bff}.examples-content .examples-list .example-item .example-header .example-actions .btn.btn-outline-secondary{color:#6c757d;border:1px solid #6c757d;background-color:transparent}.examples-content .examples-list .example-item .example-header .example-actions .btn.btn-outline-secondary:hover{color:#fff;background-color:#6c757d}.examples-content .examples-list .example-item .example-description{padding:12px 16px;color:#666;font-size:14px;line-height:1.5;border-bottom:1px solid #e1e5e9}.examples-content .examples-list .example-item .example-description a{color:#007bff;text-decoration:none}.examples-content .examples-list .example-item .example-description a:hover{text-decoration:underline}.examples-content .examples-list .example-item .example-yaml{background-color:#f8f9fa}.examples-content .examples-list .example-item .example-yaml pre{margin:0;padding:16px;background-color:transparent;border:none;font-family:Monaco,Menlo,Ubuntu Mono,monospace;font-size:13px;line-height:1.4;color:#333;overflow-x:auto}.examples-content .examples-list .example-item .example-yaml pre code{background-color:transparent;padding:0;color:inherit}\n"] }]
|
|
13362
|
+
}], propDecorators: { resource: [{
|
|
13363
|
+
type: Input
|
|
13364
|
+
}], schema: [{
|
|
13365
|
+
type: Input
|
|
13366
|
+
}], close: [{
|
|
13367
|
+
type: Output
|
|
13368
|
+
}], tryYaml: [{
|
|
13369
|
+
type: Output
|
|
13370
|
+
}], schemaEnable: [{
|
|
13371
|
+
type: Input
|
|
13372
|
+
}], exampleEnable: [{
|
|
13373
|
+
type: Input
|
|
13374
|
+
}], extraExamples: [{
|
|
13375
|
+
type: Input
|
|
13376
|
+
}] } });
|
|
13377
|
+
|
|
13378
|
+
class ResourceYamlEditorComponent {
|
|
13379
|
+
set originalValue(value) {
|
|
13380
|
+
this._originalValue = value || '';
|
|
13381
|
+
}
|
|
13382
|
+
get originalValue() {
|
|
13383
|
+
return this._originalValue;
|
|
13384
|
+
}
|
|
13385
|
+
constructor() {
|
|
13386
|
+
this.destroy$ = new Subject();
|
|
13387
|
+
this._value = '';
|
|
13388
|
+
this._originalValue = '';
|
|
13389
|
+
this.onChange = (_value) => {
|
|
13390
|
+
// Placeholder for form control change callback
|
|
13391
|
+
};
|
|
13392
|
+
this.onTouched = () => {
|
|
13393
|
+
// Placeholder for form control touched callback
|
|
13394
|
+
};
|
|
13395
|
+
this.showSidebar$$ = new BehaviorSubject(true);
|
|
13396
|
+
this.showDebugPanel$$ = new BehaviorSubject(true);
|
|
13397
|
+
this.monacoEditor = null;
|
|
13398
|
+
this.registeredSchemas = new Set();
|
|
13399
|
+
this.yamlUtil = inject(YamlUtilService);
|
|
13400
|
+
this.schemaService = inject(KubernetesSchemaService);
|
|
13401
|
+
this.monacoLanguageService = inject(MonacoLanguageService);
|
|
13402
|
+
this.hasWrapper = true;
|
|
13403
|
+
this.showDebugInfo = false;
|
|
13404
|
+
this.sidebarEnable = true;
|
|
13405
|
+
this.schemaEnable = true;
|
|
13406
|
+
this.exampleEnable = true;
|
|
13407
|
+
this.autoFoldManagedFields = true;
|
|
13408
|
+
this.options = yamlWriteMinimapOptions;
|
|
13409
|
+
this.actionsConfig = updateActions;
|
|
13410
|
+
this.tryYaml = new EventEmitter();
|
|
13411
|
+
this.autoFillNamespace = true;
|
|
13412
|
+
this.hasFolded = false;
|
|
13413
|
+
/**
|
|
13414
|
+
* 自动获取的 schema,当没有手动提供 schema 时使用
|
|
13415
|
+
*/
|
|
13416
|
+
this.autoSchema$ = this.resource$.pipe(switchMap(resource => {
|
|
13417
|
+
if (!resource) {
|
|
13418
|
+
return of(null);
|
|
13419
|
+
}
|
|
13420
|
+
const firstResource = (Array.isArray(resource) ? resource[0] : resource);
|
|
13421
|
+
if (!firstResource?.apiVersion || !firstResource?.kind) {
|
|
13422
|
+
return of(null);
|
|
13423
|
+
}
|
|
13424
|
+
return this.schemaService.getResourceSchema(firstResource.apiVersion, firstResource.kind, this.clusterName);
|
|
13425
|
+
}), publishRef());
|
|
13426
|
+
/**
|
|
13427
|
+
* 最终使用的 schema,优先使用手动提供的,否则使用自动获取的
|
|
13428
|
+
*/
|
|
13429
|
+
this.finalSchema$ = combineLatest([this.schema$, this.autoSchema$]).pipe(map(([manualSchema, autoSchema]) => manualSchema || autoSchema), distinctUntilChanged(), shareReplay(1));
|
|
13430
|
+
this.yamlSchemaService =
|
|
13431
|
+
this.monacoLanguageService.getLanguageSchemaService(['yaml', 'yamlDefaults'], yamlDefaults);
|
|
13432
|
+
// 自动设置 schema
|
|
13433
|
+
combineLatest([this.resource$, this.finalSchema$])
|
|
13434
|
+
.pipe(takeUntil(this.destroy$))
|
|
13435
|
+
.subscribe(([resource, schema]) => {
|
|
13436
|
+
if (resource && schema) {
|
|
13437
|
+
const firstResource = Array.isArray(resource)
|
|
13438
|
+
? resource[0]
|
|
13439
|
+
: resource;
|
|
13440
|
+
if (firstResource && !Array.isArray(firstResource)) {
|
|
13441
|
+
this.setYamlSchema(firstResource, schema);
|
|
13442
|
+
}
|
|
13443
|
+
}
|
|
13444
|
+
});
|
|
13445
|
+
this.autoSchema$.pipe(takeUntil(this.destroy$)).subscribe();
|
|
13446
|
+
}
|
|
13447
|
+
ngAfterViewInit() {
|
|
13448
|
+
// 监听 YAML 内容变化,自动折叠 managedFields
|
|
13449
|
+
// if (this.autoFoldManagedFields && this.schemaService.definitions) {
|
|
13450
|
+
// this.selfFoldManagedFields();
|
|
13451
|
+
// }
|
|
13452
|
+
if (this.autoFoldManagedFields) {
|
|
13453
|
+
this.selfFoldManagedFields();
|
|
13454
|
+
}
|
|
13455
|
+
}
|
|
13456
|
+
selfFoldManagedFields() {
|
|
13457
|
+
if (this.hasFolded) {
|
|
13458
|
+
return;
|
|
13459
|
+
}
|
|
13460
|
+
this.hasFolded = true;
|
|
13461
|
+
setTimeout(() => {
|
|
13462
|
+
const editor = this.getEditorInstance();
|
|
13463
|
+
if (editor) {
|
|
13464
|
+
foldManagedFields(editor);
|
|
13465
|
+
}
|
|
13466
|
+
}, 0);
|
|
13467
|
+
}
|
|
13468
|
+
get value() {
|
|
13469
|
+
return this._value;
|
|
13470
|
+
}
|
|
13471
|
+
set value(val) {
|
|
13472
|
+
this._value = val;
|
|
13473
|
+
this.onChange(val);
|
|
13474
|
+
this.onTouched();
|
|
13475
|
+
}
|
|
13476
|
+
// ControlValueAccessor implementation
|
|
13477
|
+
writeValue(value) {
|
|
13478
|
+
this._value = value || '';
|
|
13479
|
+
}
|
|
13480
|
+
registerOnChange(fn) {
|
|
13481
|
+
this.onChange = fn;
|
|
13482
|
+
}
|
|
13483
|
+
registerOnTouched(fn) {
|
|
13484
|
+
this.onTouched = fn;
|
|
13485
|
+
}
|
|
13486
|
+
toggleSidebar() {
|
|
13487
|
+
this.showSidebar$$.next(!this.showSidebar$$.value);
|
|
13488
|
+
}
|
|
13489
|
+
toggleDebugInfo() {
|
|
13490
|
+
this.showDebugPanel$$.next(!this.showDebugPanel$$.value);
|
|
13491
|
+
}
|
|
13492
|
+
getCurrentResource() {
|
|
13493
|
+
const resource = this.resource;
|
|
13494
|
+
if (Array.isArray(resource)) {
|
|
13495
|
+
return resource.length > 0 ? resource[0] : null;
|
|
13496
|
+
}
|
|
13497
|
+
return resource || null;
|
|
13498
|
+
}
|
|
13499
|
+
getCurrentSchema() {
|
|
13500
|
+
return this.schema || null;
|
|
13501
|
+
}
|
|
13502
|
+
getDebugInfo() {
|
|
13503
|
+
const resource = this.getCurrentResource();
|
|
13504
|
+
return {
|
|
13505
|
+
hasResource: !!resource,
|
|
13506
|
+
resourceApiVersion: resource?.apiVersion,
|
|
13507
|
+
resourceKind: resource?.kind,
|
|
13508
|
+
hasManualSchema: !!this.schema,
|
|
13509
|
+
};
|
|
13510
|
+
}
|
|
13511
|
+
onTryYaml(yamlContent) {
|
|
13512
|
+
let targetYaml = yamlContent;
|
|
13513
|
+
if (this.autoFillNamespace && this.namespace) {
|
|
13514
|
+
targetYaml = parseAll(yamlContent)
|
|
13515
|
+
.filter(r => !!r)
|
|
13516
|
+
.map((r) => {
|
|
13517
|
+
if (!r?.metadata?.namespace) {
|
|
13518
|
+
return {
|
|
13519
|
+
...r,
|
|
13520
|
+
metadata: {
|
|
13521
|
+
...r.metadata,
|
|
13522
|
+
namespace: this.namespace,
|
|
13523
|
+
},
|
|
13524
|
+
};
|
|
13525
|
+
}
|
|
13526
|
+
return r;
|
|
13527
|
+
})
|
|
13528
|
+
.map(r => stringify$1(r, { sortMapEntries: true }))
|
|
13529
|
+
.join('---\r\n');
|
|
13530
|
+
}
|
|
13531
|
+
this.tryYaml.emit(targetYaml);
|
|
13532
|
+
}
|
|
13533
|
+
/**
|
|
13534
|
+
* 设置 YAML schema 以提供 hover 提示和自动完成
|
|
13535
|
+
*/
|
|
13536
|
+
setYamlSchema(resource, schema) {
|
|
13537
|
+
if (!schema) {
|
|
13538
|
+
return;
|
|
13539
|
+
}
|
|
13540
|
+
// 使用 apiVersion + kind 组合作为标识
|
|
13541
|
+
const apiVersion = resource?.apiVersion || 'unknown';
|
|
13542
|
+
const kind = resource?.kind || 'unknown';
|
|
13543
|
+
const schemaKey = `${apiVersion}/${kind}`;
|
|
13544
|
+
this.modelUri = `${schemaKey}.yaml`;
|
|
13545
|
+
this.selfFoldManagedFields();
|
|
13546
|
+
// 检查是否已经注册过相同的 schema,避免重复注册
|
|
13547
|
+
if (this.registeredSchemas.has(schemaKey)) {
|
|
13548
|
+
return;
|
|
13549
|
+
}
|
|
13550
|
+
// 获取完整的 definitions 以支持 $ref 引用
|
|
13551
|
+
// todo: 书勋,这里为啥还需要取 definitions
|
|
13552
|
+
// const definitions = this.schemaService.definitions || {};
|
|
13553
|
+
// 创建包含完整 definitions 的 schema 对象
|
|
13554
|
+
// const fullSchema = {
|
|
13555
|
+
// ...schema,
|
|
13556
|
+
// definitions,
|
|
13557
|
+
// };
|
|
13558
|
+
// 确保schema被正确注册,并启用自动完成功能
|
|
13559
|
+
this.yamlSchemaService.addSchema({
|
|
13560
|
+
uri: `k8s://${schemaKey}.schema.json`,
|
|
13561
|
+
fileMatch: [this.modelUri],
|
|
13562
|
+
schema,
|
|
13563
|
+
});
|
|
13564
|
+
this.registeredSchemas.add(schemaKey);
|
|
13565
|
+
}
|
|
13566
|
+
/**
|
|
13567
|
+
* 获取 Monaco 编辑器实例
|
|
13568
|
+
*/
|
|
13569
|
+
getEditorInstance() {
|
|
13570
|
+
if (!this.monacoEditor && this.codeEditorRef?.editor) {
|
|
13571
|
+
this.monacoEditor = this.codeEditorRef.editor;
|
|
13572
|
+
}
|
|
13573
|
+
return this.monacoEditor;
|
|
13574
|
+
}
|
|
13575
|
+
/**
|
|
13576
|
+
* 手动折叠 managedFields
|
|
13577
|
+
*/
|
|
13578
|
+
foldManagedFields() {
|
|
13579
|
+
const editor = this.getEditorInstance();
|
|
13580
|
+
if (editor) {
|
|
13581
|
+
foldManagedFields(editor);
|
|
13582
|
+
}
|
|
13583
|
+
}
|
|
13584
|
+
ngOnDestroy() {
|
|
13585
|
+
this.destroy$.next();
|
|
13586
|
+
this.destroy$.complete();
|
|
13587
|
+
}
|
|
13588
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceYamlEditorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
13589
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.1", type: ResourceYamlEditorComponent, isStandalone: true, selector: "acl-resource-yaml-editor", inputs: { hasWrapper: "hasWrapper", showDebugInfo: "showDebugInfo", sidebarEnable: "sidebarEnable", schema: "schema", schemaEnable: "schemaEnable", exampleEnable: "exampleEnable", resource: "resource", autoFoldManagedFields: "autoFoldManagedFields", originalValue: "originalValue", options: "options", actionsConfig: "actionsConfig", autoFillNamespace: "autoFillNamespace", extraExamples: "extraExamples", clusterName: "clusterName", namespace: "namespace" }, outputs: { tryYaml: "tryYaml" }, providers: [
|
|
13590
|
+
{
|
|
13591
|
+
provide: NG_VALUE_ACCESSOR,
|
|
13592
|
+
useExisting: forwardRef(() => ResourceYamlEditorComponent),
|
|
13593
|
+
multi: true,
|
|
13594
|
+
},
|
|
13595
|
+
], viewQueries: [{ propertyName: "codeEditorRef", first: true, predicate: ["codeEditor"], descendants: true }], ngImport: i0, template: "@if (hasWrapper) {\n <aui-card>\n <ng-container *ngTemplateOutlet=\"content\" />\n </aui-card>\n} @else {\n <div\n class=\"yaml-editor-container\"\n [class.with-sidebar]=\"showSidebar$$ | async\"\n >\n <div class=\"yaml-editor-section\">\n <aui-code-editor\n #codeEditor\n name=\"yaml\"\n [originalValue]=\"originalValue\"\n [(ngModel)]=\"value\"\n [options]=\"options\"\n [actionsConfig]=\"actionsConfig\"\n [modelUri]=\"modelUri\"\n >\n <ng-container auiCodeEditorToolbarRightSide>\n <!-- Schema \u6309\u94AE\uFF1A\u5F53\u542F\u7528\u4FA7\u8FB9\u680F\u65F6\u663E\u793A -->\n @if (sidebarEnable && !!(resource$ | async)) {\n <button\n [hidden]=\"!!codeEditor.fullscreenDialog\"\n class=\"aui-code-editor-toolbar__control-button\"\n type=\"button\"\n [disabled]=\"!(finalSchema$ | async) && !exampleEnable\"\n (click)=\"toggleSidebar()\"\n [auiTooltip]=\"\n ((showSidebar$$ | async) ? 'hide_sidebar' : 'view_sidebar')\n | translate\n \"\n >\n <aui-icon\n [icon]=\"\n (showSidebar$$ | async)\n ? 'prod:expand_sidebar'\n : 'prod:collapse_sidebar'\n \"\n ></aui-icon>\n </button>\n }\n </ng-container>\n </aui-code-editor>\n </div>\n @if ((showSidebar$$ | async) && (resource$ | async)) {\n <div class=\"yaml-sidebar-section\">\n <acl-resource-yaml-sidebar\n [resource]=\"getCurrentResource()\"\n [schema]=\"finalSchema$ | async\"\n [schemaEnable]=\"schemaEnable\"\n [exampleEnable]=\"exampleEnable\"\n [extraExamples]=\"extraExamples\"\n (close)=\"toggleSidebar()\"\n (tryYaml)=\"onTryYaml($event)\"\n ></acl-resource-yaml-sidebar>\n </div>\n }\n </div>\n}\n<ng-template #content>\n <div\n class=\"yaml-editor-container\"\n [class.with-sidebar]=\"showSidebar$$ | async\"\n >\n <div class=\"yaml-editor-section\">\n <aui-code-editor\n #codeEditor\n name=\"yaml\"\n [originalValue]=\"originalValue\"\n [(ngModel)]=\"value\"\n [options]=\"options\"\n [actionsConfig]=\"actionsConfig\"\n [modelUri]=\"modelUri\"\n >\n <ng-container auiCodeEditorToolbarRightSide>\n <!-- Schema \u6309\u94AE\uFF1A\u5F53\u542F\u7528\u4FA7\u8FB9\u680F\u65F6\u663E\u793A -->\n @if (sidebarEnable && !!(resource$ | async)) {\n <button\n [hidden]=\"!!codeEditor.fullscreenDialog\"\n class=\"aui-code-editor-toolbar__control-button\"\n type=\"button\"\n [disabled]=\"!(finalSchema$ | async) && !exampleEnable\"\n (click)=\"toggleSidebar()\"\n [auiTooltip]=\"\n ((showSidebar$$ | async) ? 'hide_sidebar' : 'view_sidebar')\n | translate\n \"\n >\n <aui-icon\n [icon]=\"\n (showSidebar$$ | async)\n ? 'prod:expand_sidebar'\n : 'prod:collapse_sidebar'\n \"\n ></aui-icon>\n </button>\n }\n </ng-container>\n </aui-code-editor>\n </div>\n @if ((showSidebar$$ | async) && (resource$ | async)) {\n <div class=\"yaml-sidebar-section\">\n <acl-resource-yaml-sidebar\n [resource]=\"getCurrentResource()\"\n [schema]=\"finalSchema$ | async\"\n [schemaEnable]=\"schemaEnable\"\n [exampleEnable]=\"exampleEnable\"\n [extraExamples]=\"extraExamples\"\n (close)=\"toggleSidebar()\"\n (tryYaml)=\"onTryYaml($event)\"\n ></acl-resource-yaml-sidebar>\n </div>\n }\n </div>\n</ng-template>\n", styles: [":host(:not(.dialog-content)) ::ng-deep .aui-code-editor{min-height:100%}:host(:not(.dialog-content)){display:block;height:calc(100vh - (var(--acl-page-header-height) + 44px) - 147px)}:host(:not(.dialog-content))>.aui-card{height:100%}:host(:not(.dialog-content))>.aui-card .aui-card__content,:host(:not(.dialog-content))>.aui-card aui-code-editor,:host(:not(.dialog-content))>.aui-card .aui-code-editor{height:100%;min-height:100%}:host{display:block}:host ::ng-deep aui-card,:host ::ng-deep .aui-card,:host ::ng-deep .aui-card__content{height:100%}:host ::ng-deep .aui-checkbox{margin-right:0}:host aui-code-editor{height:100%}.yaml-editor-container{display:flex;height:100%}.yaml-editor-container.with-sidebar .yaml-editor-section{flex:2;min-width:0}.yaml-editor-container.with-sidebar .yaml-sidebar-section{flex:1 0 0%}.yaml-editor-container:not(.with-sidebar) .yaml-editor-section{flex:1}.yaml-editor-section{display:flex;flex-direction:column;height:100%}.yaml-editor-section aui-code-editor{flex:1;height:100%}.yaml-sidebar-section{display:flex;flex-direction:column;height:100%}.yaml-sidebar-section acl-resource-yaml-sidebar{flex:1;height:100%}.yaml-debug-section{position:absolute;top:0;right:0;width:350px;height:100%;background:var(--aui-color-bg-container);border-left:1px solid var(--aui-color-border-default);z-index:1000;overflow-y:auto}.debug-panel{padding:16px;font-size:12px}.debug-panel h4{margin:0 0 12px;font-size:14px;color:var(--aui-color-text-primary)}.debug-panel .debug-item{margin-bottom:16px}.debug-panel .debug-item strong{color:var(--aui-color-text-primary);display:block;margin-bottom:4px}.debug-panel .debug-item ul{margin:0;padding-left:16px}.debug-panel .debug-item ul li{margin-bottom:2px;color:var(--aui-color-text-secondary)}.debug-panel .debug-actions{border-top:1px solid var(--aui-color-border-default);padding-top:12px;text-align:right}@media(width<=1200px){.yaml-editor-container.with-sidebar .yaml-sidebar-section{width:350px}}@media(width<=992px){.yaml-editor-container.with-sidebar{flex-direction:column}.yaml-editor-container.with-sidebar .yaml-editor-section{flex:1;min-height:50%}.yaml-editor-container.with-sidebar .yaml-sidebar-section{width:100%;height:50%;border-top:1px solid var(--aui-color-border, #e0e0e0);border-left:none}}\n"], dependencies: [{ kind: "component", type: i1.CardComponent, selector: "aui-card", inputs: ["divider"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "ngmodule", type: ButtonModule }, { kind: "ngmodule", type: CodeEditorModule }, { kind: "component", type: i3.CodeEditorComponent, selector: "aui-code-editor", inputs: ["options", "plain", "showLanguageLabel", "value", "originalValue", "actionsConfig", "previewMode", "diffMode", "modelUri"], outputs: ["editorChange", "editorBlur"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: ResourceYamlSidebarComponent, selector: "acl-resource-yaml-sidebar", inputs: ["resource", "schema", "schemaEnable", "exampleEnable", "extraExamples"], outputs: ["close", "tryYaml"] }, { kind: "ngmodule", type: IconModule }, { kind: "component", type: i1.IconComponent, selector: "aui-icon", inputs: ["icon", "light", "dark", "link", "margin", "size", "color", "background", "backgroundColor"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i1.TooltipDirective, selector: "[auiTooltip]", inputs: ["auiTooltip", "auiTooltipContext", "auiTooltipClass", "auiTooltipType", "auiTooltipPosition", "auiTooltipTrigger", "auiTooltipDisabled", "auiTooltipHideOnClick", "auiTooltipAnimType"], outputs: ["auiTooltipVisibleChange"], exportAs: ["auiTooltip"] }, { kind: "pipe", type: AsyncPipe, name: "async" }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
13596
|
+
}
|
|
13597
|
+
__decorate([
|
|
13598
|
+
ObservableInput(),
|
|
13599
|
+
__metadata("design:type", Observable)
|
|
13600
|
+
], ResourceYamlEditorComponent.prototype, "resource$", void 0);
|
|
13601
|
+
__decorate([
|
|
13602
|
+
ObservableInput(),
|
|
13603
|
+
__metadata("design:type", Observable)
|
|
13604
|
+
], ResourceYamlEditorComponent.prototype, "schema$", void 0);
|
|
13605
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.1", ngImport: i0, type: ResourceYamlEditorComponent, decorators: [{
|
|
13606
|
+
type: Component,
|
|
13607
|
+
args: [{ selector: 'acl-resource-yaml-editor', preserveWhitespaces: false, standalone: true, imports: [
|
|
13608
|
+
CARD_MODULE,
|
|
13609
|
+
FormsModule,
|
|
13610
|
+
CHECKBOX_MODULE,
|
|
13611
|
+
ButtonModule,
|
|
13612
|
+
CodeEditorModule,
|
|
13613
|
+
AsyncPipe,
|
|
13614
|
+
NgTemplateOutlet,
|
|
13615
|
+
ResourceYamlSidebarComponent,
|
|
13616
|
+
IconModule,
|
|
13617
|
+
TooltipModule,
|
|
13618
|
+
TranslatePipe,
|
|
13619
|
+
], providers: [
|
|
13620
|
+
{
|
|
13621
|
+
provide: NG_VALUE_ACCESSOR,
|
|
13622
|
+
useExisting: forwardRef(() => ResourceYamlEditorComponent),
|
|
13623
|
+
multi: true,
|
|
13624
|
+
},
|
|
13625
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (hasWrapper) {\n <aui-card>\n <ng-container *ngTemplateOutlet=\"content\" />\n </aui-card>\n} @else {\n <div\n class=\"yaml-editor-container\"\n [class.with-sidebar]=\"showSidebar$$ | async\"\n >\n <div class=\"yaml-editor-section\">\n <aui-code-editor\n #codeEditor\n name=\"yaml\"\n [originalValue]=\"originalValue\"\n [(ngModel)]=\"value\"\n [options]=\"options\"\n [actionsConfig]=\"actionsConfig\"\n [modelUri]=\"modelUri\"\n >\n <ng-container auiCodeEditorToolbarRightSide>\n <!-- Schema \u6309\u94AE\uFF1A\u5F53\u542F\u7528\u4FA7\u8FB9\u680F\u65F6\u663E\u793A -->\n @if (sidebarEnable && !!(resource$ | async)) {\n <button\n [hidden]=\"!!codeEditor.fullscreenDialog\"\n class=\"aui-code-editor-toolbar__control-button\"\n type=\"button\"\n [disabled]=\"!(finalSchema$ | async) && !exampleEnable\"\n (click)=\"toggleSidebar()\"\n [auiTooltip]=\"\n ((showSidebar$$ | async) ? 'hide_sidebar' : 'view_sidebar')\n | translate\n \"\n >\n <aui-icon\n [icon]=\"\n (showSidebar$$ | async)\n ? 'prod:expand_sidebar'\n : 'prod:collapse_sidebar'\n \"\n ></aui-icon>\n </button>\n }\n </ng-container>\n </aui-code-editor>\n </div>\n @if ((showSidebar$$ | async) && (resource$ | async)) {\n <div class=\"yaml-sidebar-section\">\n <acl-resource-yaml-sidebar\n [resource]=\"getCurrentResource()\"\n [schema]=\"finalSchema$ | async\"\n [schemaEnable]=\"schemaEnable\"\n [exampleEnable]=\"exampleEnable\"\n [extraExamples]=\"extraExamples\"\n (close)=\"toggleSidebar()\"\n (tryYaml)=\"onTryYaml($event)\"\n ></acl-resource-yaml-sidebar>\n </div>\n }\n </div>\n}\n<ng-template #content>\n <div\n class=\"yaml-editor-container\"\n [class.with-sidebar]=\"showSidebar$$ | async\"\n >\n <div class=\"yaml-editor-section\">\n <aui-code-editor\n #codeEditor\n name=\"yaml\"\n [originalValue]=\"originalValue\"\n [(ngModel)]=\"value\"\n [options]=\"options\"\n [actionsConfig]=\"actionsConfig\"\n [modelUri]=\"modelUri\"\n >\n <ng-container auiCodeEditorToolbarRightSide>\n <!-- Schema \u6309\u94AE\uFF1A\u5F53\u542F\u7528\u4FA7\u8FB9\u680F\u65F6\u663E\u793A -->\n @if (sidebarEnable && !!(resource$ | async)) {\n <button\n [hidden]=\"!!codeEditor.fullscreenDialog\"\n class=\"aui-code-editor-toolbar__control-button\"\n type=\"button\"\n [disabled]=\"!(finalSchema$ | async) && !exampleEnable\"\n (click)=\"toggleSidebar()\"\n [auiTooltip]=\"\n ((showSidebar$$ | async) ? 'hide_sidebar' : 'view_sidebar')\n | translate\n \"\n >\n <aui-icon\n [icon]=\"\n (showSidebar$$ | async)\n ? 'prod:expand_sidebar'\n : 'prod:collapse_sidebar'\n \"\n ></aui-icon>\n </button>\n }\n </ng-container>\n </aui-code-editor>\n </div>\n @if ((showSidebar$$ | async) && (resource$ | async)) {\n <div class=\"yaml-sidebar-section\">\n <acl-resource-yaml-sidebar\n [resource]=\"getCurrentResource()\"\n [schema]=\"finalSchema$ | async\"\n [schemaEnable]=\"schemaEnable\"\n [exampleEnable]=\"exampleEnable\"\n [extraExamples]=\"extraExamples\"\n (close)=\"toggleSidebar()\"\n (tryYaml)=\"onTryYaml($event)\"\n ></acl-resource-yaml-sidebar>\n </div>\n }\n </div>\n</ng-template>\n", styles: [":host(:not(.dialog-content)) ::ng-deep .aui-code-editor{min-height:100%}:host(:not(.dialog-content)){display:block;height:calc(100vh - (var(--acl-page-header-height) + 44px) - 147px)}:host(:not(.dialog-content))>.aui-card{height:100%}:host(:not(.dialog-content))>.aui-card .aui-card__content,:host(:not(.dialog-content))>.aui-card aui-code-editor,:host(:not(.dialog-content))>.aui-card .aui-code-editor{height:100%;min-height:100%}:host{display:block}:host ::ng-deep aui-card,:host ::ng-deep .aui-card,:host ::ng-deep .aui-card__content{height:100%}:host ::ng-deep .aui-checkbox{margin-right:0}:host aui-code-editor{height:100%}.yaml-editor-container{display:flex;height:100%}.yaml-editor-container.with-sidebar .yaml-editor-section{flex:2;min-width:0}.yaml-editor-container.with-sidebar .yaml-sidebar-section{flex:1 0 0%}.yaml-editor-container:not(.with-sidebar) .yaml-editor-section{flex:1}.yaml-editor-section{display:flex;flex-direction:column;height:100%}.yaml-editor-section aui-code-editor{flex:1;height:100%}.yaml-sidebar-section{display:flex;flex-direction:column;height:100%}.yaml-sidebar-section acl-resource-yaml-sidebar{flex:1;height:100%}.yaml-debug-section{position:absolute;top:0;right:0;width:350px;height:100%;background:var(--aui-color-bg-container);border-left:1px solid var(--aui-color-border-default);z-index:1000;overflow-y:auto}.debug-panel{padding:16px;font-size:12px}.debug-panel h4{margin:0 0 12px;font-size:14px;color:var(--aui-color-text-primary)}.debug-panel .debug-item{margin-bottom:16px}.debug-panel .debug-item strong{color:var(--aui-color-text-primary);display:block;margin-bottom:4px}.debug-panel .debug-item ul{margin:0;padding-left:16px}.debug-panel .debug-item ul li{margin-bottom:2px;color:var(--aui-color-text-secondary)}.debug-panel .debug-actions{border-top:1px solid var(--aui-color-border-default);padding-top:12px;text-align:right}@media(width<=1200px){.yaml-editor-container.with-sidebar .yaml-sidebar-section{width:350px}}@media(width<=992px){.yaml-editor-container.with-sidebar{flex-direction:column}.yaml-editor-container.with-sidebar .yaml-editor-section{flex:1;min-height:50%}.yaml-editor-container.with-sidebar .yaml-sidebar-section{width:100%;height:50%;border-top:1px solid var(--aui-color-border, #e0e0e0);border-left:none}}\n"] }]
|
|
13626
|
+
}], ctorParameters: () => [], propDecorators: { codeEditorRef: [{
|
|
13627
|
+
type: ViewChild,
|
|
13628
|
+
args: ['codeEditor', { static: false }]
|
|
13629
|
+
}], hasWrapper: [{
|
|
13630
|
+
type: Input
|
|
13631
|
+
}], showDebugInfo: [{
|
|
13632
|
+
type: Input
|
|
13633
|
+
}], sidebarEnable: [{
|
|
13634
|
+
type: Input
|
|
13635
|
+
}], schema: [{
|
|
13636
|
+
type: Input
|
|
13637
|
+
}], schemaEnable: [{
|
|
13638
|
+
type: Input
|
|
13639
|
+
}], exampleEnable: [{
|
|
13640
|
+
type: Input
|
|
13641
|
+
}], resource: [{
|
|
13642
|
+
type: Input
|
|
13643
|
+
}], autoFoldManagedFields: [{
|
|
13644
|
+
type: Input
|
|
13645
|
+
}], originalValue: [{
|
|
13646
|
+
type: Input
|
|
13647
|
+
}], options: [{
|
|
13648
|
+
type: Input
|
|
13649
|
+
}], actionsConfig: [{
|
|
13650
|
+
type: Input
|
|
13651
|
+
}], tryYaml: [{
|
|
13652
|
+
type: Output
|
|
13653
|
+
}], resource$: [], schema$: [], autoFillNamespace: [{
|
|
13654
|
+
type: Input
|
|
13655
|
+
}], extraExamples: [{
|
|
13656
|
+
type: Input
|
|
13657
|
+
}], clusterName: [{
|
|
13658
|
+
type: Input
|
|
13659
|
+
}], namespace: [{
|
|
13660
|
+
type: Input
|
|
13661
|
+
}] } });
|
|
13662
|
+
|
|
12307
13663
|
/**
|
|
12308
13664
|
* [[include:code/README.md]]
|
|
12309
13665
|
* @module code
|
|
@@ -12659,5 +14015,5 @@ const ASYNC_DATA_MODULE = [
|
|
|
12659
14015
|
* Generated bundle index. Do not edit.
|
|
12660
14016
|
*/
|
|
12661
14017
|
|
|
12662
|
-
export { ACTION, AIT_API_GROUP, ALL, ALL_VALUE, ANNOTATIONS, API_GATEWAY, ARGOCD_GROUP, ARRAY_FORM_TABLE_MODULE, ARRAY_TABLE_FORM_ERROR_BG, ASSIGN_ALL, ASYNC_DATA_MODULE, AccessMode, AccessModes, AclTableVirtualComponent, AclTableVirtualHeaderDefDirective, AclTableVirtualModule, AclTableVirtualPlaceholderDefDirective, AclTableVirtualRowDefDirective, AlaudaDeployStatus, AlaudaRunningStatus, ArrayFormTableComponent, ArrayFormTableFooterDirective, ArrayFormTableHeaderDirective, ArrayFormTableRowControlDirective, ArrayFormTableRowDirective, ArrayFormTableRowErrorDirective, ArrayFormTableRowSeparatorDirective, ArrayFormTableZeroStateDirective, AsyncDataLoader, AsyncFunctionValidatorDirective, AuiCodeEditorHelperDirective, BASE_TIMEZONE, BaseFormContainer, BaseNestedFormControl, BaseNestedFormControlPure, BaseStringMapFormComponent, Bracket, CHART_PICKER_TIME_RANGES, CLUSTER, COMMON_RESOURCE_DEFINITIONS, CORE_UNITS, CORE_UNIT_REG, CREATE, CREATED_AT, CREATION_TIMESTAMP, CREATOR, CRON_ENABLE_7_FOR_SUNDAY, CRON_FORMAT_ERROR, CRON_MIN_INTERVAL_ERROR, CRYPTO_HEADER_KEY, CRYPTO_KEY, CRYPTO_RANDOM_HEADER_KEY, CRYPTO_TYPE, CUSTOM, CUSTOMIZED, CUSTOM_RANGE, CalcPipe, CardSectionComponent, ClickOutsideDirective, CloudHelmRequestStateEnum, CodeDisplayDialogComponent, CoerceNumberDirective, ConfirmDeleteComponent, ConfirmDeleteContentDirective, ConfirmDeleteLabelDirective, ConfirmDeleteTipDirective, ControlValueTraceDirective, CronHumanReadablePipe, CronWeekDays, CrontabNextPipe, CurrentTimeComponent, DATE_FORMAT, DATE_TIME_FORMAT, DEFAULT_CODE_EDITOR_OPTIONS, DEFAULT_CONTAINER_ANNOTATION, DEFAULT_OPERATOR, DEFAULT_OPTIONS, DEFAULT_REASON, DELIMITER, DESCRIPTION, DISPLAY_NAME, DNS1123SubdomainValidator, DOMAIN_PATTERN, DOMAIN_PATTERN_BASE, DOT, DOWNGRADE_WATCH_ENABLED, DOWNGRADE_WATCH_POLLING, DUPLICATE_ERROR_KEY, DUPLICATION_JUSTIFY_STRATEGY, DataSource, DateRangePickerComponent, DeclareDirective, DefaultStatusColorMapper, DefaultStatusIconMapper, DeleteType, DeletingTagComponent, DisabledContainerComponent, DisabledDirective, DragHandleDirective, DurationPipe, E2eAttributeBindingDirective, EFFECT_DIRECTIVE_MODULE, EMAIL_PATTERN, EMPTY, ERRORS_MAPPER_MODULE, ESCAPE_DEACTIVATE_CHECK, ErrorStateComponent, ErrorsMapperComponent, ErrorsMapperDirective, FALSE, FIELDSET_GROUP_COMPONENTS, FeatureGateDirective, FieldSetColumnComponent, FieldSetColumnGroupComponent, FieldSetGroupComponent, FieldSetItemActionDirective, FieldSetItemComponent, FileResultType, FoldableBlockComponent, FoldableItemInTableComponent, FormItemMarginEffectDirective, FunctionValidatorDirective, GLOBAL_CLUSTER, GenericStatusColor, GenericStatusIcon, GuardStatus, HTTP_ADDRESS_PATTERN, HTTP_DUAL_IP_OR_DOMAIN_PATTERN, HTTP_IP_OR_DOMAIN_PATTERN, HYPHEN, HelmRequestPhaseEnum, HelpDocDirective, HelpDocUrlPipe, HelpDocumentComponent, HelpDocumentService, IMAGE_TAG_PATTERN, INT_PATTERN, INT_ZERO_PATTERN, IPV4_IPV6_ADDRESS_HOSTNAME_PORT_PATTERN, IPV6_ADDRESS_HOSTNAME_PATTERN, IPV6_ADDRESS_HOSTNAME_PORT_PATTERN, IPV6_PATTERN_BASE, IP_ADDRESS_HOSTNAME_PATTERN, IP_ADDRESS_HOSTNAME_PATTERN_EXTEND, IP_ADDRESS_HOSTNAME_PORT_PATTERN, IP_ADDRESS_PATTERN, IP_ADDRESS_PORT_PATTERN, IP_ADDRESS_SUBNET_PATTERN, IP_PATTERN, IP_PATTERN_BASE, IP_V4_OR_V6_PATTERN, IP_V6_ADDRESS_PATTERN, IP_V6_PATTERN, InterceptDeactivateDirective, InterceptDeactivateGuard, InterceptDeactivateService, JobStatusColorMapper, JobStatusEnum, JobStatusIconMapper, K8SResourceList, K8SResourceListFooterComponent, K8SResourcePagedList, K8S_APP_API_GROUP, K8S_CORE_API_GROUP, K8S_RESOURCE_LABEL_KEY_NAME_PATTERN, K8S_RESOURCE_LABEL_KEY_PREFIX_PATTERN, K8S_RESOURCE_LABEL_VALUE_PATTERN, K8S_RESOURCE_LIST_MODULE, K8S_RESOURCE_NAME_START_WITH_CHARS_ONLY, K8S_RESOURCE_TRANSLATE_KEY, K8sListFooterLoadingErrorDirective, K8sListFooterNoDataDirective, K8sResourceAction, K8sResourceMarkComponent, K8sResourceTranslateKeyPipe, K8sSharedUtilService, K8sYamlDisplayDialogComponent, KNOWN_COLUMNS, KeyValueFormTableComponent, KeyValueTableComponent, LABELS, LINK, LOCAL_STORAGE_KEY_THEME_MODE, ListDisplayComponent, ListenResizeDirective, LoadAction, LocaleTransformPipe, MACHINE_API_GROUP, METADATA, MUTABLE_BASIC_OPTIONS, MUTABLE_MODULE, MarkedPipe, MaxLengthValidatorDirective, MaxValidatorDirective, MinLengthValidatorDirective, MinValidatorDirective, MinimumFormatPipe, MosaicComponent, MosaicLeftDirective, MosaicRightDirective, MultiSearchActionInputComponent, MultiSearchAdvanced, MultiSearchBasic, MultiSearchComponent, MutableDirective, NAME, NAMESPACE, NOTIFICATION_SERVER_NAME, NOTIFY_DURATION_HEADER, NOTIFY_ON_ERROR_HEADER, NOTIFY_ON_ERROR_HEADERS, NOT_NOTIFY_ON_ERROR_HEADERS, NUMBER_PATTERN, NamespaceBadgeComponent, NotBeValidatorDirective, OAM_GROUP, OnResizeChangeService, OneOfValidatorDirective, OverviewBannerComponent, PACKAGE_RUNTIME_VALUE, PAGE_GUARD_MODULE, PLATFORM_OPS_MODE, PORT_PATTERN, POSITIVE_INT_PATTERN, POSITIVE_NUMBER_PATTERN, PREFIX_LABEL_CLASS, PROJECT, PUBLIC_NAMESPACE, PageGuardComponent, PageGuardContentDirective, PageGuardDescriptionDirective, PageGuardImageDirective, PageGuardOperationDirective, PageStateComponent, ParseJsonTranslatePipe, PasswordInputComponent, PodStatusColorMapper, PodStatusComponent, PodStatusEnum, PodStatusIconMapper, PreventClipboardDirective, PreventDirective, PreventHandler, ProductKey, REASON_MAP, RESOURCE_MAC_TYPES, RESOURCE_REQUIREMENT_KEYS, ReadonlyFieldDirective, Reason, RelativeTimeComponent, RequestPool, ResizeDirective, ResourceLabelComponent, ResourceMultiSelectComponent, ResourceYamlDisplayComponent, SERVICE_PORT_BASE_PROTOCOLS, SERVICE_PORT_PROTOCOLS, SERVICE_SESSION_AFFINITIES, SERVICE_TYPES, SLASH, SPACE, SPEC, STATUS, STRATEGY_JUDGE_MAPPER, STRONG_PASSWORD_SPECIAL_CHARS, ScrollBorderObserverDirective, ScrollToFirstInvalidDirective, ScrollToFirstInvalidMarkerDirective, SearchItemComponent, SearchItemLabelDirective, SearchPanelComponent, SecretType, SelectPrefixLabelDirective, SpanComponent, StatusIconComponent, StopDirective, StringArrayFormTableComponent, StrongPasswordDirective, StrongPasswordTooltipComponent, TEMPLATE_OPTIONS, TIMEZONES, TIME_FORMAT, TOKEN_HELP_DOC_DATA, TRUE, TableCellDefDirective, TableComponent, TableCustomColumnsComponent, TableUtilService, TagsLabelComponent, TaintEffect, TestTagComponent, TextEllipsisComponent, TextTooltipDirective, TextWithUrlComponent, ThemeTransformPipe, TimezoneDisplayPipe, TolerationOperator, TrimDirective, UNDERSCORE, UNITS, UNIT_REG, UPDATE, UPDATED_AT, UPDATED__AT, UpdateDescriptionDialogComponent, UpdateDisplayNameDialogComponent, UpdateKeyValueDialogComponent, UploadFileComponent, UserSecurityPolicyRule, UserState, VOLUME_SNAPSHOT_GROUP, ValidateRowDuplicateService, ValidatorsDirective, VolumeMode, VolumeModes, VolumeTypeEnum, WEEK_DAYS, WILDCARD, WORKSPACE_PARAMS, WorkloadKind, WorkloadStatusColorMapper, WorkloadStatusEnum, WorkloadStatusIconComponent, WorkloadStatusIconMapper, YamlUtilService, ZeroStateComponent, addUnitCoreM, addUnitGi, addUnitMi, appendImageHeader, atobWithFallback, buildImageAddress, buildUrl, checkValueExit, clearWindowsXtermTools, commonOptions, compareMinorVersion, compareVersion, copyValue, createActions, createNestedFormControl, cronValidator, cronValidatorBasic, dataTransfer, dateValueOf, defaultFilter, defaultSorter, emptyObjectRemoveRuleFactory, errorColor, extractListParamsFromRoute, extractPagedListParams, extractWorkspace, extractWorkspaceFromRoute, filterEmptyValue, filterTrees, findPath, firstPath, formatCPU, formatMemory, formatNumber, genControlDepsMap, getAppropriateMemory, getBaseHref, getCpu, getCronWeekDayNumbers, getDisabledState, getDisabledState$, getHelpDocUrl, getHostname, getJobStatus, getK8sResourceAnnotationErrorMapper, getK8sResourceAnnotationErrorMapper$, getK8sResourceLabelErrorMapper, getK8sResourceLabelErrorMapper$, getMemory, getPickerTimeRanges, getPodAggregatedStatus, getPodIPs, getPodStatus, getPrivateIP, getPrivateIPv4, getPrivateIPv6, getRelativePath, getResourceLimitAsyncValidatorFn, getResourceLimitValidatorFn, getResourceValue, getResourceViewModel, getToPath, getValidVersion, getWorkloadStatus, initGreaterValidator, isAbsoluteUrl, isB, isCronFieldCountCorrect, isCronWeekDayCorrect, isCronWeekDaysContinuous, isErrorMessage, isJsonObjectString, isK8sResource, isL, isR, isSelectAll, isT, isValidRID, isValidWorkspace, k8sResourceAnnotationKeyValidator, k8sResourceAnnotationValidator, k8sResourceLabelKeyValidator, k8sResourceLabelValidator, k8sResourceLabelValueValidator, loadEnv, logsActions, logsReadOptions, mapTrees, matchExpressionsToString, matchLabelsToString, maxParallelByHttpVersion, noShowRowError, normalizeParams, numToStr, parseDaemonSetStatus, parseDeploymentStatus, parseImageAddress, parseRID, parseStatefulSetStatus, parseToWorkloadStatus, parseUrlInText, parseValidImageName, parseValueAndUnit, parseVersion, parseWorkspace, prefixFilterRuleFactory, primaryColor, queryListParams, randomPassword, readonlyOptions, reduceTrees, removeDirtyFieldsBeforeUpdate, resourceUnits, rowBackgroundColorFn, safeAssign, scrollIntoView, setNode, setupErrorMapper, shortNum, sortByCreationTimestamp, stringToMatchLabels, stringifyRID, stringifyWorkspace, successColor, tableSort, tableSortAdvance, tagRenderDefault, textWriteOptions, toLowerFirstLetter, toNumber, toPercent, toPx, toUnitGi, toUnitI, toUnitMi, toUnitNum, toUnitNumM, trackByName, trackByUid, transferResource, updateActions, versionRegex, viewActions, warnColor, withLoadState, workspaceToPath, yamlFilterField, yamlReadOptions, yamlWriteOptions };
|
|
14018
|
+
export { ACTION, AIT_API_GROUP, ALL, ALL_VALUE, ANNOTATIONS, API_GATEWAY, ARGOCD_GROUP, ARRAY_FORM_TABLE_MODULE, ARRAY_TABLE_FORM_ERROR_BG, ASSIGN_ALL, ASYNC_DATA_MODULE, AccessMode, AccessModes, AclTableVirtualComponent, AclTableVirtualHeaderDefDirective, AclTableVirtualModule, AclTableVirtualPlaceholderDefDirective, AclTableVirtualRowDefDirective, AlaudaDeployStatus, AlaudaRunningStatus, ArrayFormTableComponent, ArrayFormTableFooterDirective, ArrayFormTableHeaderDirective, ArrayFormTableRowControlDirective, ArrayFormTableRowDirective, ArrayFormTableRowErrorDirective, ArrayFormTableRowSeparatorDirective, ArrayFormTableZeroStateDirective, AsyncDataLoader, AsyncFunctionValidatorDirective, AuiCodeEditorHelperDirective, BASE_TIMEZONE, BaseFormContainer, BaseNestedFormControl, BaseNestedFormControlPure, BaseStringMapFormComponent, Bracket, CHART_PICKER_TIME_RANGES, CLUSTER, COMMON_RESOURCE_DEFINITIONS, CORE_UNITS, CORE_UNIT_REG, CREATE, CREATED_AT, CREATION_TIMESTAMP, CREATOR, CRON_ENABLE_7_FOR_SUNDAY, CRON_FORMAT_ERROR, CRON_MIN_INTERVAL_ERROR, CRYPTO_HEADER_KEY, CRYPTO_KEY, CRYPTO_RANDOM_HEADER_KEY, CRYPTO_TYPE, CUSTOM, CUSTOMIZED, CUSTOM_RANGE, CalcPipe, CardSectionComponent, ClickOutsideDirective, CloudHelmRequestStateEnum, CodeDisplayDialogComponent, CoerceNumberDirective, ConfirmDeleteComponent, ConfirmDeleteContentDirective, ConfirmDeleteLabelDirective, ConfirmDeleteTipDirective, ControlValueTraceDirective, CronHumanReadablePipe, CronWeekDays, CrontabNextPipe, CurrentTimeComponent, DATE_FORMAT, DATE_TIME_FORMAT, DEFAULT_CODE_EDITOR_OPTIONS, DEFAULT_CONTAINER_ANNOTATION, DEFAULT_OPERATOR, DEFAULT_OPTIONS, DEFAULT_REASON, DELIMITER, DESCRIPTION, DISPLAY_NAME, DNS1123SubdomainValidator, DOMAIN_PATTERN, DOMAIN_PATTERN_BASE, DOT, DOWNGRADE_WATCH_ENABLED, DOWNGRADE_WATCH_POLLING, DUPLICATE_ERROR_KEY, DUPLICATION_JUSTIFY_STRATEGY, DataSource, DateRangePickerComponent, DeclareDirective, DefaultStatusColorMapper, DefaultStatusIconMapper, DeleteType, DeletingTagComponent, DisabledContainerComponent, DisabledDirective, DragHandleDirective, DurationPipe, E2eAttributeBindingDirective, EFFECT_DIRECTIVE_MODULE, EMAIL_PATTERN, EMPTY, ERRORS_MAPPER_MODULE, ESCAPE_DEACTIVATE_CHECK, ErrorStateComponent, ErrorsMapperComponent, ErrorsMapperDirective, FALSE, FIELDSET_GROUP_COMPONENTS, FeatureGateDirective, FieldSetColumnComponent, FieldSetColumnGroupComponent, FieldSetGroupComponent, FieldSetItemActionDirective, FieldSetItemComponent, FileResultType, FoldableBlockComponent, FoldableItemInTableComponent, FormItemMarginEffectDirective, FunctionValidatorDirective, GLOBAL_CLUSTER, GenericStatusColor, GenericStatusIcon, GuardStatus, HTTP_ADDRESS_PATTERN, HTTP_DUAL_IP_OR_DOMAIN_PATTERN, HTTP_IP_OR_DOMAIN_PATTERN, HYPHEN, HelmRequestPhaseEnum, HelpDocDirective, HelpDocUrlPipe, HelpDocumentComponent, HelpDocumentService, IMAGE_TAG_PATTERN, INT_PATTERN, INT_ZERO_PATTERN, IPV4_IPV6_ADDRESS_HOSTNAME_PORT_PATTERN, IPV6_ADDRESS_HOSTNAME_PATTERN, IPV6_ADDRESS_HOSTNAME_PORT_PATTERN, IPV6_PATTERN_BASE, IP_ADDRESS_HOSTNAME_PATTERN, IP_ADDRESS_HOSTNAME_PATTERN_EXTEND, IP_ADDRESS_HOSTNAME_PORT_PATTERN, IP_ADDRESS_PATTERN, IP_ADDRESS_PORT_PATTERN, IP_ADDRESS_SUBNET_PATTERN, IP_PATTERN, IP_PATTERN_BASE, IP_V4_OR_V6_PATTERN, IP_V6_ADDRESS_PATTERN, IP_V6_PATTERN, InterceptDeactivateDirective, InterceptDeactivateGuard, InterceptDeactivateService, JobStatusColorMapper, JobStatusEnum, JobStatusIconMapper, K8SResourceList, K8SResourceListFooterComponent, K8SResourcePagedList, K8S_APP_API_GROUP, K8S_CORE_API_GROUP, K8S_RESOURCE_LABEL_KEY_NAME_PATTERN, K8S_RESOURCE_LABEL_KEY_PREFIX_PATTERN, K8S_RESOURCE_LABEL_VALUE_PATTERN, K8S_RESOURCE_LIST_MODULE, K8S_RESOURCE_NAME_START_WITH_CHARS_ONLY, K8S_RESOURCE_TRANSLATE_KEY, K8sListFooterLoadingErrorDirective, K8sListFooterNoDataDirective, K8sResourceAction, K8sResourceMarkComponent, K8sResourceTranslateKeyPipe, K8sSharedUtilService, K8sYamlDisplayDialogComponent, KNOWN_COLUMNS, KeyValueFormTableComponent, KeyValueTableComponent, KubernetesSchemaService, LABELS, LINK, LOCAL_STORAGE_KEY_THEME_MODE, ListDisplayComponent, ListenResizeDirective, LoadAction, LocaleTransformPipe, MACHINE_API_GROUP, METADATA, MUTABLE_BASIC_OPTIONS, MUTABLE_MODULE, MarkedPipe, MaxLengthValidatorDirective, MaxValidatorDirective, MinLengthValidatorDirective, MinValidatorDirective, MinimumFormatPipe, MosaicComponent, MosaicLeftDirective, MosaicRightDirective, MultiSearchActionInputComponent, MultiSearchAdvanced, MultiSearchBasic, MultiSearchComponent, MutableDirective, NAME, NAMESPACE, NOTIFICATION_SERVER_NAME, NOTIFY_DURATION_HEADER, NOTIFY_ON_ERROR_HEADER, NOTIFY_ON_ERROR_HEADERS, NOT_NOTIFY_ON_ERROR_HEADERS, NUMBER_PATTERN, NamespaceBadgeComponent, NotBeValidatorDirective, OAM_GROUP, OnResizeChangeService, OneOfValidatorDirective, OverviewBannerComponent, PACKAGE_RUNTIME_VALUE, PAGE_GUARD_MODULE, PLATFORM_OPS_MODE, PORT_PATTERN, POSITIVE_INT_PATTERN, POSITIVE_NUMBER_PATTERN, PREFIX_LABEL_CLASS, PROJECT, PUBLIC_NAMESPACE, PageGuardComponent, PageGuardContentDirective, PageGuardDescriptionDirective, PageGuardImageDirective, PageGuardOperationDirective, PageStateComponent, ParseJsonTranslatePipe, PasswordInputComponent, PluginClusterSelectorComponent, PodStatusColorMapper, PodStatusComponent, PodStatusEnum, PodStatusIconMapper, PreventClipboardDirective, PreventDirective, PreventHandler, ProductKey, REASON_MAP, RESOURCE_MAC_TYPES, RESOURCE_REQUIREMENT_KEYS, ReadonlyFieldDirective, Reason, RelativeTimeComponent, RequestPool, ResizeDirective, ResourceLabelComponent, ResourceMultiSelectComponent, ResourceYamlDisplayComponent, ResourceYamlEditorComponent, SERVICE_PORT_BASE_PROTOCOLS, SERVICE_PORT_PROTOCOLS, SERVICE_SESSION_AFFINITIES, SERVICE_TYPES, SLASH, SPACE, SPEC, STATUS, STRATEGY_JUDGE_MAPPER, STRONG_PASSWORD_SPECIAL_CHARS, ScrollBorderObserverDirective, ScrollToFirstInvalidDirective, ScrollToFirstInvalidMarkerDirective, SearchItemComponent, SearchItemLabelDirective, SearchPanelComponent, SecretType, SelectPrefixLabelDirective, SpanComponent, StatusIconComponent, StopDirective, StringArrayFormTableComponent, StrongPasswordDirective, StrongPasswordTooltipComponent, TEMPLATE_OPTIONS, TIMEZONES, TIME_FORMAT, TOKEN_HELP_DOC_DATA, TRUE, TableCellDefDirective, TableComponent, TableCustomColumnsComponent, TableHeaderCellDefDirective, TableUtilService, TagsLabelComponent, TaintEffect, TerminatingTagComponent, TestTagComponent, TextEllipsisComponent, TextTooltipDirective, TextWithUrlComponent, ThemeTransformPipe, TimezoneDisplayPipe, TolerationOperator, TrimDirective, UNDERSCORE, UNITS, UNIT_REG, UPDATE, UPDATED_AT, UPDATED__AT, UpdateDescriptionDialogComponent, UpdateDisplayNameDialogComponent, UpdateKeyValueDialogComponent, UploadFileComponent, UserSecurityPolicyRule, UserState, VOLUME_SNAPSHOT_GROUP, ValidateRowDuplicateService, ValidatorsDirective, VolumeMode, VolumeModes, VolumeTypeEnum, WEEK_DAYS, WILDCARD, WORKSPACE_PARAMS, WorkloadKind, WorkloadStatusColorMapper, WorkloadStatusEnum, WorkloadStatusIconComponent, WorkloadStatusIconMapper, YamlUtilService, ZeroStateComponent, addUnitCoreM, addUnitGi, addUnitMi, appendImageHeader, atobWithFallback, buildImageAddress, buildUrl, checkValueExit, clearWindowsXtermTools, commonOptions, compareMinorVersion, compareVersion, copyValue, createActions, createNestedFormControl, cronValidator, cronValidatorBasic, dataTransfer, dateValueOf, defaultFilter, defaultSorter, emptyObjectRemoveRuleFactory, errorColor, extractListParamsFromRoute, extractPagedListParams, extractWorkspace, extractWorkspaceFromRoute, filterEmptyValue, filterTrees, findPath, firstPath, formatCPU, formatMemory, formatNumber, genControlDepsMap, getAppropriateMemory, getBaseHref, getCpu, getCronWeekDayNumbers, getDisabledState, getDisabledState$, getHelpDocUrl, getHostname, getJobStatus, getK8sResourceAnnotationErrorMapper, getK8sResourceAnnotationErrorMapper$, getK8sResourceLabelErrorMapper, getK8sResourceLabelErrorMapper$, getMemory, getPickerTimeRanges, getPodAggregatedStatus, getPodIPs, getPodStatus, getPrivateIP, getPrivateIPv4, getPrivateIPv6, getRelativePath, getResourceLimitAsyncValidatorFn, getResourceLimitValidatorFn, getResourceValue, getResourceViewModel, getToPath, getValidVersion, getWorkloadStatus, initGreaterValidator, isAbsoluteUrl, isB, isCronFieldCountCorrect, isCronWeekDayCorrect, isCronWeekDaysContinuous, isErrorMessage, isJsonObjectString, isK8sResource, isL, isR, isSelectAll, isT, isValidRID, isValidWorkspace, k8sResourceAnnotationKeyValidator, k8sResourceAnnotationValidator, k8sResourceLabelKeyValidator, k8sResourceLabelValidator, k8sResourceLabelValueValidator, loadEnv, logsActions, logsReadOptions, mapTrees, matchExpressionsToString, matchLabelsToString, maxParallelByHttpVersion, noShowRowError, normalizeParams, numToStr, parseDaemonSetStatus, parseDeploymentStatus, parseImageAddress, parseRID, parseStatefulSetStatus, parseToWorkloadStatus, parseUrlInText, parseValidImageName, parseValueAndUnit, parseVersion, parseWorkspace, prefixFilterRuleFactory, primaryColor, queryListParams, randomPassword, readonlyOptions, reduceTrees, removeDirtyFieldsBeforeUpdate, resourceUnits, rowBackgroundColorFn, safeAssign, scrollIntoView, setNode, setupErrorMapper, shortNum, sortByCreationTimestamp, stringToMatchLabels, stringifyRID, stringifyWorkspace, successColor, tableSort, tableSortAdvance, tagRenderDefault, textWriteOptions, toLowerFirstLetter, toNumber, toPercent, toPx, toUnitGi, toUnitI, toUnitMi, toUnitNum, toUnitNumM, trackByName, trackByUid, transferResource, updateActions, versionRegex, viewActions, warnColor, withLoadState, workspaceToPath, yamlFilterField, yamlReadMinimapOptions, yamlReadOptions, yamlWriteMinimapOptions, yamlWriteOptions };
|
|
12663
14019
|
//# sourceMappingURL=alauda-fe-dynamic-plugin-shared.mjs.map
|