UI: Minor improvement for ai models

This commit is contained in:
Vladyslav_Prykhodko 2025-07-15 12:33:10 +03:00
parent f3071fcfbc
commit 28ce6ca8c8
5 changed files with 67 additions and 62 deletions

View File

@ -94,7 +94,7 @@
toolbarSuffixButton toolbarSuffixButton
matTooltip="{{ 'rule-node-config.ai.response-json-schema-hint' | translate }}" matTooltip="{{ 'rule-node-config.ai.response-json-schema-hint' | translate }}"
matTooltipPosition="above"> matTooltipPosition="above">
<mat-icon style="color: #7b7b7b">info</mat-icon> <mat-icon class="material-icons">info_outline</mat-icon>
</button> </button>
</tb-json-object-edit> </tb-json-object-edit>
} }
@ -105,6 +105,7 @@
<mat-expansion-panel-header style="padding: 16px"> <mat-expansion-panel-header style="padding: 16px">
<mat-panel-title translate>rule-node-config.ai.advanced-settings</mat-panel-title> <mat-panel-title translate>rule-node-config.ai.advanced-settings</mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<ng-template matExpansionPanelContent>
<div class="tb-form-panel no-border no-padding-top" style="margin-top: 0"> <div class="tb-form-panel no-border no-padding-top" style="margin-top: 0">
<div class="tb-form-row space-between flex-1 columns-xs"> <div class="tb-form-row space-between flex-1 columns-xs">
<div tb-hint-tooltip-icon="{{'rule-node-config.ai.timeout-hint' | translate}}">{{ 'rule-node-config.ai.timeout' | translate }}</div> <div tb-hint-tooltip-icon="{{'rule-node-config.ai.timeout-hint' | translate}}">{{ 'rule-node-config.ai.timeout' | translate }}</div>
@ -128,6 +129,7 @@
</mat-slide-toggle> </mat-slide-toggle>
</div> </div>
</div> </div>
</ng-template>
</mat-expansion-panel> </mat-expansion-panel>
</div> </div>
</section> </section>

View File

@ -65,9 +65,7 @@ export class AiModelsTableConfigResolver {
new EntityTableColumn<AiModel>('provider', 'ai-models.provider', '33%', new EntityTableColumn<AiModel>('provider', 'ai-models.provider', '33%',
entity => this.translate.instant(AiProviderTranslations.get(entity.configuration.provider)) entity => this.translate.instant(AiProviderTranslations.get(entity.configuration.provider))
), ),
new EntityTableColumn<AiModel>('aiModel', 'ai-models.model', '33%', new EntityTableColumn<AiModel>('modelId', 'ai-models.model', '33%', entity => entity.configuration.modelId)
entity => entity.configuration.modelId, () => ({}), false
)
) )
this.config.deleteEntityTitle = model => this.translate.instant('ai-models.delete-model-title', {modelName: model.name}); this.config.deleteEntityTitle = model => this.translate.instant('ai-models.delete-model-title', {modelName: model.name});

View File

@ -15,7 +15,7 @@
limitations under the License. limitations under the License.
--> -->
<div class="flex flex-col" style="background: #fff;" [class.fill-height]="fillHeight" <div class="tb-json-object flex flex-col" style="background: #fff;" [class.fill-height]="fillHeight"
tb-fullscreen tb-fullscreen
[fullscreen]="fullscreen" (fullscreenChanged)="onFullscreen()"> [fullscreen]="fullscreen" (fullscreenChanged)="onFullscreen()">
<div class="tb-json-object-toolbar flex flex-row items-center justify-start"> <div class="tb-json-object-toolbar flex flex-row items-center justify-start">

View File

@ -13,15 +13,14 @@
* See the License for the specific language governing permissions and * See the License for the specific language governing permissions and
* limitations under the License. * limitations under the License.
*/ */
:host { .tb-json-object {
position: relative; position: relative;
.fill-height { .fill-height {
height: 100%; height: 100%;
} }
}
.tb-json-object-toolbar { .tb-json-object-toolbar {
button.mat-mdc-button-base, button.mat-mdc-button-base.tb-mat-32 { button.mat-mdc-button-base, button.mat-mdc-button-base.tb-mat-32 {
align-items: center; align-items: center;
vertical-align: middle; vertical-align: middle;
@ -41,9 +40,9 @@
button.mat-mdc-button-base:not(.mat-mdc-icon-button) { button.mat-mdc-button-base:not(.mat-mdc-icon-button) {
height: 23px; height: 23px;
} }
} }
.tb-json-object-panel { .tb-json-object-panel {
height: 100%; height: 100%;
margin-left: 15px; margin-left: 15px;
border: 1px solid #c0c0c0; border: 1px solid #c0c0c0;
@ -58,4 +57,5 @@
min-height: 200px; min-height: 200px;
} }
} }
}
} }

View File

@ -19,21 +19,23 @@ import {
Component, Component,
ElementRef, ElementRef,
forwardRef, forwardRef,
HostBinding,
Input, Input,
OnDestroy, OnDestroy,
OnInit, OnInit,
ViewChild ViewChild,
ViewEncapsulation
} from '@angular/core'; } from '@angular/core';
import { import {
AbstractControl,
ControlValueAccessor, ControlValueAccessor,
UntypedFormControl,
NG_VALIDATORS, NG_VALIDATORS,
NG_VALUE_ACCESSOR, NG_VALUE_ACCESSOR,
Validator, UntypedFormControl,
AbstractControl, ValidationErrors ValidationErrors,
Validator
} from '@angular/forms'; } from '@angular/forms';
import { Ace } from 'ace-builds'; import { Ace } from 'ace-builds';
import { coerceBooleanProperty } from '@angular/cdk/coercion';
import { ActionNotificationHide, ActionNotificationShow } from '@core/notification/notification.actions'; import { ActionNotificationHide, ActionNotificationShow } from '@core/notification/notification.actions';
import { Store } from '@ngrx/store'; import { Store } from '@ngrx/store';
import { AppState } from '@core/core.state'; import { AppState } from '@core/core.state';
@ -48,6 +50,7 @@ export const jsonRequired = (control: AbstractControl): ValidationErrors | null
selector: 'tb-json-object-edit', selector: 'tb-json-object-edit',
templateUrl: './json-object-edit.component.html', templateUrl: './json-object-edit.component.html',
styleUrls: ['./json-object-edit.component.scss'], styleUrls: ['./json-object-edit.component.scss'],
encapsulation: ViewEncapsulation.None,
providers: [ providers: [
{ {
provide: NG_VALUE_ACCESSOR, provide: NG_VALUE_ACCESSOR,
@ -63,6 +66,8 @@ export const jsonRequired = (control: AbstractControl): ValidationErrors | null
}) })
export class JsonObjectEditComponent implements OnInit, ControlValueAccessor, Validator, OnDestroy { export class JsonObjectEditComponent implements OnInit, ControlValueAccessor, Validator, OnDestroy {
@HostBinding('style.position') position = 'relative';
@ViewChild('jsonEditor', {static: true}) @ViewChild('jsonEditor', {static: true})
jsonEditorElmRef: ElementRef; jsonEditorElmRef: ElementRef;