|
1 | 1 | <div data-ignore-for-autoscroll="true" class="max-w-3xl w-full mx-auto">
|
2 | 2 | <div class="relative px-2 md:px-1">
|
3 |
| - <fieldset |
4 |
| - class="relative bg-white flex flex-col gap-2 px-4 py-2 border border-gray-300 rounded-2xl shadow shadow-slate-200 |
5 |
| - dark:bg-neutral-900 dark:border-neutral-700" |
6 |
| - > |
7 |
| - <div class="flex items-center flex-grow gap-x-2"> |
8 |
| - <button class="p-1 rounded-lg hover:bg-black/5 dark:hover:bg-white/10" |
9 |
| - [matTooltip]="'Copilot.NewChat' | translate: {Default: 'New chat'}" |
10 |
| - [cdkMenuTriggerFor]="menu" |
11 |
| - > |
12 |
| - <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 24 24" class="icon-xl-heavy"> |
13 |
| - <path d="M15.673 3.913a3.121 3.121 0 1 1 4.414 4.414l-5.937 5.937a5 5 0 0 1-2.828 1.415l-2.18.31a1 1 0 0 1-1.132-1.13l.311-2.18A5 5 0 0 1 9.736 9.85zm3 1.414a1.12 1.12 0 0 0-1.586 0l-5.937 5.937a3 3 0 0 0-.849 1.697l-.123.86.86-.122a3 3 0 0 0 1.698-.849l5.937-5.937a1.12 1.12 0 0 0 0-1.586M11 4A1 1 0 0 1 10 5c-.998 0-1.702.008-2.253.06-.54.052-.862.141-1.109.267a3 3 0 0 0-1.311 1.311c-.134.263-.226.611-.276 1.216C5.001 8.471 5 9.264 5 10.4v3.2c0 1.137 0 1.929.051 2.546.05.605.142.953.276 1.216a3 3 0 0 0 1.311 1.311c.263.134.611.226 1.216.276.617.05 1.41.051 2.546.051h3.2c1.137 0 1.929 0 2.546-.051.605-.05.953-.142 1.216-.276a3 3 0 0 0 1.311-1.311c.126-.247.215-.569.266-1.108.053-.552.06-1.256.06-2.255a1 1 0 1 1 2 .002c0 .978-.006 1.78-.069 2.442-.064.673-.192 1.27-.475 1.827a5 5 0 0 1-2.185 2.185c-.592.302-1.232.428-1.961.487C15.6 21 14.727 21 13.643 21h-3.286c-1.084 0-1.958 0-2.666-.058-.728-.06-1.369-.185-1.96-.487a5 5 0 0 1-2.186-2.185c-.302-.592-.428-1.233-.487-1.961C3 15.6 3 14.727 3 13.643v-3.286c0-1.084 0-1.958.058-2.666.06-.729.185-1.369.487-1.961A5 5 0 0 1 5.73 3.545c.556-.284 1.154-.411 1.827-.475C8.22 3.007 9.021 3 10 3A1 1 0 0 1 11 4"></path> |
14 |
| - </svg> |
15 |
| - </button> |
16 |
| - <div class="flex items-center flex-grow overflow-x-hidden"> |
| 3 | + <fieldset |
| 4 | + [matTooltip]="!modelId() ? ('PAC.ChatBI.SelectSemanticModel' | translate: {Default: 'Select Semantic Model'}) : |
| 5 | + !cube() ? ('PAC.ChatBI.SelectCube' | translate: {Default: 'Select a cube firstly!'}) : null" |
| 6 | + matTooltipPosition="above" |
| 7 | + class="relative bg-white flex flex-col gap-2 px-4 py-2 border border-gray-300 rounded-2xl shadow shadow-slate-200 |
| 8 | + dark:bg-neutral-900 dark:border-neutral-700" |
| 9 | + > |
| 10 | + <div class="flex items-center flex-grow gap-x-2"> |
| 11 | + <button class="p-1 rounded-lg hover:bg-black/5 dark:hover:bg-white/10" |
| 12 | + [matTooltip]="'Copilot.NewChat' | translate: {Default: 'New chat'}" |
| 13 | + [cdkMenuTriggerFor]="menu" |
| 14 | + > |
| 15 | + <svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" fill="currentColor" viewBox="0 0 24 24" class="icon-xl-heavy"> |
| 16 | + <path d="M15.673 3.913a3.121 3.121 0 1 1 4.414 4.414l-5.937 5.937a5 5 0 0 1-2.828 1.415l-2.18.31a1 1 0 0 1-1.132-1.13l.311-2.18A5 5 0 0 1 9.736 9.85zm3 1.414a1.12 1.12 0 0 0-1.586 0l-5.937 5.937a3 3 0 0 0-.849 1.697l-.123.86.86-.122a3 3 0 0 0 1.698-.849l5.937-5.937a1.12 1.12 0 0 0 0-1.586M11 4A1 1 0 0 1 10 5c-.998 0-1.702.008-2.253.06-.54.052-.862.141-1.109.267a3 3 0 0 0-1.311 1.311c-.134.263-.226.611-.276 1.216C5.001 8.471 5 9.264 5 10.4v3.2c0 1.137 0 1.929.051 2.546.05.605.142.953.276 1.216a3 3 0 0 0 1.311 1.311c.263.134.611.226 1.216.276.617.05 1.41.051 2.546.051h3.2c1.137 0 1.929 0 2.546-.051.605-.05.953-.142 1.216-.276a3 3 0 0 0 1.311-1.311c.126-.247.215-.569.266-1.108.053-.552.06-1.256.06-2.255a1 1 0 1 1 2 .002c0 .978-.006 1.78-.069 2.442-.064.673-.192 1.27-.475 1.827a5 5 0 0 1-2.185 2.185c-.592.302-1.232.428-1.961.487C15.6 21 14.727 21 13.643 21h-3.286c-1.084 0-1.958 0-2.666-.058-.728-.06-1.369-.185-1.96-.487a5 5 0 0 1-2.186-2.185c-.302-.592-.428-1.233-.487-1.961C3 15.6 3 14.727 3 13.643v-3.286c0-1.084 0-1.958.058-2.666.06-.729.185-1.369.487-1.961A5 5 0 0 1 5.73 3.545c.556-.284 1.154-.411 1.827-.475C8.22 3.007 9.021 3 10 3A1 1 0 0 1 11 4"></path> |
| 17 | + </svg> |
| 18 | + </button> |
| 19 | + <div class="flex items-center flex-grow overflow-x-hidden"> |
17 | 20 |
|
18 |
| - <input #userInput matInput class="ngm-colpilot__input w-full px-1.5 z-10 resize-none overflow-visible outline-none" |
19 |
| - [ngClass]="{disabled: answering() ||!cube()}" |
20 |
| - id="userInput" onInput="this.parentNode.dataset.replicatedValue = this.value" |
21 |
| - [placeholder]="'PAC.ChatBI.InputPlaceholder' | translate: {Default: 'Ask a question about the dataset, press Enter to send'} " |
22 |
| - [(ngModel)]="prompt" |
23 |
| - [disabled]="answering() || !cube()" |
24 |
| - (keydown)="triggerFun($event, autoPrompts)" |
| 21 | + <input #userInput matInput class="ngm-colpilot__input w-full px-1.5 z-10 resize-none overflow-visible outline-none" |
| 22 | + [ngClass]="{disabled: answering() ||!cube()}" |
| 23 | + id="userInput" onInput="this.parentNode.dataset.replicatedValue = this.value" |
| 24 | + [placeholder]="'PAC.ChatBI.InputPlaceholder' | translate: {Default: 'Ask a question about the dataset, press Enter to send'} " |
| 25 | + [(ngModel)]="prompt" |
| 26 | + [disabled]="answering() || !cube()" |
| 27 | + (keydown)="triggerFun($event, autoPrompts)" |
25 | 28 |
|
26 |
| - [matAutocomplete]="autoPrompts" |
27 |
| - matAutocompletePosition="above" |
28 |
| - > |
| 29 | + [matAutocomplete]="autoPrompts" |
| 30 | + matAutocompletePosition="above" |
| 31 | + > |
29 | 32 |
|
30 |
| - <mat-autocomplete #autoPrompts="matAutocomplete" class="ngm-copilot-chat__autocomplete-panel ngm-autocomplete-panel ngm-density__cosy" |
31 |
| - autoActiveFirstOption |
32 |
| - hideSingleSelectionIndicator |
33 |
| - (opened)="suggestionsOpened$.next(true)" |
34 |
| - (closed)="suggestionsOpened$.next(false)" |
35 |
| - > |
36 |
| - @for (command of prompts(); track command.prompt) { |
37 |
| - <mat-option [value]="'/'+command.name+' '+(command.example || '')" [title]="command.description"> |
38 |
| - <span class="ngm-copilot-chat__command-tag text-xs font-medium me-2 px-1 mr-1 rounded" |
39 |
| - >/{{command.name}}</span> |
40 |
| - @if (command.alias) { |
41 |
| - <span class="ngm-copilot-chat__command-tag text-xs font-medium me-2 px-1 mr-1 rounded" |
42 |
| - >/{{command.alias}}</span> |
43 |
| - } |
44 |
| - <span class="ml-auto opacity-50">{{command.description}}</span> |
45 |
| - </mat-option> |
| 33 | + <mat-autocomplete #autoPrompts="matAutocomplete" class="ngm-copilot-chat__autocomplete-panel ngm-autocomplete-panel ngm-density__cosy" |
| 34 | + autoActiveFirstOption |
| 35 | + hideSingleSelectionIndicator |
| 36 | + (opened)="suggestionsOpened$.next(true)" |
| 37 | + (closed)="suggestionsOpened$.next(false)" |
| 38 | + > |
| 39 | + @for (command of prompts(); track command.prompt) { |
| 40 | + <mat-option [value]="'/'+command.name+' '+(command.example || '')" [title]="command.description"> |
| 41 | + <span class="ngm-copilot-chat__command-tag text-xs font-medium me-2 px-1 mr-1 rounded" |
| 42 | + >/{{command.name}}</span> |
| 43 | + @if (command.alias) { |
| 44 | + <span class="ngm-copilot-chat__command-tag text-xs font-medium me-2 px-1 mr-1 rounded" |
| 45 | + >/{{command.alias}}</span> |
46 | 46 | }
|
47 |
| - </mat-autocomplete> |
48 |
| - |
49 |
| - <div class="grid grid-flow-col items-center"> |
50 |
| - @if (answering()) { |
51 |
| - <button type="button" class="rounded-full md:bottom-3 md:right-3 right-2 border-solid p-1 hover:opacity-60 text-white bg-black dark:bg-white dark:text-black" aria-label="停止生成" |
52 |
| - (click)="stopGenerating()"> |
53 |
| - <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24" class="icon-lg"><rect width="10" height="10" x="7" y="7" fill="currentColor" rx="1.25"></rect></svg> |
54 |
| - </button> |
55 |
| - } @else { |
56 |
| - <button type="button" class="rounded-full md:bottom-3 md:right-3 right-2 border-solid p-1 bg-black disabled:opacity-10 disabled:text-gray-400 enabled:bg-black text-white dark:border-white dark:bg-white bottom-1.5 transition-colors |
57 |
| - hover:opacity-60" data-testid="send-button" |
58 |
| - [disabled]="!prompt() || answering() || !cube()" |
59 |
| - (click)="ask()" |
60 |
| - > |
61 |
| - <span class="" data-state="closed"> |
62 |
| - <svg width="24" height="24" viewBox="0 0 24 24" fill="none" class="text-white dark:text-black"> |
63 |
| - <path d="M7 11L12 6L17 11M12 18V7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> |
64 |
| - </svg> |
65 |
| - </span> |
66 |
| - </button> |
67 |
| - } |
68 |
| - </div> |
| 47 | + <span class="ml-auto opacity-50">{{command.description}}</span> |
| 48 | + </mat-option> |
| 49 | + } |
| 50 | + </mat-autocomplete> |
| 51 | + |
| 52 | + <div class="grid grid-flow-col items-center"> |
| 53 | + @if (answering()) { |
| 54 | + <button type="button" class="rounded-full md:bottom-3 md:right-3 right-2 border-solid p-1 hover:opacity-60 text-white bg-black dark:bg-white dark:text-black" aria-label="停止生成" |
| 55 | + (click)="stopGenerating()"> |
| 56 | + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="none" viewBox="0 0 24 24" class="icon-lg"><rect width="10" height="10" x="7" y="7" fill="currentColor" rx="1.25"></rect></svg> |
| 57 | + </button> |
| 58 | + } @else { |
| 59 | + <button type="button" class="rounded-full md:bottom-3 md:right-3 right-2 border-solid p-1 bg-black disabled:opacity-10 disabled:text-gray-400 enabled:bg-black text-white dark:border-white dark:bg-white bottom-1.5 transition-colors |
| 60 | + hover:opacity-60" data-testid="send-button" |
| 61 | + [disabled]="!prompt() || answering() || !cube()" |
| 62 | + (click)="ask()" |
| 63 | + > |
| 64 | + <span class="" data-state="closed"> |
| 65 | + <svg width="24" height="24" viewBox="0 0 24 24" fill="none" class="text-white dark:text-black"> |
| 66 | + <path d="M7 11L12 6L17 11M12 18V7" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"></path> |
| 67 | + </svg> |
| 68 | + </span> |
| 69 | + </button> |
| 70 | + } |
69 | 71 | </div>
|
70 | 72 | </div>
|
71 |
| - </fieldset> |
| 73 | + </div> |
| 74 | + </fieldset> |
72 | 75 |
|
73 | 76 | @if (!copilotEnabled()) {
|
74 | 77 | <div class="absolute top-0 left-0 w-full h-full z-10 flex justify-center items-center rounded-2xl shadow
|
|
0 commit comments