@memberjunction/ng-dashboards 2.42.0 → 2.42.1
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.
- package/dist/AI/components/prompts/model-prompt-priority-matrix.component.d.ts +92 -0
- package/dist/AI/components/prompts/model-prompt-priority-matrix.component.d.ts.map +1 -0
- package/dist/AI/components/prompts/model-prompt-priority-matrix.component.js +954 -0
- package/dist/AI/components/prompts/model-prompt-priority-matrix.component.js.map +1 -0
- package/dist/AI/components/prompts/prompt-management.component.d.ts +5 -0
- package/dist/AI/components/prompts/prompt-management.component.d.ts.map +1 -1
- package/dist/AI/components/prompts/prompt-management.component.js +278 -200
- package/dist/AI/components/prompts/prompt-management.component.js.map +1 -1
- package/dist/AI/components/prompts/prompt-version-control.component.d.ts +108 -0
- package/dist/AI/components/prompts/prompt-version-control.component.d.ts.map +1 -0
- package/dist/AI/components/prompts/prompt-version-control.component.js +1205 -0
- package/dist/AI/components/prompts/prompt-version-control.component.js.map +1 -0
- package/dist/module.d.ts +14 -12
- package/dist/module.d.ts.map +1 -1
- package/dist/module.js +8 -2
- package/dist/module.js.map +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,954 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Component, Input, Output, EventEmitter } from '@angular/core';
|
|
11
|
+
import { RunView, Metadata, LogError, LogStatus } from '@memberjunction/core';
|
|
12
|
+
import { Subject, BehaviorSubject } from 'rxjs';
|
|
13
|
+
import * as i0 from "@angular/core";
|
|
14
|
+
import * as i1 from "@memberjunction/ng-notifications";
|
|
15
|
+
import * as i2 from "@angular/forms";
|
|
16
|
+
const _forTrack0 = ($index, $item) => $item.ID;
|
|
17
|
+
const _forTrack1 = ($index, $item) => $item.promptId + "_" + $item.modelId;
|
|
18
|
+
function ModelPromptPriorityMatrixComponent_Conditional_24_Template(rf, ctx) { if (rf & 1) {
|
|
19
|
+
i0.ɵɵelementStart(0, "span", 16);
|
|
20
|
+
i0.ɵɵelement(1, "i", 24);
|
|
21
|
+
i0.ɵɵtext(2, " Unsaved changes ");
|
|
22
|
+
i0.ɵɵelementEnd();
|
|
23
|
+
} }
|
|
24
|
+
function ModelPromptPriorityMatrixComponent_Conditional_26_Template(rf, ctx) { if (rf & 1) {
|
|
25
|
+
const _r1 = i0.ɵɵgetCurrentView();
|
|
26
|
+
i0.ɵɵelementStart(0, "div", 17)(1, "button", 25);
|
|
27
|
+
i0.ɵɵlistener("click", function ModelPromptPriorityMatrixComponent_Conditional_26_Template_button_click_1_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.bulkEditMode = !ctx_r1.bulkEditMode); });
|
|
28
|
+
i0.ɵɵelement(2, "i", 26);
|
|
29
|
+
i0.ɵɵtext(3);
|
|
30
|
+
i0.ɵɵelementEnd();
|
|
31
|
+
i0.ɵɵelementStart(4, "button", 27);
|
|
32
|
+
i0.ɵɵlistener("click", function ModelPromptPriorityMatrixComponent_Conditional_26_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.bulkRemoveSelectedCells()); });
|
|
33
|
+
i0.ɵɵelement(5, "i", 28);
|
|
34
|
+
i0.ɵɵtext(6, " Remove ");
|
|
35
|
+
i0.ɵɵelementEnd()();
|
|
36
|
+
} if (rf & 2) {
|
|
37
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
38
|
+
i0.ɵɵadvance();
|
|
39
|
+
i0.ɵɵclassProp("active", ctx_r1.bulkEditMode);
|
|
40
|
+
i0.ɵɵadvance(2);
|
|
41
|
+
i0.ɵɵtextInterpolate1(" Edit (", ctx_r1.selectedCells.size, ") ");
|
|
42
|
+
} }
|
|
43
|
+
function ModelPromptPriorityMatrixComponent_Conditional_28_Template(rf, ctx) { if (rf & 1) {
|
|
44
|
+
const _r3 = i0.ɵɵgetCurrentView();
|
|
45
|
+
i0.ɵɵelementStart(0, "button", 29);
|
|
46
|
+
i0.ɵɵlistener("click", function ModelPromptPriorityMatrixComponent_Conditional_28_Template_button_click_0_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.discardChanges()); });
|
|
47
|
+
i0.ɵɵelement(1, "i", 30);
|
|
48
|
+
i0.ɵɵtext(2, " Discard ");
|
|
49
|
+
i0.ɵɵelementEnd();
|
|
50
|
+
i0.ɵɵelementStart(3, "button", 31);
|
|
51
|
+
i0.ɵɵlistener("click", function ModelPromptPriorityMatrixComponent_Conditional_28_Template_button_click_3_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.saveChanges()); });
|
|
52
|
+
i0.ɵɵelement(4, "i", 32);
|
|
53
|
+
i0.ɵɵtext(5, " Save ");
|
|
54
|
+
i0.ɵɵelementEnd();
|
|
55
|
+
} if (rf & 2) {
|
|
56
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
57
|
+
i0.ɵɵadvance(3);
|
|
58
|
+
i0.ɵɵproperty("disabled", ctx_r1.isLoading);
|
|
59
|
+
} }
|
|
60
|
+
function ModelPromptPriorityMatrixComponent_Conditional_32_Template(rf, ctx) { if (rf & 1) {
|
|
61
|
+
const _r4 = i0.ɵɵgetCurrentView();
|
|
62
|
+
i0.ɵɵelementStart(0, "div", 21)(1, "div", 33)(2, "div", 34)(3, "label", 35);
|
|
63
|
+
i0.ɵɵtext(4, "Priority:");
|
|
64
|
+
i0.ɵɵelementEnd();
|
|
65
|
+
i0.ɵɵelementStart(5, "input", 36);
|
|
66
|
+
i0.ɵɵtwoWayListener("ngModelChange", function ModelPromptPriorityMatrixComponent_Conditional_32_Template_input_ngModelChange_5_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.bulkEditPriority, $event) || (ctx_r1.bulkEditPriority = $event); return i0.ɵɵresetView($event); });
|
|
67
|
+
i0.ɵɵelementEnd()();
|
|
68
|
+
i0.ɵɵelementStart(6, "div", 34)(7, "label", 37);
|
|
69
|
+
i0.ɵɵtext(8, "Status:");
|
|
70
|
+
i0.ɵɵelementEnd();
|
|
71
|
+
i0.ɵɵelementStart(9, "select", 38);
|
|
72
|
+
i0.ɵɵtwoWayListener("ngModelChange", function ModelPromptPriorityMatrixComponent_Conditional_32_Template_select_ngModelChange_9_listener($event) { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(); i0.ɵɵtwoWayBindingSet(ctx_r1.bulkEditStatus, $event) || (ctx_r1.bulkEditStatus = $event); return i0.ɵɵresetView($event); });
|
|
73
|
+
i0.ɵɵelementStart(10, "option", 39);
|
|
74
|
+
i0.ɵɵtext(11, "Active");
|
|
75
|
+
i0.ɵɵelementEnd();
|
|
76
|
+
i0.ɵɵelementStart(12, "option", 40);
|
|
77
|
+
i0.ɵɵtext(13, "Inactive");
|
|
78
|
+
i0.ɵɵelementEnd()()();
|
|
79
|
+
i0.ɵɵelementStart(14, "div", 34)(15, "button", 41);
|
|
80
|
+
i0.ɵɵlistener("click", function ModelPromptPriorityMatrixComponent_Conditional_32_Template_button_click_15_listener() { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.bulkUpdateSelectedCells()); });
|
|
81
|
+
i0.ɵɵelement(16, "i", 42);
|
|
82
|
+
i0.ɵɵtext(17, " Apply ");
|
|
83
|
+
i0.ɵɵelementEnd();
|
|
84
|
+
i0.ɵɵelementStart(18, "button", 43);
|
|
85
|
+
i0.ɵɵlistener("click", function ModelPromptPriorityMatrixComponent_Conditional_32_Template_button_click_18_listener() { i0.ɵɵrestoreView(_r4); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.bulkEditMode = false); });
|
|
86
|
+
i0.ɵɵelement(19, "i", 44);
|
|
87
|
+
i0.ɵɵtext(20, " Cancel ");
|
|
88
|
+
i0.ɵɵelementEnd()()();
|
|
89
|
+
i0.ɵɵelementStart(21, "div", 45)(22, "small", 46);
|
|
90
|
+
i0.ɵɵtext(23);
|
|
91
|
+
i0.ɵɵelementEnd()()();
|
|
92
|
+
} if (rf & 2) {
|
|
93
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
94
|
+
i0.ɵɵadvance(5);
|
|
95
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r1.bulkEditPriority);
|
|
96
|
+
i0.ɵɵadvance(4);
|
|
97
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r1.bulkEditStatus);
|
|
98
|
+
i0.ɵɵadvance(14);
|
|
99
|
+
i0.ɵɵtextInterpolate1(" Editing ", ctx_r1.selectedCells.size, " selected cell(s). Use Ctrl+Click for multi-select, Shift+Click for range select. ");
|
|
100
|
+
} }
|
|
101
|
+
function ModelPromptPriorityMatrixComponent_Conditional_33_Template(rf, ctx) { if (rf & 1) {
|
|
102
|
+
i0.ɵɵelementStart(0, "div", 22)(1, "div", 47)(2, "div", 48)(3, "span", 49);
|
|
103
|
+
i0.ɵɵtext(4, "Loading...");
|
|
104
|
+
i0.ɵɵelementEnd()();
|
|
105
|
+
i0.ɵɵelementStart(5, "p", 50);
|
|
106
|
+
i0.ɵɵtext(6);
|
|
107
|
+
i0.ɵɵelementEnd()()();
|
|
108
|
+
} if (rf & 2) {
|
|
109
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
110
|
+
i0.ɵɵadvance(6);
|
|
111
|
+
i0.ɵɵtextInterpolate(ctx_r1.loadingMessage);
|
|
112
|
+
} }
|
|
113
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_8_Template(rf, ctx) { if (rf & 1) {
|
|
114
|
+
i0.ɵɵelementStart(0, "th", 56)(1, "div", 58)(2, "div", 59);
|
|
115
|
+
i0.ɵɵtext(3);
|
|
116
|
+
i0.ɵɵelementEnd();
|
|
117
|
+
i0.ɵɵelementStart(4, "div", 60)(5, "small", 46);
|
|
118
|
+
i0.ɵɵtext(6);
|
|
119
|
+
i0.ɵɵelementEnd()()()();
|
|
120
|
+
} if (rf & 2) {
|
|
121
|
+
const model_r5 = ctx.$implicit;
|
|
122
|
+
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
123
|
+
i0.ɵɵproperty("title", model_r5.Description || model_r5.Name);
|
|
124
|
+
i0.ɵɵadvance(3);
|
|
125
|
+
i0.ɵɵtextInterpolate(model_r5.Name);
|
|
126
|
+
i0.ɵɵadvance(3);
|
|
127
|
+
i0.ɵɵtextInterpolate(ctx_r1.getModelAssociationCount(model_r5.ID));
|
|
128
|
+
} }
|
|
129
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Conditional_1_Conditional_3_Template(rf, ctx) { if (rf & 1) {
|
|
130
|
+
i0.ɵɵelementStart(0, "div", 66);
|
|
131
|
+
i0.ɵɵelement(1, "i", 70);
|
|
132
|
+
i0.ɵɵelementEnd();
|
|
133
|
+
} }
|
|
134
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Conditional_1_Conditional_4_Template(rf, ctx) { if (rf & 1) {
|
|
135
|
+
i0.ɵɵelementStart(0, "div", 67);
|
|
136
|
+
i0.ɵɵelement(1, "i", 71);
|
|
137
|
+
i0.ɵɵelementEnd();
|
|
138
|
+
} }
|
|
139
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Conditional_1_Conditional_5_Template(rf, ctx) { if (rf & 1) {
|
|
140
|
+
i0.ɵɵelementStart(0, "div", 68);
|
|
141
|
+
i0.ɵɵelement(1, "i", 26);
|
|
142
|
+
i0.ɵɵelementEnd();
|
|
143
|
+
} }
|
|
144
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Conditional_1_Conditional_6_Template(rf, ctx) { if (rf & 1) {
|
|
145
|
+
i0.ɵɵelementStart(0, "div", 69)(1, "small");
|
|
146
|
+
i0.ɵɵtext(2);
|
|
147
|
+
i0.ɵɵelementEnd()();
|
|
148
|
+
} if (rf & 2) {
|
|
149
|
+
const assoc_r11 = i0.ɵɵnextContext();
|
|
150
|
+
const ctx_r1 = i0.ɵɵnextContext(5);
|
|
151
|
+
i0.ɵɵadvance(2);
|
|
152
|
+
i0.ɵɵtextInterpolate1("", ctx_r1.performanceData[assoc_r11.promptId + "_" + assoc_r11.modelId].avgResponseTime, "ms");
|
|
153
|
+
} }
|
|
154
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
155
|
+
i0.ɵɵelementStart(0, "div", 64)(1, "div");
|
|
156
|
+
i0.ɵɵtext(2);
|
|
157
|
+
i0.ɵɵelementEnd();
|
|
158
|
+
i0.ɵɵtemplate(3, ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Conditional_1_Conditional_3_Template, 2, 0, "div", 66)(4, ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Conditional_1_Conditional_4_Template, 2, 0, "div", 67)(5, ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Conditional_1_Conditional_5_Template, 2, 0, "div", 68)(6, ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Conditional_1_Conditional_6_Template, 3, 1, "div", 69);
|
|
159
|
+
i0.ɵɵelementEnd();
|
|
160
|
+
} if (rf & 2) {
|
|
161
|
+
const assoc_r11 = ctx;
|
|
162
|
+
const ctx_r1 = i0.ɵɵnextContext(5);
|
|
163
|
+
i0.ɵɵadvance();
|
|
164
|
+
i0.ɵɵclassMapInterpolate1("priority-badge priority-", assoc_r11.priority, "");
|
|
165
|
+
i0.ɵɵadvance();
|
|
166
|
+
i0.ɵɵtextInterpolate1(" ", assoc_r11.priority, " ");
|
|
167
|
+
i0.ɵɵadvance();
|
|
168
|
+
i0.ɵɵconditional(assoc_r11.status === "Inactive" ? 3 : -1);
|
|
169
|
+
i0.ɵɵadvance();
|
|
170
|
+
i0.ɵɵconditional(assoc_r11.isNew ? 4 : assoc_r11.isModified ? 5 : -1);
|
|
171
|
+
i0.ɵɵadvance(2);
|
|
172
|
+
i0.ɵɵconditional(ctx_r1.showPerformanceOverlay && ctx_r1.performanceData[assoc_r11.promptId + "_" + assoc_r11.modelId] ? 6 : -1);
|
|
173
|
+
} }
|
|
174
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Conditional_2_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
175
|
+
i0.ɵɵelementStart(0, "div", 72);
|
|
176
|
+
i0.ɵɵelement(1, "i", 71);
|
|
177
|
+
i0.ɵɵelementEnd();
|
|
178
|
+
} }
|
|
179
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Conditional_2_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
180
|
+
i0.ɵɵelementStart(0, "div", 73);
|
|
181
|
+
i0.ɵɵelement(1, "i", 70);
|
|
182
|
+
i0.ɵɵelementEnd();
|
|
183
|
+
} }
|
|
184
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Conditional_2_Template(rf, ctx) { if (rf & 1) {
|
|
185
|
+
i0.ɵɵelementStart(0, "div", 65);
|
|
186
|
+
i0.ɵɵtemplate(1, ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Conditional_2_Conditional_1_Template, 2, 0, "div", 72)(2, ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Conditional_2_Conditional_2_Template, 2, 0, "div", 73);
|
|
187
|
+
i0.ɵɵelementEnd();
|
|
188
|
+
} if (rf & 2) {
|
|
189
|
+
const ɵ$index_183_r9 = i0.ɵɵnextContext().$index;
|
|
190
|
+
const ɵ$index_168_r10 = i0.ɵɵnextContext().$index;
|
|
191
|
+
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
192
|
+
i0.ɵɵadvance();
|
|
193
|
+
i0.ɵɵconditional(ctx_r1.matrix[ɵ$index_168_r10][ɵ$index_183_r9].canAssign ? 1 : 2);
|
|
194
|
+
} }
|
|
195
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Template(rf, ctx) { if (rf & 1) {
|
|
196
|
+
const _r8 = i0.ɵɵgetCurrentView();
|
|
197
|
+
i0.ɵɵelementStart(0, "td", 63);
|
|
198
|
+
i0.ɵɵlistener("click", function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Template_td_click_0_listener($event) { const ɵ$index_183_r9 = i0.ɵɵrestoreView(_r8).$index; const ɵ$index_168_r10 = i0.ɵɵnextContext().$index; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onCellClick(ɵ$index_168_r10, ɵ$index_183_r9, $event)); })("dblclick", function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Template_td_dblclick_0_listener() { const ɵ$index_183_r9 = i0.ɵɵrestoreView(_r8).$index; const ɵ$index_168_r10 = i0.ɵɵnextContext().$index; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.onCellDoubleClick(ɵ$index_168_r10, ɵ$index_183_r9)); });
|
|
199
|
+
i0.ɵɵtemplate(1, ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Conditional_1_Template, 7, 7, "div", 64)(2, ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Conditional_2_Template, 3, 1, "div", 65);
|
|
200
|
+
i0.ɵɵelementEnd();
|
|
201
|
+
} if (rf & 2) {
|
|
202
|
+
let tmp_26_0;
|
|
203
|
+
const ɵ$index_183_r9 = ctx.$index;
|
|
204
|
+
const ɵ$index_168_r10 = i0.ɵɵnextContext().$index;
|
|
205
|
+
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
206
|
+
i0.ɵɵclassMap(ctx_r1.getCellClass(ctx_r1.matrix[ɵ$index_168_r10][ɵ$index_183_r9]));
|
|
207
|
+
i0.ɵɵproperty("title", ctx_r1.getCellTooltip(ctx_r1.matrix[ɵ$index_168_r10][ɵ$index_183_r9]));
|
|
208
|
+
i0.ɵɵadvance();
|
|
209
|
+
i0.ɵɵconditional((tmp_26_0 = ctx_r1.matrix[ɵ$index_168_r10][ɵ$index_183_r9].association) ? 1 : 2, tmp_26_0);
|
|
210
|
+
} }
|
|
211
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_Template(rf, ctx) { if (rf & 1) {
|
|
212
|
+
const _r6 = i0.ɵɵgetCurrentView();
|
|
213
|
+
i0.ɵɵelementStart(0, "tr", 57)(1, "th", 61);
|
|
214
|
+
i0.ɵɵlistener("click", function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_Template_th_click_1_listener() { const prompt_r7 = i0.ɵɵrestoreView(_r6).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.selectPrompt(prompt_r7)); });
|
|
215
|
+
i0.ɵɵelementStart(2, "div", 58)(3, "div", 59);
|
|
216
|
+
i0.ɵɵtext(4);
|
|
217
|
+
i0.ɵɵelementEnd();
|
|
218
|
+
i0.ɵɵelementStart(5, "div", 60)(6, "small", 46);
|
|
219
|
+
i0.ɵɵtext(7);
|
|
220
|
+
i0.ɵɵelementEnd()()()();
|
|
221
|
+
i0.ɵɵrepeaterCreate(8, ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_For_9_Template, 3, 4, "td", 62, _forTrack0);
|
|
222
|
+
i0.ɵɵelementEnd();
|
|
223
|
+
} if (rf & 2) {
|
|
224
|
+
const prompt_r7 = ctx.$implicit;
|
|
225
|
+
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
226
|
+
i0.ɵɵadvance();
|
|
227
|
+
i0.ɵɵproperty("title", prompt_r7.Description || prompt_r7.Name);
|
|
228
|
+
i0.ɵɵadvance(3);
|
|
229
|
+
i0.ɵɵtextInterpolate(prompt_r7.Name);
|
|
230
|
+
i0.ɵɵadvance(3);
|
|
231
|
+
i0.ɵɵtextInterpolate(ctx_r1.getPromptAssociationCount(prompt_r7.ID));
|
|
232
|
+
i0.ɵɵadvance();
|
|
233
|
+
i0.ɵɵrepeater(ctx_r1.models);
|
|
234
|
+
} }
|
|
235
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
236
|
+
i0.ɵɵelementStart(0, "div", 51)(1, "div", 53)(2, "table", 54)(3, "thead")(4, "tr")(5, "th", 55);
|
|
237
|
+
i0.ɵɵtext(6, "Prompts \\\\ Models");
|
|
238
|
+
i0.ɵɵelementEnd();
|
|
239
|
+
i0.ɵɵrepeaterCreate(7, ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_8_Template, 7, 3, "th", 56, _forTrack0);
|
|
240
|
+
i0.ɵɵelementEnd()();
|
|
241
|
+
i0.ɵɵelementStart(9, "tbody");
|
|
242
|
+
i0.ɵɵrepeaterCreate(10, ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_For_11_Template, 10, 3, "tr", 57, _forTrack0);
|
|
243
|
+
i0.ɵɵelementEnd()()()();
|
|
244
|
+
} if (rf & 2) {
|
|
245
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
246
|
+
i0.ɵɵadvance(7);
|
|
247
|
+
i0.ɵɵrepeater(ctx_r1.models);
|
|
248
|
+
i0.ɵɵadvance(3);
|
|
249
|
+
i0.ɵɵrepeater(ctx_r1.prompts);
|
|
250
|
+
} }
|
|
251
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_1_For_22_Conditional_0_Conditional_9_Template(rf, ctx) { if (rf & 1) {
|
|
252
|
+
const _r13 = i0.ɵɵgetCurrentView();
|
|
253
|
+
i0.ɵɵelementStart(0, "button", 102);
|
|
254
|
+
i0.ɵɵelement(1, "i", 26);
|
|
255
|
+
i0.ɵɵelementEnd();
|
|
256
|
+
i0.ɵɵelementStart(2, "button", 103);
|
|
257
|
+
i0.ɵɵlistener("click", function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_1_For_22_Conditional_0_Conditional_9_Template_button_click_2_listener() { i0.ɵɵrestoreView(_r13); const association_r14 = i0.ɵɵnextContext(2).$implicit; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.removeAssociation(association_r14.promptId, association_r14.modelId)); });
|
|
258
|
+
i0.ɵɵelement(3, "i", 28);
|
|
259
|
+
i0.ɵɵelementEnd();
|
|
260
|
+
} }
|
|
261
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_1_For_22_Conditional_0_Conditional_21_Template(rf, ctx) { if (rf & 1) {
|
|
262
|
+
i0.ɵɵelementStart(0, "div", 99)(1, "span", 104);
|
|
263
|
+
i0.ɵɵelement(2, "i", 71);
|
|
264
|
+
i0.ɵɵtext(3, " New ");
|
|
265
|
+
i0.ɵɵelementEnd()();
|
|
266
|
+
} }
|
|
267
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_1_For_22_Conditional_0_Conditional_22_Template(rf, ctx) { if (rf & 1) {
|
|
268
|
+
i0.ɵɵelementStart(0, "div", 99)(1, "span", 105);
|
|
269
|
+
i0.ɵɵelement(2, "i", 26);
|
|
270
|
+
i0.ɵɵtext(3, " Modified ");
|
|
271
|
+
i0.ɵɵelementEnd()();
|
|
272
|
+
} }
|
|
273
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_1_For_22_Conditional_0_Template(rf, ctx) { if (rf & 1) {
|
|
274
|
+
i0.ɵɵelementStart(0, "div", 91)(1, "div", 92)(2, "div", 93)(3, "strong", 94);
|
|
275
|
+
i0.ɵɵtext(4);
|
|
276
|
+
i0.ɵɵelementEnd();
|
|
277
|
+
i0.ɵɵelement(5, "i", 95);
|
|
278
|
+
i0.ɵɵelementStart(6, "strong", 96);
|
|
279
|
+
i0.ɵɵtext(7);
|
|
280
|
+
i0.ɵɵelementEnd()();
|
|
281
|
+
i0.ɵɵelementStart(8, "div", 97);
|
|
282
|
+
i0.ɵɵtemplate(9, ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_1_For_22_Conditional_0_Conditional_9_Template, 4, 0);
|
|
283
|
+
i0.ɵɵelementEnd()();
|
|
284
|
+
i0.ɵɵelementStart(10, "div", 98)(11, "div", 99)(12, "span", 100);
|
|
285
|
+
i0.ɵɵtext(13, "Priority:");
|
|
286
|
+
i0.ɵɵelementEnd();
|
|
287
|
+
i0.ɵɵelementStart(14, "span");
|
|
288
|
+
i0.ɵɵtext(15);
|
|
289
|
+
i0.ɵɵelementEnd()();
|
|
290
|
+
i0.ɵɵelementStart(16, "div", 99)(17, "span", 100);
|
|
291
|
+
i0.ɵɵtext(18, "Status:");
|
|
292
|
+
i0.ɵɵelementEnd();
|
|
293
|
+
i0.ɵɵelementStart(19, "span", 101);
|
|
294
|
+
i0.ɵɵtext(20);
|
|
295
|
+
i0.ɵɵelementEnd()();
|
|
296
|
+
i0.ɵɵtemplate(21, ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_1_For_22_Conditional_0_Conditional_21_Template, 4, 0, "div", 99)(22, ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_1_For_22_Conditional_0_Conditional_22_Template, 4, 0, "div", 99);
|
|
297
|
+
i0.ɵɵelementEnd()();
|
|
298
|
+
} if (rf & 2) {
|
|
299
|
+
const association_r14 = i0.ɵɵnextContext().$implicit;
|
|
300
|
+
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
301
|
+
i0.ɵɵclassProp("inactive", association_r14.status === "Inactive")("new", association_r14.isNew)("modified", association_r14.isModified);
|
|
302
|
+
i0.ɵɵadvance(4);
|
|
303
|
+
i0.ɵɵtextInterpolate(association_r14.promptName);
|
|
304
|
+
i0.ɵɵadvance(3);
|
|
305
|
+
i0.ɵɵtextInterpolate(association_r14.modelName);
|
|
306
|
+
i0.ɵɵadvance(2);
|
|
307
|
+
i0.ɵɵconditional(!ctx_r1.readonly ? 9 : -1);
|
|
308
|
+
i0.ɵɵadvance(5);
|
|
309
|
+
i0.ɵɵclassMapInterpolate1("priority-badge priority-", association_r14.priority, "");
|
|
310
|
+
i0.ɵɵadvance();
|
|
311
|
+
i0.ɵɵtextInterpolate1(" ", association_r14.priority, " ");
|
|
312
|
+
i0.ɵɵadvance(4);
|
|
313
|
+
i0.ɵɵclassProp("badge-success", association_r14.status === "Active")("badge-secondary", association_r14.status === "Inactive");
|
|
314
|
+
i0.ɵɵadvance();
|
|
315
|
+
i0.ɵɵtextInterpolate1(" ", association_r14.status, " ");
|
|
316
|
+
i0.ɵɵadvance();
|
|
317
|
+
i0.ɵɵconditional(association_r14.isNew ? 21 : association_r14.isModified ? 22 : -1);
|
|
318
|
+
} }
|
|
319
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_1_For_22_Template(rf, ctx) { if (rf & 1) {
|
|
320
|
+
i0.ɵɵtemplate(0, ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_1_For_22_Conditional_0_Template, 23, 19, "div", 90);
|
|
321
|
+
} if (rf & 2) {
|
|
322
|
+
const association_r14 = ctx.$implicit;
|
|
323
|
+
const ctx_r1 = i0.ɵɵnextContext(3);
|
|
324
|
+
i0.ɵɵconditional(ctx_r1.showInactiveAssociations || association_r14.status === "Active" ? 0 : -1);
|
|
325
|
+
} }
|
|
326
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_1_Conditional_23_Template(rf, ctx) { if (rf & 1) {
|
|
327
|
+
i0.ɵɵelementStart(0, "div", 89);
|
|
328
|
+
i0.ɵɵelement(1, "i", 106);
|
|
329
|
+
i0.ɵɵelementStart(2, "p", 107);
|
|
330
|
+
i0.ɵɵtext(3, "No prompt-model associations found. Click on matrix cells to create associations.");
|
|
331
|
+
i0.ɵɵelementEnd()();
|
|
332
|
+
} }
|
|
333
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_1_Template(rf, ctx) { if (rf & 1) {
|
|
334
|
+
const _r12 = i0.ɵɵgetCurrentView();
|
|
335
|
+
i0.ɵɵelementStart(0, "div", 52)(1, "div", 74)(2, "div", 75)(3, "div", 76)(4, "label", 77);
|
|
336
|
+
i0.ɵɵtext(5, "Sort by:");
|
|
337
|
+
i0.ɵɵelementEnd();
|
|
338
|
+
i0.ɵɵelementStart(6, "select", 78);
|
|
339
|
+
i0.ɵɵtwoWayListener("ngModelChange", function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_1_Template_select_ngModelChange_6_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r1.sortBy, $event) || (ctx_r1.sortBy = $event); return i0.ɵɵresetView($event); });
|
|
340
|
+
i0.ɵɵlistener("ngModelChange", function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_1_Template_select_ngModelChange_6_listener() { i0.ɵɵrestoreView(_r12); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.sortAssociations()); });
|
|
341
|
+
i0.ɵɵelementStart(7, "option", 79);
|
|
342
|
+
i0.ɵɵtext(8, "Prompt Name");
|
|
343
|
+
i0.ɵɵelementEnd();
|
|
344
|
+
i0.ɵɵelementStart(9, "option", 80);
|
|
345
|
+
i0.ɵɵtext(10, "Model Name");
|
|
346
|
+
i0.ɵɵelementEnd();
|
|
347
|
+
i0.ɵɵelementStart(11, "option", 81);
|
|
348
|
+
i0.ɵɵtext(12, "Priority");
|
|
349
|
+
i0.ɵɵelementEnd()();
|
|
350
|
+
i0.ɵɵelementStart(13, "button", 82);
|
|
351
|
+
i0.ɵɵlistener("click", function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_1_Template_button_click_13_listener() { i0.ɵɵrestoreView(_r12); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.toggleSortDirection()); });
|
|
352
|
+
i0.ɵɵelement(14, "i", 83);
|
|
353
|
+
i0.ɵɵelementEnd()();
|
|
354
|
+
i0.ɵɵelementStart(15, "div", 84)(16, "div", 85)(17, "input", 86);
|
|
355
|
+
i0.ɵɵtwoWayListener("ngModelChange", function ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_1_Template_input_ngModelChange_17_listener($event) { i0.ɵɵrestoreView(_r12); const ctx_r1 = i0.ɵɵnextContext(2); i0.ɵɵtwoWayBindingSet(ctx_r1.showInactiveAssociations, $event) || (ctx_r1.showInactiveAssociations = $event); return i0.ɵɵresetView($event); });
|
|
356
|
+
i0.ɵɵelementEnd();
|
|
357
|
+
i0.ɵɵelementStart(18, "label", 87);
|
|
358
|
+
i0.ɵɵtext(19, " Show inactive ");
|
|
359
|
+
i0.ɵɵelementEnd()()()()();
|
|
360
|
+
i0.ɵɵelementStart(20, "div", 88);
|
|
361
|
+
i0.ɵɵrepeaterCreate(21, ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_1_For_22_Template, 1, 1, null, null, _forTrack1);
|
|
362
|
+
i0.ɵɵtemplate(23, ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_1_Conditional_23_Template, 4, 0, "div", 89);
|
|
363
|
+
i0.ɵɵelementEnd()();
|
|
364
|
+
} if (rf & 2) {
|
|
365
|
+
const ctx_r1 = i0.ɵɵnextContext(2);
|
|
366
|
+
i0.ɵɵadvance(6);
|
|
367
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r1.sortBy);
|
|
368
|
+
i0.ɵɵadvance(7);
|
|
369
|
+
i0.ɵɵproperty("title", "Sort " + (ctx_r1.sortDirection === "asc" ? "descending" : "ascending"));
|
|
370
|
+
i0.ɵɵadvance();
|
|
371
|
+
i0.ɵɵclassProp("fa-sort-up", ctx_r1.sortDirection === "asc")("fa-sort-down", ctx_r1.sortDirection === "desc");
|
|
372
|
+
i0.ɵɵadvance(3);
|
|
373
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx_r1.showInactiveAssociations);
|
|
374
|
+
i0.ɵɵadvance(4);
|
|
375
|
+
i0.ɵɵrepeater(ctx_r1.associations);
|
|
376
|
+
i0.ɵɵadvance(2);
|
|
377
|
+
i0.ɵɵconditional(ctx_r1.associations.length === 0 ? 23 : -1);
|
|
378
|
+
} }
|
|
379
|
+
function ModelPromptPriorityMatrixComponent_Conditional_34_Template(rf, ctx) { if (rf & 1) {
|
|
380
|
+
i0.ɵɵtemplate(0, ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_0_Template, 12, 0, "div", 51)(1, ModelPromptPriorityMatrixComponent_Conditional_34_Conditional_1_Template, 24, 8, "div", 52);
|
|
381
|
+
} if (rf & 2) {
|
|
382
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
383
|
+
i0.ɵɵconditional(ctx_r1.viewMode === "matrix" ? 0 : -1);
|
|
384
|
+
i0.ɵɵadvance();
|
|
385
|
+
i0.ɵɵconditional(ctx_r1.viewMode === "list" ? 1 : -1);
|
|
386
|
+
} }
|
|
387
|
+
function ModelPromptPriorityMatrixComponent_Conditional_35_Template(rf, ctx) { if (rf & 1) {
|
|
388
|
+
const _r15 = i0.ɵɵgetCurrentView();
|
|
389
|
+
i0.ɵɵelementStart(0, "div", 23)(1, "div", 108);
|
|
390
|
+
i0.ɵɵelement(2, "i", 24);
|
|
391
|
+
i0.ɵɵtext(3);
|
|
392
|
+
i0.ɵɵelementStart(4, "button", 109);
|
|
393
|
+
i0.ɵɵlistener("click", function ModelPromptPriorityMatrixComponent_Conditional_35_Template_button_click_4_listener() { i0.ɵɵrestoreView(_r15); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.loadData()); });
|
|
394
|
+
i0.ɵɵelement(5, "i", 110);
|
|
395
|
+
i0.ɵɵtext(6, " Retry ");
|
|
396
|
+
i0.ɵɵelementEnd()()();
|
|
397
|
+
} if (rf & 2) {
|
|
398
|
+
const ctx_r1 = i0.ɵɵnextContext();
|
|
399
|
+
i0.ɵɵadvance(3);
|
|
400
|
+
i0.ɵɵtextInterpolate1(" ", ctx_r1.error, " ");
|
|
401
|
+
} }
|
|
402
|
+
export class ModelPromptPriorityMatrixComponent {
|
|
403
|
+
constructor(notificationService) {
|
|
404
|
+
this.notificationService = notificationService;
|
|
405
|
+
this.selectedPrompts = [];
|
|
406
|
+
this.selectedModels = [];
|
|
407
|
+
this.readonly = false;
|
|
408
|
+
this.associationsChange = new EventEmitter();
|
|
409
|
+
this.stateChange = new EventEmitter();
|
|
410
|
+
this.promptSelected = new EventEmitter();
|
|
411
|
+
// Data
|
|
412
|
+
this.prompts = [];
|
|
413
|
+
this.models = [];
|
|
414
|
+
this.associations = [];
|
|
415
|
+
this.matrix = [];
|
|
416
|
+
// UI State
|
|
417
|
+
this.isLoading = false;
|
|
418
|
+
this.loadingMessage = '';
|
|
419
|
+
this.error = null;
|
|
420
|
+
this.viewMode = 'matrix';
|
|
421
|
+
this.sortBy = 'priority';
|
|
422
|
+
this.sortDirection = 'asc';
|
|
423
|
+
this.showInactiveAssociations = false;
|
|
424
|
+
// Selection and editing
|
|
425
|
+
this.selectedCells = new Set();
|
|
426
|
+
this.editingCell = null;
|
|
427
|
+
this.bulkEditMode = false;
|
|
428
|
+
this.bulkEditPriority = 1;
|
|
429
|
+
this.bulkEditStatus = 'Active';
|
|
430
|
+
// Filtering
|
|
431
|
+
this.promptFilter$ = new BehaviorSubject('');
|
|
432
|
+
this.modelFilter$ = new BehaviorSubject('');
|
|
433
|
+
this.statusFilter$ = new BehaviorSubject('all');
|
|
434
|
+
// Performance metrics
|
|
435
|
+
this.performanceData = {};
|
|
436
|
+
this.showPerformanceOverlay = false;
|
|
437
|
+
this.destroy$ = new Subject();
|
|
438
|
+
}
|
|
439
|
+
ngOnInit() {
|
|
440
|
+
this.loadData();
|
|
441
|
+
}
|
|
442
|
+
ngOnDestroy() {
|
|
443
|
+
this.destroy$.next();
|
|
444
|
+
this.destroy$.complete();
|
|
445
|
+
}
|
|
446
|
+
loadData() {
|
|
447
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
448
|
+
try {
|
|
449
|
+
this.isLoading = true;
|
|
450
|
+
this.error = null;
|
|
451
|
+
this.loadingMessage = 'Loading prompts, models, and associations...';
|
|
452
|
+
const [prompts, models, associations] = yield Promise.all([
|
|
453
|
+
this.loadPrompts(),
|
|
454
|
+
this.loadModels(),
|
|
455
|
+
this.loadAssociations()
|
|
456
|
+
]);
|
|
457
|
+
this.prompts = this.selectedPrompts.length > 0 ? this.selectedPrompts : prompts;
|
|
458
|
+
this.models = this.selectedModels.length > 0 ? this.selectedModels : models;
|
|
459
|
+
this.buildAssociations(associations);
|
|
460
|
+
this.buildMatrix();
|
|
461
|
+
LogStatus('Model-prompt priority matrix loaded successfully');
|
|
462
|
+
}
|
|
463
|
+
catch (error) {
|
|
464
|
+
this.error = 'Failed to load matrix data. Please try again.';
|
|
465
|
+
LogError('Error loading matrix data', undefined, error);
|
|
466
|
+
}
|
|
467
|
+
finally {
|
|
468
|
+
this.isLoading = false;
|
|
469
|
+
}
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
loadPrompts() {
|
|
473
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
474
|
+
const rv = new RunView();
|
|
475
|
+
const result = yield rv.RunView({
|
|
476
|
+
EntityName: 'AI Prompts',
|
|
477
|
+
ExtraFilter: "Status = 'Active'",
|
|
478
|
+
OrderBy: 'Name',
|
|
479
|
+
UserSearchString: '',
|
|
480
|
+
IgnoreMaxRows: false,
|
|
481
|
+
MaxRows: 500
|
|
482
|
+
});
|
|
483
|
+
if (result && result.Success && result.Results) {
|
|
484
|
+
return result.Results;
|
|
485
|
+
}
|
|
486
|
+
else {
|
|
487
|
+
throw new Error('Failed to load AI prompts');
|
|
488
|
+
}
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
loadModels() {
|
|
492
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
493
|
+
const rv = new RunView();
|
|
494
|
+
const result = yield rv.RunView({
|
|
495
|
+
EntityName: 'AI Models',
|
|
496
|
+
ExtraFilter: "IsActive = 1",
|
|
497
|
+
OrderBy: 'Name',
|
|
498
|
+
UserSearchString: '',
|
|
499
|
+
IgnoreMaxRows: false,
|
|
500
|
+
MaxRows: 200
|
|
501
|
+
});
|
|
502
|
+
if (result && result.Success && result.Results) {
|
|
503
|
+
return result.Results;
|
|
504
|
+
}
|
|
505
|
+
else {
|
|
506
|
+
throw new Error('Failed to load AI models');
|
|
507
|
+
}
|
|
508
|
+
});
|
|
509
|
+
}
|
|
510
|
+
loadAssociations() {
|
|
511
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
512
|
+
const rv = new RunView();
|
|
513
|
+
const result = yield rv.RunView({
|
|
514
|
+
EntityName: 'MJ: AI Prompt Models',
|
|
515
|
+
ExtraFilter: '',
|
|
516
|
+
OrderBy: 'Priority',
|
|
517
|
+
UserSearchString: '',
|
|
518
|
+
IgnoreMaxRows: false,
|
|
519
|
+
MaxRows: 2000
|
|
520
|
+
});
|
|
521
|
+
if (result && result.Success && result.Results) {
|
|
522
|
+
return result.Results;
|
|
523
|
+
}
|
|
524
|
+
else {
|
|
525
|
+
throw new Error('Failed to load prompt-model associations');
|
|
526
|
+
}
|
|
527
|
+
});
|
|
528
|
+
}
|
|
529
|
+
buildAssociations(dbAssociations) {
|
|
530
|
+
this.associations = [];
|
|
531
|
+
// Create associations for existing database records
|
|
532
|
+
dbAssociations.forEach(dbAssoc => {
|
|
533
|
+
const prompt = this.prompts.find(p => p.ID === dbAssoc.PromptID);
|
|
534
|
+
const model = this.models.find(m => m.ID === dbAssoc.ModelID);
|
|
535
|
+
if (prompt && model) {
|
|
536
|
+
this.associations.push({
|
|
537
|
+
promptId: prompt.ID,
|
|
538
|
+
promptName: prompt.Name,
|
|
539
|
+
modelId: model.ID,
|
|
540
|
+
modelName: model.Name,
|
|
541
|
+
priority: dbAssoc.Priority || 1,
|
|
542
|
+
status: dbAssoc.Status || 'Active',
|
|
543
|
+
association: dbAssoc,
|
|
544
|
+
isNew: false,
|
|
545
|
+
isModified: false
|
|
546
|
+
});
|
|
547
|
+
}
|
|
548
|
+
});
|
|
549
|
+
}
|
|
550
|
+
buildMatrix() {
|
|
551
|
+
this.matrix = [];
|
|
552
|
+
this.prompts.forEach((prompt, promptIndex) => {
|
|
553
|
+
this.matrix[promptIndex] = [];
|
|
554
|
+
this.models.forEach((model, modelIndex) => {
|
|
555
|
+
const association = this.associations.find(a => a.promptId === prompt.ID && a.modelId === model.ID);
|
|
556
|
+
this.matrix[promptIndex][modelIndex] = {
|
|
557
|
+
promptId: prompt.ID,
|
|
558
|
+
modelId: model.ID,
|
|
559
|
+
association: association || null,
|
|
560
|
+
canAssign: this.canAssignModelToPrompt(prompt, model)
|
|
561
|
+
};
|
|
562
|
+
});
|
|
563
|
+
});
|
|
564
|
+
}
|
|
565
|
+
canAssignModelToPrompt(prompt, model) {
|
|
566
|
+
// Check model type compatibility
|
|
567
|
+
if (prompt.OutputType && model.AIModelTypeID) {
|
|
568
|
+
// Add business logic for compatibility checking
|
|
569
|
+
return true;
|
|
570
|
+
}
|
|
571
|
+
return true;
|
|
572
|
+
}
|
|
573
|
+
getCellKey(promptIndex, modelIndex) {
|
|
574
|
+
return `${promptIndex}-${modelIndex}`;
|
|
575
|
+
}
|
|
576
|
+
getCellClass(cell) {
|
|
577
|
+
const classes = ['matrix-cell'];
|
|
578
|
+
if (cell.association) {
|
|
579
|
+
classes.push('has-association');
|
|
580
|
+
classes.push(`priority-${Math.min(cell.association.priority, 5)}`);
|
|
581
|
+
if (cell.association.status === 'Inactive') {
|
|
582
|
+
classes.push('inactive');
|
|
583
|
+
}
|
|
584
|
+
if (cell.association.isNew) {
|
|
585
|
+
classes.push('new');
|
|
586
|
+
}
|
|
587
|
+
if (cell.association.isModified) {
|
|
588
|
+
classes.push('modified');
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
else {
|
|
592
|
+
classes.push('no-association');
|
|
593
|
+
}
|
|
594
|
+
if (!cell.canAssign) {
|
|
595
|
+
classes.push('cannot-assign');
|
|
596
|
+
}
|
|
597
|
+
const cellKey = this.getCellKey(this.prompts.findIndex(p => p.ID === cell.promptId), this.models.findIndex(m => m.ID === cell.modelId));
|
|
598
|
+
if (this.selectedCells.has(cellKey)) {
|
|
599
|
+
classes.push('selected');
|
|
600
|
+
}
|
|
601
|
+
if (this.editingCell === cellKey) {
|
|
602
|
+
classes.push('editing');
|
|
603
|
+
}
|
|
604
|
+
return classes.join(' ');
|
|
605
|
+
}
|
|
606
|
+
onCellClick(promptIndex, modelIndex, event) {
|
|
607
|
+
if (this.readonly)
|
|
608
|
+
return;
|
|
609
|
+
const cellKey = this.getCellKey(promptIndex, modelIndex);
|
|
610
|
+
const cell = this.matrix[promptIndex][modelIndex];
|
|
611
|
+
if (event.ctrlKey || event.metaKey) {
|
|
612
|
+
// Multi-select mode
|
|
613
|
+
if (this.selectedCells.has(cellKey)) {
|
|
614
|
+
this.selectedCells.delete(cellKey);
|
|
615
|
+
}
|
|
616
|
+
else {
|
|
617
|
+
this.selectedCells.add(cellKey);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
else if (event.shiftKey && this.selectedCells.size > 0) {
|
|
621
|
+
// Range select mode
|
|
622
|
+
this.selectRange(promptIndex, modelIndex);
|
|
623
|
+
}
|
|
624
|
+
else {
|
|
625
|
+
// Single select mode
|
|
626
|
+
this.selectedCells.clear();
|
|
627
|
+
if (cell.canAssign) {
|
|
628
|
+
this.selectedCells.add(cellKey);
|
|
629
|
+
}
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
onCellDoubleClick(promptIndex, modelIndex) {
|
|
633
|
+
if (this.readonly)
|
|
634
|
+
return;
|
|
635
|
+
const cellKey = this.getCellKey(promptIndex, modelIndex);
|
|
636
|
+
const cell = this.matrix[promptIndex][modelIndex];
|
|
637
|
+
if (cell.canAssign) {
|
|
638
|
+
this.editingCell = cellKey;
|
|
639
|
+
if (!cell.association) {
|
|
640
|
+
// Create new association
|
|
641
|
+
this.createAssociation(cell.promptId, cell.modelId);
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
}
|
|
645
|
+
selectRange(endPromptIndex, endModelIndex) {
|
|
646
|
+
const selectedKeys = Array.from(this.selectedCells);
|
|
647
|
+
if (selectedKeys.length === 0)
|
|
648
|
+
return;
|
|
649
|
+
const lastSelectedKey = selectedKeys[selectedKeys.length - 1];
|
|
650
|
+
const [startPromptIndex, startModelIndex] = lastSelectedKey.split('-').map(Number);
|
|
651
|
+
const minPromptIndex = Math.min(startPromptIndex, endPromptIndex);
|
|
652
|
+
const maxPromptIndex = Math.max(startPromptIndex, endPromptIndex);
|
|
653
|
+
const minModelIndex = Math.min(startModelIndex, endModelIndex);
|
|
654
|
+
const maxModelIndex = Math.max(startModelIndex, endModelIndex);
|
|
655
|
+
this.selectedCells.clear();
|
|
656
|
+
for (let p = minPromptIndex; p <= maxPromptIndex; p++) {
|
|
657
|
+
for (let m = minModelIndex; m <= maxModelIndex; m++) {
|
|
658
|
+
const cell = this.matrix[p][m];
|
|
659
|
+
if (cell && cell.canAssign) {
|
|
660
|
+
this.selectedCells.add(this.getCellKey(p, m));
|
|
661
|
+
}
|
|
662
|
+
}
|
|
663
|
+
}
|
|
664
|
+
}
|
|
665
|
+
createAssociation(promptId, modelId, priority = 1) {
|
|
666
|
+
const prompt = this.prompts.find(p => p.ID === promptId);
|
|
667
|
+
const model = this.models.find(m => m.ID === modelId);
|
|
668
|
+
if (!prompt || !model)
|
|
669
|
+
return;
|
|
670
|
+
const newAssociation = {
|
|
671
|
+
promptId,
|
|
672
|
+
promptName: prompt.Name,
|
|
673
|
+
modelId,
|
|
674
|
+
modelName: model.Name,
|
|
675
|
+
priority,
|
|
676
|
+
status: 'Active',
|
|
677
|
+
association: null,
|
|
678
|
+
isNew: true,
|
|
679
|
+
isModified: false
|
|
680
|
+
};
|
|
681
|
+
this.associations.push(newAssociation);
|
|
682
|
+
this.buildMatrix();
|
|
683
|
+
this.associationsChange.emit(this.associations);
|
|
684
|
+
}
|
|
685
|
+
updateAssociation(promptId, modelId, updates) {
|
|
686
|
+
const associationIndex = this.associations.findIndex(a => a.promptId === promptId && a.modelId === modelId);
|
|
687
|
+
if (associationIndex >= 0) {
|
|
688
|
+
const association = this.associations[associationIndex];
|
|
689
|
+
Object.assign(association, updates);
|
|
690
|
+
if (!association.isNew) {
|
|
691
|
+
association.isModified = true;
|
|
692
|
+
}
|
|
693
|
+
this.buildMatrix();
|
|
694
|
+
this.associationsChange.emit(this.associations);
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
removeAssociation(promptId, modelId) {
|
|
698
|
+
const associationIndex = this.associations.findIndex(a => a.promptId === promptId && a.modelId === modelId);
|
|
699
|
+
if (associationIndex >= 0) {
|
|
700
|
+
this.associations.splice(associationIndex, 1);
|
|
701
|
+
this.buildMatrix();
|
|
702
|
+
this.associationsChange.emit(this.associations);
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
bulkUpdateSelectedCells() {
|
|
706
|
+
if (this.selectedCells.size === 0)
|
|
707
|
+
return;
|
|
708
|
+
this.selectedCells.forEach(cellKey => {
|
|
709
|
+
const [promptIndex, modelIndex] = cellKey.split('-').map(Number);
|
|
710
|
+
const cell = this.matrix[promptIndex][modelIndex];
|
|
711
|
+
if (cell && cell.canAssign) {
|
|
712
|
+
if (cell.association) {
|
|
713
|
+
this.updateAssociation(cell.promptId, cell.modelId, {
|
|
714
|
+
priority: this.bulkEditPriority,
|
|
715
|
+
status: this.bulkEditStatus
|
|
716
|
+
});
|
|
717
|
+
}
|
|
718
|
+
else {
|
|
719
|
+
this.createAssociation(cell.promptId, cell.modelId, this.bulkEditPriority);
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
});
|
|
723
|
+
this.selectedCells.clear();
|
|
724
|
+
this.bulkEditMode = false;
|
|
725
|
+
}
|
|
726
|
+
bulkRemoveSelectedCells() {
|
|
727
|
+
if (this.selectedCells.size === 0)
|
|
728
|
+
return;
|
|
729
|
+
this.selectedCells.forEach(cellKey => {
|
|
730
|
+
const [promptIndex, modelIndex] = cellKey.split('-').map(Number);
|
|
731
|
+
const cell = this.matrix[promptIndex][modelIndex];
|
|
732
|
+
if (cell && cell.association) {
|
|
733
|
+
this.removeAssociation(cell.promptId, cell.modelId);
|
|
734
|
+
}
|
|
735
|
+
});
|
|
736
|
+
this.selectedCells.clear();
|
|
737
|
+
}
|
|
738
|
+
saveChanges() {
|
|
739
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
740
|
+
try {
|
|
741
|
+
this.isLoading = true;
|
|
742
|
+
this.loadingMessage = 'Saving associations...';
|
|
743
|
+
const md = new Metadata();
|
|
744
|
+
if (!md)
|
|
745
|
+
throw new Error('Metadata provider not available');
|
|
746
|
+
const savePromises = [];
|
|
747
|
+
for (const association of this.associations) {
|
|
748
|
+
if (association.isNew || association.isModified) {
|
|
749
|
+
let entity;
|
|
750
|
+
if (association.association) {
|
|
751
|
+
// Update existing
|
|
752
|
+
entity = yield md.GetEntityObject('MJ: AI Prompt Models', md.CurrentUser);
|
|
753
|
+
yield entity.Load(association.association.ID);
|
|
754
|
+
}
|
|
755
|
+
else {
|
|
756
|
+
// Create new
|
|
757
|
+
entity = yield md.GetEntityObject('MJ: AI Prompt Models', md.CurrentUser);
|
|
758
|
+
}
|
|
759
|
+
entity.PromptID = association.promptId;
|
|
760
|
+
entity.ModelID = association.modelId;
|
|
761
|
+
entity.Priority = association.priority;
|
|
762
|
+
entity.Status = association.status;
|
|
763
|
+
savePromises.push(entity.Save());
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
const results = yield Promise.all(savePromises);
|
|
767
|
+
const failures = results.filter(r => !r).length;
|
|
768
|
+
if (failures === 0) {
|
|
769
|
+
this.notificationService.CreateSimpleNotification('All associations saved successfully', 'success', 3000);
|
|
770
|
+
// Reload data to get fresh state
|
|
771
|
+
yield this.loadData();
|
|
772
|
+
}
|
|
773
|
+
else {
|
|
774
|
+
this.notificationService.CreateSimpleNotification(`${failures} association(s) failed to save`, 'warning', 4000);
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
catch (error) {
|
|
778
|
+
this.error = 'Failed to save associations. Please try again.';
|
|
779
|
+
LogError('Error saving associations', undefined, error);
|
|
780
|
+
this.notificationService.CreateSimpleNotification('Failed to save associations', 'error', 4000);
|
|
781
|
+
}
|
|
782
|
+
finally {
|
|
783
|
+
this.isLoading = false;
|
|
784
|
+
}
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
hasUnsavedChanges() {
|
|
788
|
+
return this.associations.some(a => a.isNew || a.isModified);
|
|
789
|
+
}
|
|
790
|
+
discardChanges() {
|
|
791
|
+
if (!this.hasUnsavedChanges())
|
|
792
|
+
return;
|
|
793
|
+
const confirm = window.confirm('Discard all unsaved changes?');
|
|
794
|
+
if (confirm) {
|
|
795
|
+
this.loadData();
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
getAssociationCount() {
|
|
799
|
+
return this.associations.filter(a => a.status === 'Active').length;
|
|
800
|
+
}
|
|
801
|
+
getModelAssociationCount(modelId) {
|
|
802
|
+
return this.associations.filter(a => a.modelId === modelId && a.status === 'Active').length;
|
|
803
|
+
}
|
|
804
|
+
getPromptAssociationCount(promptId) {
|
|
805
|
+
return this.associations.filter(a => a.promptId === promptId && a.status === 'Active').length;
|
|
806
|
+
}
|
|
807
|
+
getCellTooltip(association) {
|
|
808
|
+
if (!association)
|
|
809
|
+
return 'No association';
|
|
810
|
+
return `Priority: ${association.priority || 'Not set'}`;
|
|
811
|
+
}
|
|
812
|
+
getAveragePriority() {
|
|
813
|
+
const activeAssociations = this.associations.filter(a => a.status === 'Active');
|
|
814
|
+
if (activeAssociations.length === 0)
|
|
815
|
+
return 0;
|
|
816
|
+
const sum = activeAssociations.reduce((total, a) => total + a.priority, 0);
|
|
817
|
+
return Math.round((sum / activeAssociations.length) * 100) / 100;
|
|
818
|
+
}
|
|
819
|
+
sortAssociations() {
|
|
820
|
+
this.associations.sort((a, b) => {
|
|
821
|
+
let comparison = 0;
|
|
822
|
+
switch (this.sortBy) {
|
|
823
|
+
case 'prompt':
|
|
824
|
+
comparison = a.promptName.localeCompare(b.promptName);
|
|
825
|
+
break;
|
|
826
|
+
case 'model':
|
|
827
|
+
comparison = a.modelName.localeCompare(b.modelName);
|
|
828
|
+
break;
|
|
829
|
+
case 'priority':
|
|
830
|
+
comparison = a.priority - b.priority;
|
|
831
|
+
break;
|
|
832
|
+
}
|
|
833
|
+
return this.sortDirection === 'desc' ? -comparison : comparison;
|
|
834
|
+
});
|
|
835
|
+
this.buildMatrix();
|
|
836
|
+
}
|
|
837
|
+
toggleSortDirection() {
|
|
838
|
+
this.sortDirection = this.sortDirection === 'asc' ? 'desc' : 'asc';
|
|
839
|
+
this.sortAssociations();
|
|
840
|
+
}
|
|
841
|
+
onViewModeChange(mode) {
|
|
842
|
+
this.viewMode = mode;
|
|
843
|
+
this.selectedCells.clear();
|
|
844
|
+
this.editingCell = null;
|
|
845
|
+
}
|
|
846
|
+
exportMatrix() {
|
|
847
|
+
const exportData = {
|
|
848
|
+
prompts: this.prompts.map(p => ({ id: p.ID, name: p.Name })),
|
|
849
|
+
models: this.models.map(m => ({ id: m.ID, name: m.Name })),
|
|
850
|
+
associations: this.associations.map(a => ({
|
|
851
|
+
promptId: a.promptId,
|
|
852
|
+
promptName: a.promptName,
|
|
853
|
+
modelId: a.modelId,
|
|
854
|
+
modelName: a.modelName,
|
|
855
|
+
priority: a.priority,
|
|
856
|
+
status: a.status
|
|
857
|
+
})),
|
|
858
|
+
exportDate: new Date().toISOString()
|
|
859
|
+
};
|
|
860
|
+
const blob = new Blob([JSON.stringify(exportData, null, 2)], { type: 'application/json' });
|
|
861
|
+
const url = URL.createObjectURL(blob);
|
|
862
|
+
const a = document.createElement('a');
|
|
863
|
+
a.href = url;
|
|
864
|
+
a.download = `prompt-model-matrix-${new Date().toISOString().split('T')[0]}.json`;
|
|
865
|
+
a.click();
|
|
866
|
+
URL.revokeObjectURL(url);
|
|
867
|
+
}
|
|
868
|
+
selectPrompt(prompt) {
|
|
869
|
+
this.promptSelected.emit(prompt);
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
ModelPromptPriorityMatrixComponent.ɵfac = function ModelPromptPriorityMatrixComponent_Factory(t) { return new (t || ModelPromptPriorityMatrixComponent)(i0.ɵɵdirectiveInject(i1.MJNotificationService)); };
|
|
873
|
+
ModelPromptPriorityMatrixComponent.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: ModelPromptPriorityMatrixComponent, selectors: [["app-model-prompt-priority-matrix"]], inputs: { selectedPrompts: "selectedPrompts", selectedModels: "selectedModels", readonly: "readonly" }, outputs: { associationsChange: "associationsChange", stateChange: "stateChange", promptSelected: "promptSelected" }, decls: 36, vars: 10, consts: [[1, "model-prompt-priority-matrix"], [1, "matrix-toolbar"], [1, "toolbar-section"], [1, "toolbar-title"], [1, "fa-solid", "fa-table-cells"], [1, "view-mode-toggle"], ["role", "group", 1, "btn-group"], ["type", "radio", "name", "viewMode", "id", "matrixView", "value", "matrix", 1, "btn-check", 3, "ngModelChange", "ngModel"], ["for", "matrixView", 1, "btn", "btn-outline-primary", "btn-sm"], ["type", "radio", "name", "viewMode", "id", "listView", "value", "list", 1, "btn-check", 3, "ngModelChange", "ngModel"], ["for", "listView", 1, "btn", "btn-outline-primary", "btn-sm"], [1, "fa-solid", "fa-list"], [1, "matrix-stats"], [1, "stat-item"], [1, "fa-solid", "fa-link", "text-primary"], [1, "fa-solid", "fa-star", "text-warning"], [1, "stat-item", "text-warning"], [1, "bulk-actions"], [1, "action-buttons"], ["type", "button", "title", "Export matrix", 1, "btn", "btn-sm", "btn-outline-info", 3, "click"], [1, "fa-solid", "fa-download"], [1, "bulk-edit-panel"], [1, "loading-container"], [1, "error-container"], [1, "fa-solid", "fa-exclamation-triangle"], ["type", "button", "title", "Bulk edit selected cells", 1, "btn", "btn-sm", "btn-outline-primary", 3, "click"], [1, "fa-solid", "fa-edit"], ["type", "button", "title", "Remove selected associations", 1, "btn", "btn-sm", "btn-outline-danger", 3, "click"], [1, "fa-solid", "fa-trash"], ["type", "button", "title", "Discard changes", 1, "btn", "btn-sm", "btn-outline-secondary", 3, "click"], [1, "fa-solid", "fa-undo"], ["type", "button", "title", "Save changes", 1, "btn", "btn-sm", "btn-success", 3, "click", "disabled"], [1, "fa-solid", "fa-save"], [1, "bulk-edit-controls"], [1, "form-group"], ["for", "bulkPriority", 1, "form-label"], ["type", "number", "id", "bulkPriority", "min", "1", "max", "10", 1, "form-control", "form-control-sm", 3, "ngModelChange", "ngModel"], ["for", "bulkStatus", 1, "form-label"], ["id", "bulkStatus", 1, "form-select", "form-select-sm", 3, "ngModelChange", "ngModel"], ["value", "Active"], ["value", "Inactive"], ["type", "button", "title", "Apply changes to selected cells", 1, "btn", "btn-sm", "btn-primary", 3, "click"], [1, "fa-solid", "fa-check"], ["type", "button", "title", "Cancel bulk edit", 1, "btn", "btn-sm", "btn-outline-secondary", 3, "click"], [1, "fa-solid", "fa-times"], [1, "bulk-edit-info"], [1, "text-muted"], [1, "loading-content"], ["role", "status", 1, "spinner-border", "text-primary"], [1, "visually-hidden"], [1, "loading-message"], [1, "matrix-container"], [1, "list-container"], [1, "matrix-scroll"], [1, "matrix-table"], [1, "prompt-header"], [1, "model-header", 3, "title"], [1, "matrix-row"], [1, "header-content"], [1, "header-name"], [1, "header-stats"], [1, "prompt-header", 3, "click", "title"], [3, "class", "title"], [3, "click", "dblclick", "title"], [1, "cell-content"], [1, "cell-content", "empty"], [1, "status-indicator", "inactive"], [1, "change-indicator", "new"], [1, "change-indicator", "modified"], [1, "performance-overlay"], [1, "fa-solid", "fa-ban"], [1, "fa-solid", "fa-plus"], [1, "empty-cell-indicator"], [1, "blocked-cell-indicator"], [1, "list-header"], [1, "list-controls"], [1, "sort-controls"], [1, "form-label"], [1, "form-select", "form-select-sm", 3, "ngModelChange", "ngModel"], ["value", "prompt"], ["value", "model"], ["value", "priority"], ["type", "button", 1, "btn", "btn-sm", "btn-outline-secondary", 3, "click", "title"], [1, "fa-solid"], [1, "filter-controls"], [1, "form-check", "form-switch"], ["type", "checkbox", "id", "showInactive", 1, "form-check-input", 3, "ngModelChange", "ngModel"], ["for", "showInactive", 1, "form-check-label"], [1, "associations-list"], [1, "no-associations-message"], [1, "association-item", 3, "inactive", "new", "modified"], [1, "association-item"], [1, "association-header"], [1, "association-names"], [1, "prompt-name"], [1, "fa-solid", "fa-arrow-right", "text-muted"], [1, "model-name"], [1, "association-actions"], [1, "association-details"], [1, "detail-item"], [1, "detail-label"], [1, "status-badge"], ["type", "button", "title", "Edit association", 1, "btn", "btn-sm", "btn-outline-primary"], ["type", "button", "title", "Remove association", 1, "btn", "btn-sm", "btn-outline-danger", 3, "click"], [1, "change-badge", "new"], [1, "change-badge", "modified"], [1, "fa-solid", "fa-info-circle", "text-muted"], [1, "text-muted", "mb-0"], ["role", "alert", 1, "alert", "alert-danger"], ["type", "button", 1, "btn", "btn-sm", "btn-outline-danger", "ms-2", 3, "click"], [1, "fa-solid", "fa-refresh"]], template: function ModelPromptPriorityMatrixComponent_Template(rf, ctx) { if (rf & 1) {
|
|
874
|
+
i0.ɵɵelementStart(0, "div", 0)(1, "div", 1)(2, "div", 2)(3, "h5", 3);
|
|
875
|
+
i0.ɵɵelement(4, "i", 4);
|
|
876
|
+
i0.ɵɵtext(5, " Model-Prompt Priority Matrix ");
|
|
877
|
+
i0.ɵɵelementEnd();
|
|
878
|
+
i0.ɵɵelementStart(6, "div", 5)(7, "div", 6)(8, "input", 7);
|
|
879
|
+
i0.ɵɵtwoWayListener("ngModelChange", function ModelPromptPriorityMatrixComponent_Template_input_ngModelChange_8_listener($event) { i0.ɵɵtwoWayBindingSet(ctx.viewMode, $event) || (ctx.viewMode = $event); return $event; });
|
|
880
|
+
i0.ɵɵlistener("ngModelChange", function ModelPromptPriorityMatrixComponent_Template_input_ngModelChange_8_listener($event) { return ctx.onViewModeChange($event); });
|
|
881
|
+
i0.ɵɵelementEnd();
|
|
882
|
+
i0.ɵɵelementStart(9, "label", 8);
|
|
883
|
+
i0.ɵɵelement(10, "i", 4);
|
|
884
|
+
i0.ɵɵtext(11, " Matrix ");
|
|
885
|
+
i0.ɵɵelementEnd();
|
|
886
|
+
i0.ɵɵelementStart(12, "input", 9);
|
|
887
|
+
i0.ɵɵtwoWayListener("ngModelChange", function ModelPromptPriorityMatrixComponent_Template_input_ngModelChange_12_listener($event) { i0.ɵɵtwoWayBindingSet(ctx.viewMode, $event) || (ctx.viewMode = $event); return $event; });
|
|
888
|
+
i0.ɵɵlistener("ngModelChange", function ModelPromptPriorityMatrixComponent_Template_input_ngModelChange_12_listener($event) { return ctx.onViewModeChange($event); });
|
|
889
|
+
i0.ɵɵelementEnd();
|
|
890
|
+
i0.ɵɵelementStart(13, "label", 10);
|
|
891
|
+
i0.ɵɵelement(14, "i", 11);
|
|
892
|
+
i0.ɵɵtext(15, " List ");
|
|
893
|
+
i0.ɵɵelementEnd()()()();
|
|
894
|
+
i0.ɵɵelementStart(16, "div", 2)(17, "div", 12)(18, "span", 13);
|
|
895
|
+
i0.ɵɵelement(19, "i", 14);
|
|
896
|
+
i0.ɵɵtext(20);
|
|
897
|
+
i0.ɵɵelementEnd();
|
|
898
|
+
i0.ɵɵelementStart(21, "span", 13);
|
|
899
|
+
i0.ɵɵelement(22, "i", 15);
|
|
900
|
+
i0.ɵɵtext(23);
|
|
901
|
+
i0.ɵɵelementEnd();
|
|
902
|
+
i0.ɵɵtemplate(24, ModelPromptPriorityMatrixComponent_Conditional_24_Template, 3, 0, "span", 16);
|
|
903
|
+
i0.ɵɵelementEnd()();
|
|
904
|
+
i0.ɵɵelementStart(25, "div", 2);
|
|
905
|
+
i0.ɵɵtemplate(26, ModelPromptPriorityMatrixComponent_Conditional_26_Template, 7, 3, "div", 17);
|
|
906
|
+
i0.ɵɵelementStart(27, "div", 18);
|
|
907
|
+
i0.ɵɵtemplate(28, ModelPromptPriorityMatrixComponent_Conditional_28_Template, 6, 1);
|
|
908
|
+
i0.ɵɵelementStart(29, "button", 19);
|
|
909
|
+
i0.ɵɵlistener("click", function ModelPromptPriorityMatrixComponent_Template_button_click_29_listener() { return ctx.exportMatrix(); });
|
|
910
|
+
i0.ɵɵelement(30, "i", 20);
|
|
911
|
+
i0.ɵɵtext(31, " Export ");
|
|
912
|
+
i0.ɵɵelementEnd()()()();
|
|
913
|
+
i0.ɵɵtemplate(32, ModelPromptPriorityMatrixComponent_Conditional_32_Template, 24, 3, "div", 21)(33, ModelPromptPriorityMatrixComponent_Conditional_33_Template, 7, 1, "div", 22)(34, ModelPromptPriorityMatrixComponent_Conditional_34_Template, 2, 2)(35, ModelPromptPriorityMatrixComponent_Conditional_35_Template, 7, 1, "div", 23);
|
|
914
|
+
i0.ɵɵelementEnd();
|
|
915
|
+
} if (rf & 2) {
|
|
916
|
+
i0.ɵɵadvance(8);
|
|
917
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx.viewMode);
|
|
918
|
+
i0.ɵɵadvance(4);
|
|
919
|
+
i0.ɵɵtwoWayProperty("ngModel", ctx.viewMode);
|
|
920
|
+
i0.ɵɵadvance(8);
|
|
921
|
+
i0.ɵɵtextInterpolate1(" ", ctx.getAssociationCount(), " associations ");
|
|
922
|
+
i0.ɵɵadvance(3);
|
|
923
|
+
i0.ɵɵtextInterpolate1(" ", ctx.getAveragePriority(), " avg priority ");
|
|
924
|
+
i0.ɵɵadvance();
|
|
925
|
+
i0.ɵɵconditional(ctx.hasUnsavedChanges() ? 24 : -1);
|
|
926
|
+
i0.ɵɵadvance(2);
|
|
927
|
+
i0.ɵɵconditional(ctx.selectedCells.size > 0 ? 26 : -1);
|
|
928
|
+
i0.ɵɵadvance(2);
|
|
929
|
+
i0.ɵɵconditional(ctx.hasUnsavedChanges() ? 28 : -1);
|
|
930
|
+
i0.ɵɵadvance(4);
|
|
931
|
+
i0.ɵɵconditional(ctx.bulkEditMode && ctx.selectedCells.size > 0 ? 32 : -1);
|
|
932
|
+
i0.ɵɵadvance();
|
|
933
|
+
i0.ɵɵconditional(ctx.isLoading ? 33 : 34);
|
|
934
|
+
i0.ɵɵadvance(2);
|
|
935
|
+
i0.ɵɵconditional(ctx.error ? 35 : -1);
|
|
936
|
+
} }, dependencies: [i2.NgSelectOption, i2.ɵNgSelectMultipleOption, i2.DefaultValueAccessor, i2.NumberValueAccessor, i2.CheckboxControlValueAccessor, i2.SelectControlValueAccessor, i2.RadioControlValueAccessor, i2.NgControlStatus, i2.MinValidator, i2.MaxValidator, i2.NgModel], styles: [".model-prompt-priority-matrix[_ngcontent-%COMP%] {\n display: flex;\n flex-direction: column;\n height: 100%;\n background: #f8f9fa;\n\n .matrix-toolbar {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 1rem;\n background: white;\n border-bottom: 1px solid #dee2e6;\n flex-shrink: 0;\n gap: 1rem;\n flex-wrap: wrap;\n\n .toolbar-section {\n display: flex;\n align-items: center;\n gap: 1rem;\n\n .toolbar-title {\n margin: 0;\n color: #495057;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n font-weight: 600;\n\n i {\n color: #0d6efd;\n }\n }\n\n .matrix-stats {\n display: flex;\n gap: 1rem;\n\n .stat-item {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n font-size: 0.875rem;\n color: #6c757d;\n\n i {\n font-size: 1rem;\n }\n }\n }\n\n .bulk-actions,\n .action-buttons {\n display: flex;\n gap: 0.5rem;\n\n .btn {\n font-size: 0.875rem;\n }\n }\n }\n }\n\n .bulk-edit-panel {\n padding: 1rem;\n background: #fff3cd;\n border-bottom: 1px solid #ffeaa7;\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-wrap: wrap;\n gap: 1rem;\n\n .bulk-edit-controls {\n display: flex;\n align-items: center;\n gap: 1rem;\n\n .form-group {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n\n .form-label {\n margin: 0;\n font-size: 0.875rem;\n font-weight: 500;\n white-space: nowrap;\n }\n\n .form-control,\n .form-select {\n min-width: 100px;\n }\n }\n }\n\n .bulk-edit-info {\n font-size: 0.875rem;\n color: #856404;\n }\n }\n\n .loading-container {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n\n .loading-content {\n text-align: center;\n \n .loading-message {\n margin-top: 1rem;\n color: #6c757d;\n }\n }\n }\n\n .matrix-container {\n flex: 1;\n overflow: hidden;\n\n .matrix-scroll {\n height: 100%;\n overflow: auto;\n padding: 1rem;\n\n .matrix-table {\n border-collapse: separate;\n border-spacing: 2px;\n background: white;\n border-radius: 0.5rem;\n overflow: hidden;\n\n .prompt-header,\n .model-header {\n background: #f8f9fa;\n border: 1px solid #dee2e6;\n padding: 0.75rem;\n font-weight: 600;\n text-align: center;\n position: sticky;\n top: 0;\n z-index: 10;\n\n .header-content {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n\n .header-name {\n font-size: 0.875rem;\n font-weight: 600;\n }\n\n .header-stats {\n font-size: 0.75rem;\n color: #6c757d;\n }\n }\n }\n\n .prompt-header {\n min-width: 200px;\n position: sticky;\n left: 0;\n z-index: 11;\n }\n\n .matrix-cell {\n width: 80px;\n height: 60px;\n border: 2px solid #e9ecef;\n text-align: center;\n cursor: pointer;\n transition: all 0.2s ease;\n position: relative;\n\n &:hover {\n border-color: #007bff;\n transform: scale(1.05);\n }\n\n &.selected {\n border-color: #007bff;\n background: rgba(0, 123, 255, 0.1);\n }\n\n &.editing {\n border-color: #28a745;\n background: rgba(40, 167, 69, 0.1);\n }\n\n &.no-association {\n background: #f8f9fa;\n border-style: dashed;\n\n .empty-cell-indicator {\n color: #6c757d;\n font-size: 1.5rem;\n opacity: 0.5;\n }\n }\n\n &.cannot-assign {\n background: #f5f5f5;\n cursor: not-allowed;\n opacity: 0.5;\n\n .blocked-cell-indicator {\n color: #dc3545;\n font-size: 1.25rem;\n }\n }\n\n &.has-association {\n background: white;\n\n &.priority-1 { border-color: #28a745; }\n &.priority-2 { border-color: #20c997; }\n &.priority-3 { border-color: #ffc107; }\n &.priority-4 { border-color: #fd7e14; }\n &.priority-5 { border-color: #dc3545; }\n\n &.inactive {\n opacity: 0.6;\n background: #f8f9fa;\n }\n\n &.new {\n box-shadow: 0 0 0 2px #28a745;\n }\n\n &.modified {\n box-shadow: 0 0 0 2px #ffc107;\n }\n }\n\n .cell-content {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n height: 100%;\n gap: 0.25rem;\n\n .priority-badge {\n background: #007bff;\n color: white;\n border-radius: 50%;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 0.75rem;\n font-weight: 600;\n\n &.priority-1 { background: #28a745; }\n &.priority-2 { background: #20c997; }\n &.priority-3 { background: #ffc107; color: #212529; }\n &.priority-4 { background: #fd7e14; }\n &.priority-5 { background: #dc3545; }\n }\n\n .status-indicator {\n font-size: 0.75rem;\n\n &.inactive {\n color: #dc3545;\n }\n }\n\n .change-indicator {\n position: absolute;\n top: 2px;\n right: 2px;\n width: 12px;\n height: 12px;\n border-radius: 50%;\n font-size: 0.625rem;\n display: flex;\n align-items: center;\n justify-content: center;\n\n &.new {\n background: #28a745;\n color: white;\n }\n\n &.modified {\n background: #ffc107;\n color: #212529;\n }\n }\n\n .performance-overlay {\n position: absolute;\n bottom: 2px;\n left: 2px;\n right: 2px;\n background: rgba(0, 0, 0, 0.8);\n color: white;\n border-radius: 0.25rem;\n padding: 0.125rem;\n font-size: 0.625rem;\n }\n }\n }\n }\n }\n }\n\n .list-container {\n flex: 1;\n padding: 1rem;\n overflow-y: auto;\n\n .list-header {\n margin-bottom: 1.5rem;\n background: white;\n border: 1px solid #dee2e6;\n border-radius: 0.5rem;\n padding: 1rem;\n\n .list-controls {\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-wrap: wrap;\n gap: 1rem;\n\n .sort-controls,\n .filter-controls {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n\n .form-label {\n margin: 0;\n font-size: 0.875rem;\n color: #6c757d;\n white-space: nowrap;\n }\n\n .form-select {\n min-width: 120px;\n }\n\n .form-check {\n margin: 0;\n }\n }\n }\n }\n\n .associations-list {\n .association-item {\n background: white;\n border: 1px solid #dee2e6;\n border-radius: 0.5rem;\n padding: 1rem;\n margin-bottom: 1rem;\n transition: all 0.2s ease;\n\n &:hover {\n box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);\n transform: translateY(-1px);\n }\n\n &.inactive {\n opacity: 0.7;\n background: #f8f9fa;\n }\n\n &.new {\n border-color: #28a745;\n border-left-width: 4px;\n }\n\n &.modified {\n border-color: #ffc107;\n border-left-width: 4px;\n }\n\n .association-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 0.75rem;\n\n .association-names {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n\n .prompt-name,\n .model-name {\n color: #495057;\n font-weight: 500;\n }\n\n i {\n color: #6c757d;\n }\n }\n\n .association-actions {\n display: flex;\n gap: 0.5rem;\n\n .btn {\n padding: 0.25rem 0.5rem;\n font-size: 0.75rem;\n }\n }\n }\n\n .association-details {\n display: flex;\n align-items: center;\n gap: 1rem;\n flex-wrap: wrap;\n\n .detail-item {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n\n .detail-label {\n font-size: 0.875rem;\n color: #6c757d;\n }\n\n .priority-badge {\n background: #007bff;\n color: white;\n padding: 0.25rem 0.5rem;\n border-radius: 0.25rem;\n font-size: 0.75rem;\n font-weight: 600;\n\n &.priority-1 { background: #28a745; }\n &.priority-2 { background: #20c997; }\n &.priority-3 { background: #ffc107; color: #212529; }\n &.priority-4 { background: #fd7e14; }\n &.priority-5 { background: #dc3545; }\n }\n\n .status-badge {\n padding: 0.25rem 0.5rem;\n border-radius: 0.25rem;\n font-size: 0.75rem;\n font-weight: 500;\n\n &.badge-success {\n background: #d4edda;\n color: #155724;\n }\n\n &.badge-secondary {\n background: #e2e3e5;\n color: #383d41;\n }\n }\n\n .change-badge {\n padding: 0.25rem 0.5rem;\n border-radius: 0.25rem;\n font-size: 0.75rem;\n font-weight: 500;\n display: flex;\n align-items: center;\n gap: 0.25rem;\n\n &.new {\n background: #d4edda;\n color: #155724;\n }\n\n &.modified {\n background: #fff3cd;\n color: #856404;\n }\n }\n }\n }\n }\n\n .no-associations-message {\n text-align: center;\n padding: 3rem 1rem;\n color: #6c757d;\n\n i {\n font-size: 3rem;\n margin-bottom: 1rem;\n display: block;\n opacity: 0.5;\n }\n\n p {\n margin: 0;\n font-size: 1rem;\n line-height: 1.5;\n }\n }\n }\n }\n\n .error-container {\n padding: 1rem;\n\n .alert {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n }\n}\n\n//[_ngcontent-%COMP%] Responsive[_ngcontent-%COMP%] adjustments\n@media[_ngcontent-%COMP%] (max-width[_ngcontent-%COMP%]: 1200px)[_ngcontent-%COMP%] {\n .model-prompt-priority-matrix {\n .matrix-toolbar {\n .toolbar-section {\n min-width: 100%;\n justify-content: space-between;\n }\n }\n\n .matrix-container {\n .matrix-scroll {\n .matrix-table {\n .matrix-cell {\n width: 60px;\n height: 50px;\n }\n }\n }\n }\n }\n}\n\n@media (max-width: 768px) {\n .model-prompt-priority-matrix[_ngcontent-%COMP%] {\n .matrix-toolbar {\n padding: 0.75rem;\n \n .toolbar-section {\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n }\n\n .bulk-edit-panel {\n padding: 0.75rem;\n\n .bulk-edit-controls {\n flex-direction: column;\n align-items: stretch;\n gap: 0.75rem;\n }\n }\n\n .matrix-container {\n .matrix-scroll {\n padding: 0.75rem;\n\n .matrix-table {\n .matrix-cell {\n width: 50px;\n height: 40px;\n }\n }\n }\n }\n\n .list-container {\n padding: 0.75rem;\n\n .list-header {\n .list-controls {\n flex-direction: column;\n align-items: stretch;\n }\n }\n\n .associations-list {\n .association-item {\n .association-header {\n flex-direction: column;\n align-items: flex-start;\n gap: 0.75rem;\n }\n\n .association-details {\n flex-direction: column;\n align-items: flex-start;\n }\n }\n }\n }\n }\n}"] });
|
|
937
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ModelPromptPriorityMatrixComponent, [{
|
|
938
|
+
type: Component,
|
|
939
|
+
args: [{ selector: 'app-model-prompt-priority-matrix', template: "<div class=\"model-prompt-priority-matrix\">\n <!-- Header toolbar -->\n <div class=\"matrix-toolbar\">\n <div class=\"toolbar-section\">\n <h5 class=\"toolbar-title\">\n <i class=\"fa-solid fa-table-cells\"></i>\n Model-Prompt Priority Matrix\n </h5>\n \n <div class=\"view-mode-toggle\">\n <div class=\"btn-group\" role=\"group\">\n <input \n type=\"radio\" \n class=\"btn-check\" \n name=\"viewMode\" \n id=\"matrixView\" \n value=\"matrix\"\n [(ngModel)]=\"viewMode\"\n (ngModelChange)=\"onViewModeChange($event)\">\n <label class=\"btn btn-outline-primary btn-sm\" for=\"matrixView\">\n <i class=\"fa-solid fa-table-cells\"></i>\n Matrix\n </label>\n \n <input \n type=\"radio\" \n class=\"btn-check\" \n name=\"viewMode\" \n id=\"listView\" \n value=\"list\"\n [(ngModel)]=\"viewMode\"\n (ngModelChange)=\"onViewModeChange($event)\">\n <label class=\"btn btn-outline-primary btn-sm\" for=\"listView\">\n <i class=\"fa-solid fa-list\"></i>\n List\n </label>\n </div>\n </div>\n </div>\n \n <div class=\"toolbar-section\">\n <div class=\"matrix-stats\">\n <span class=\"stat-item\">\n <i class=\"fa-solid fa-link text-primary\"></i>\n {{ getAssociationCount() }} associations\n </span>\n <span class=\"stat-item\">\n <i class=\"fa-solid fa-star text-warning\"></i>\n {{ getAveragePriority() }} avg priority\n </span>\n @if (hasUnsavedChanges()) {\n <span class=\"stat-item text-warning\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n Unsaved changes\n </span>\n }\n </div>\n </div>\n \n <div class=\"toolbar-section\">\n @if (selectedCells.size > 0) {\n <div class=\"bulk-actions\">\n <button \n type=\"button\" \n class=\"btn btn-sm btn-outline-primary\"\n [class.active]=\"bulkEditMode\"\n (click)=\"bulkEditMode = !bulkEditMode\"\n title=\"Bulk edit selected cells\">\n <i class=\"fa-solid fa-edit\"></i>\n Edit ({{ selectedCells.size }})\n </button>\n \n <button \n type=\"button\" \n class=\"btn btn-sm btn-outline-danger\"\n (click)=\"bulkRemoveSelectedCells()\"\n title=\"Remove selected associations\">\n <i class=\"fa-solid fa-trash\"></i>\n Remove\n </button>\n </div>\n }\n \n <div class=\"action-buttons\">\n @if (hasUnsavedChanges()) {\n <button \n type=\"button\" \n class=\"btn btn-sm btn-outline-secondary\"\n (click)=\"discardChanges()\"\n title=\"Discard changes\">\n <i class=\"fa-solid fa-undo\"></i>\n Discard\n </button>\n \n <button \n type=\"button\" \n class=\"btn btn-sm btn-success\"\n (click)=\"saveChanges()\"\n [disabled]=\"isLoading\"\n title=\"Save changes\">\n <i class=\"fa-solid fa-save\"></i>\n Save\n </button>\n }\n \n <button \n type=\"button\" \n class=\"btn btn-sm btn-outline-info\"\n (click)=\"exportMatrix()\"\n title=\"Export matrix\">\n <i class=\"fa-solid fa-download\"></i>\n Export\n </button>\n </div>\n </div>\n </div>\n \n <!-- Bulk edit panel -->\n @if (bulkEditMode && selectedCells.size > 0) {\n <div class=\"bulk-edit-panel\">\n <div class=\"bulk-edit-controls\">\n <div class=\"form-group\">\n <label for=\"bulkPriority\" class=\"form-label\">Priority:</label>\n <input \n type=\"number\" \n id=\"bulkPriority\"\n class=\"form-control form-control-sm\"\n [(ngModel)]=\"bulkEditPriority\"\n min=\"1\"\n max=\"10\">\n </div>\n \n <div class=\"form-group\">\n <label for=\"bulkStatus\" class=\"form-label\">Status:</label>\n <select \n id=\"bulkStatus\"\n class=\"form-select form-select-sm\"\n [(ngModel)]=\"bulkEditStatus\">\n <option value=\"Active\">Active</option>\n <option value=\"Inactive\">Inactive</option>\n </select>\n </div>\n \n <div class=\"form-group\">\n <button \n type=\"button\" \n class=\"btn btn-sm btn-primary\"\n (click)=\"bulkUpdateSelectedCells()\"\n title=\"Apply changes to selected cells\">\n <i class=\"fa-solid fa-check\"></i>\n Apply\n </button>\n \n <button \n type=\"button\" \n class=\"btn btn-sm btn-outline-secondary\"\n (click)=\"bulkEditMode = false\"\n title=\"Cancel bulk edit\">\n <i class=\"fa-solid fa-times\"></i>\n Cancel\n </button>\n </div>\n </div>\n \n <div class=\"bulk-edit-info\">\n <small class=\"text-muted\">\n Editing {{ selectedCells.size }} selected cell(s). \n Use Ctrl+Click for multi-select, Shift+Click for range select.\n </small>\n </div>\n </div>\n }\n \n <!-- Loading state -->\n @if (isLoading) {\n <div class=\"loading-container\">\n <div class=\"loading-content\">\n <div class=\"spinner-border text-primary\" role=\"status\">\n <span class=\"visually-hidden\">Loading...</span>\n </div>\n <p class=\"loading-message\">{{ loadingMessage }}</p>\n </div>\n </div>\n } @else {\n <!-- Matrix view -->\n @if (viewMode === 'matrix') {\n <div class=\"matrix-container\">\n <div class=\"matrix-scroll\">\n <table class=\"matrix-table\">\n <!-- Header row with model names -->\n <thead>\n <tr>\n <th class=\"prompt-header\">Prompts \\\\ Models</th>\n @for (model of models; track model.ID) {\n <th class=\"model-header\" [title]=\"model.Description || model.Name\">\n <div class=\"header-content\">\n <div class=\"header-name\">{{ model.Name }}</div>\n <div class=\"header-stats\">\n <small class=\"text-muted\">{{ getModelAssociationCount(model.ID) }}</small>\n </div>\n </div>\n </th>\n }\n </tr>\n </thead>\n \n <!-- Matrix body -->\n <tbody>\n @for (prompt of prompts; track prompt.ID; let promptIndex = $index) {\n <tr class=\"matrix-row\">\n <th class=\"prompt-header\" [title]=\"prompt.Description || prompt.Name\" (click)=\"selectPrompt(prompt)\">\n <div class=\"header-content\">\n <div class=\"header-name\">{{ prompt.Name }}</div>\n <div class=\"header-stats\">\n <small class=\"text-muted\">{{ getPromptAssociationCount(prompt.ID) }}</small>\n </div>\n </div>\n </th>\n \n @for (model of models; track model.ID; let modelIndex = $index) {\n <td \n [class]=\"getCellClass(matrix[promptIndex][modelIndex])\"\n (click)=\"onCellClick(promptIndex, modelIndex, $event)\"\n (dblclick)=\"onCellDoubleClick(promptIndex, modelIndex)\"\n [title]=\"getCellTooltip(matrix[promptIndex][modelIndex])\">\n \n @if (matrix[promptIndex][modelIndex].association; as assoc) {\n <div class=\"cell-content\">\n <div class=\"priority-badge priority-{{ assoc.priority }}\">\n {{ assoc.priority }}\n </div>\n \n @if (assoc.status === 'Inactive') {\n <div class=\"status-indicator inactive\">\n <i class=\"fa-solid fa-ban\"></i>\n </div>\n }\n \n @if (assoc.isNew) {\n <div class=\"change-indicator new\">\n <i class=\"fa-solid fa-plus\"></i>\n </div>\n } @else if (assoc.isModified) {\n <div class=\"change-indicator modified\">\n <i class=\"fa-solid fa-edit\"></i>\n </div>\n }\n \n @if (showPerformanceOverlay && performanceData[assoc.promptId + '_' + assoc.modelId]) {\n <div class=\"performance-overlay\">\n <small>{{ performanceData[assoc.promptId + '_' + assoc.modelId].avgResponseTime }}ms</small>\n </div>\n }\n </div>\n } @else {\n <div class=\"cell-content empty\">\n @if (matrix[promptIndex][modelIndex].canAssign) {\n <div class=\"empty-cell-indicator\">\n <i class=\"fa-solid fa-plus\"></i>\n </div>\n } @else {\n <div class=\"blocked-cell-indicator\">\n <i class=\"fa-solid fa-ban\"></i>\n </div>\n }\n </div>\n }\n </td>\n }\n </tr>\n }\n </tbody>\n </table>\n </div>\n </div>\n }\n \n <!-- List view -->\n @if (viewMode === 'list') {\n <div class=\"list-container\">\n <div class=\"list-header\">\n <div class=\"list-controls\">\n <div class=\"sort-controls\">\n <label class=\"form-label\">Sort by:</label>\n <select \n class=\"form-select form-select-sm\"\n [(ngModel)]=\"sortBy\"\n (ngModelChange)=\"sortAssociations()\">\n <option value=\"prompt\">Prompt Name</option>\n <option value=\"model\">Model Name</option>\n <option value=\"priority\">Priority</option>\n </select>\n \n <button \n type=\"button\" \n class=\"btn btn-sm btn-outline-secondary\"\n (click)=\"toggleSortDirection()\"\n [title]=\"'Sort ' + (sortDirection === 'asc' ? 'descending' : 'ascending')\">\n <i class=\"fa-solid\" [class.fa-sort-up]=\"sortDirection === 'asc'\" [class.fa-sort-down]=\"sortDirection === 'desc'\"></i>\n </button>\n </div>\n \n <div class=\"filter-controls\">\n <div class=\"form-check form-switch\">\n <input \n class=\"form-check-input\" \n type=\"checkbox\" \n id=\"showInactive\"\n [(ngModel)]=\"showInactiveAssociations\">\n <label class=\"form-check-label\" for=\"showInactive\">\n Show inactive\n </label>\n </div>\n </div>\n </div>\n </div>\n \n <div class=\"associations-list\">\n @for (association of associations; track association.promptId + '_' + association.modelId) {\n @if (showInactiveAssociations || association.status === 'Active') {\n <div class=\"association-item\" \n [class.inactive]=\"association.status === 'Inactive'\"\n [class.new]=\"association.isNew\"\n [class.modified]=\"association.isModified\">\n \n <div class=\"association-header\">\n <div class=\"association-names\">\n <strong class=\"prompt-name\">{{ association.promptName }}</strong>\n <i class=\"fa-solid fa-arrow-right text-muted\"></i>\n <strong class=\"model-name\">{{ association.modelName }}</strong>\n </div>\n \n <div class=\"association-actions\">\n @if (!readonly) {\n <button \n type=\"button\" \n class=\"btn btn-sm btn-outline-primary\"\n title=\"Edit association\">\n <i class=\"fa-solid fa-edit\"></i>\n </button>\n \n <button \n type=\"button\" \n class=\"btn btn-sm btn-outline-danger\"\n (click)=\"removeAssociation(association.promptId, association.modelId)\"\n title=\"Remove association\">\n <i class=\"fa-solid fa-trash\"></i>\n </button>\n }\n </div>\n </div>\n \n <div class=\"association-details\">\n <div class=\"detail-item\">\n <span class=\"detail-label\">Priority:</span>\n <span class=\"priority-badge priority-{{ association.priority }}\">\n {{ association.priority }}\n </span>\n </div>\n \n <div class=\"detail-item\">\n <span class=\"detail-label\">Status:</span>\n <span class=\"status-badge\" [class.badge-success]=\"association.status === 'Active'\" [class.badge-secondary]=\"association.status === 'Inactive'\">\n {{ association.status }}\n </span>\n </div>\n \n @if (association.isNew) {\n <div class=\"detail-item\">\n <span class=\"change-badge new\">\n <i class=\"fa-solid fa-plus\"></i>\n New\n </span>\n </div>\n } @else if (association.isModified) {\n <div class=\"detail-item\">\n <span class=\"change-badge modified\">\n <i class=\"fa-solid fa-edit\"></i>\n Modified\n </span>\n </div>\n }\n </div>\n </div>\n }\n }\n \n @if (associations.length === 0) {\n <div class=\"no-associations-message\">\n <i class=\"fa-solid fa-info-circle text-muted\"></i>\n <p class=\"text-muted mb-0\">No prompt-model associations found. Click on matrix cells to create associations.</p>\n </div>\n }\n </div>\n </div>\n }\n }\n \n <!-- Error state -->\n @if (error) {\n <div class=\"error-container\">\n <div class=\"alert alert-danger\" role=\"alert\">\n <i class=\"fa-solid fa-exclamation-triangle\"></i>\n {{ error }}\n <button \n type=\"button\" \n class=\"btn btn-sm btn-outline-danger ms-2\"\n (click)=\"loadData()\">\n <i class=\"fa-solid fa-refresh\"></i>\n Retry\n </button>\n </div>\n </div>\n }\n</div>", styles: [".model-prompt-priority-matrix {\n display: flex;\n flex-direction: column;\n height: 100%;\n background: #f8f9fa;\n\n .matrix-toolbar {\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: 1rem;\n background: white;\n border-bottom: 1px solid #dee2e6;\n flex-shrink: 0;\n gap: 1rem;\n flex-wrap: wrap;\n\n .toolbar-section {\n display: flex;\n align-items: center;\n gap: 1rem;\n\n .toolbar-title {\n margin: 0;\n color: #495057;\n display: flex;\n align-items: center;\n gap: 0.5rem;\n font-weight: 600;\n\n i {\n color: #0d6efd;\n }\n }\n\n .matrix-stats {\n display: flex;\n gap: 1rem;\n\n .stat-item {\n display: flex;\n align-items: center;\n gap: 0.25rem;\n font-size: 0.875rem;\n color: #6c757d;\n\n i {\n font-size: 1rem;\n }\n }\n }\n\n .bulk-actions,\n .action-buttons {\n display: flex;\n gap: 0.5rem;\n\n .btn {\n font-size: 0.875rem;\n }\n }\n }\n }\n\n .bulk-edit-panel {\n padding: 1rem;\n background: #fff3cd;\n border-bottom: 1px solid #ffeaa7;\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-wrap: wrap;\n gap: 1rem;\n\n .bulk-edit-controls {\n display: flex;\n align-items: center;\n gap: 1rem;\n\n .form-group {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n\n .form-label {\n margin: 0;\n font-size: 0.875rem;\n font-weight: 500;\n white-space: nowrap;\n }\n\n .form-control,\n .form-select {\n min-width: 100px;\n }\n }\n }\n\n .bulk-edit-info {\n font-size: 0.875rem;\n color: #856404;\n }\n }\n\n .loading-container {\n flex: 1;\n display: flex;\n align-items: center;\n justify-content: center;\n\n .loading-content {\n text-align: center;\n \n .loading-message {\n margin-top: 1rem;\n color: #6c757d;\n }\n }\n }\n\n .matrix-container {\n flex: 1;\n overflow: hidden;\n\n .matrix-scroll {\n height: 100%;\n overflow: auto;\n padding: 1rem;\n\n .matrix-table {\n border-collapse: separate;\n border-spacing: 2px;\n background: white;\n border-radius: 0.5rem;\n overflow: hidden;\n\n .prompt-header,\n .model-header {\n background: #f8f9fa;\n border: 1px solid #dee2e6;\n padding: 0.75rem;\n font-weight: 600;\n text-align: center;\n position: sticky;\n top: 0;\n z-index: 10;\n\n .header-content {\n display: flex;\n flex-direction: column;\n gap: 0.25rem;\n\n .header-name {\n font-size: 0.875rem;\n font-weight: 600;\n }\n\n .header-stats {\n font-size: 0.75rem;\n color: #6c757d;\n }\n }\n }\n\n .prompt-header {\n min-width: 200px;\n position: sticky;\n left: 0;\n z-index: 11;\n }\n\n .matrix-cell {\n width: 80px;\n height: 60px;\n border: 2px solid #e9ecef;\n text-align: center;\n cursor: pointer;\n transition: all 0.2s ease;\n position: relative;\n\n &:hover {\n border-color: #007bff;\n transform: scale(1.05);\n }\n\n &.selected {\n border-color: #007bff;\n background: rgba(0, 123, 255, 0.1);\n }\n\n &.editing {\n border-color: #28a745;\n background: rgba(40, 167, 69, 0.1);\n }\n\n &.no-association {\n background: #f8f9fa;\n border-style: dashed;\n\n .empty-cell-indicator {\n color: #6c757d;\n font-size: 1.5rem;\n opacity: 0.5;\n }\n }\n\n &.cannot-assign {\n background: #f5f5f5;\n cursor: not-allowed;\n opacity: 0.5;\n\n .blocked-cell-indicator {\n color: #dc3545;\n font-size: 1.25rem;\n }\n }\n\n &.has-association {\n background: white;\n\n &.priority-1 { border-color: #28a745; }\n &.priority-2 { border-color: #20c997; }\n &.priority-3 { border-color: #ffc107; }\n &.priority-4 { border-color: #fd7e14; }\n &.priority-5 { border-color: #dc3545; }\n\n &.inactive {\n opacity: 0.6;\n background: #f8f9fa;\n }\n\n &.new {\n box-shadow: 0 0 0 2px #28a745;\n }\n\n &.modified {\n box-shadow: 0 0 0 2px #ffc107;\n }\n }\n\n .cell-content {\n display: flex;\n flex-direction: column;\n justify-content: center;\n align-items: center;\n height: 100%;\n gap: 0.25rem;\n\n .priority-badge {\n background: #007bff;\n color: white;\n border-radius: 50%;\n width: 24px;\n height: 24px;\n display: flex;\n align-items: center;\n justify-content: center;\n font-size: 0.75rem;\n font-weight: 600;\n\n &.priority-1 { background: #28a745; }\n &.priority-2 { background: #20c997; }\n &.priority-3 { background: #ffc107; color: #212529; }\n &.priority-4 { background: #fd7e14; }\n &.priority-5 { background: #dc3545; }\n }\n\n .status-indicator {\n font-size: 0.75rem;\n\n &.inactive {\n color: #dc3545;\n }\n }\n\n .change-indicator {\n position: absolute;\n top: 2px;\n right: 2px;\n width: 12px;\n height: 12px;\n border-radius: 50%;\n font-size: 0.625rem;\n display: flex;\n align-items: center;\n justify-content: center;\n\n &.new {\n background: #28a745;\n color: white;\n }\n\n &.modified {\n background: #ffc107;\n color: #212529;\n }\n }\n\n .performance-overlay {\n position: absolute;\n bottom: 2px;\n left: 2px;\n right: 2px;\n background: rgba(0, 0, 0, 0.8);\n color: white;\n border-radius: 0.25rem;\n padding: 0.125rem;\n font-size: 0.625rem;\n }\n }\n }\n }\n }\n }\n\n .list-container {\n flex: 1;\n padding: 1rem;\n overflow-y: auto;\n\n .list-header {\n margin-bottom: 1.5rem;\n background: white;\n border: 1px solid #dee2e6;\n border-radius: 0.5rem;\n padding: 1rem;\n\n .list-controls {\n display: flex;\n justify-content: space-between;\n align-items: center;\n flex-wrap: wrap;\n gap: 1rem;\n\n .sort-controls,\n .filter-controls {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n\n .form-label {\n margin: 0;\n font-size: 0.875rem;\n color: #6c757d;\n white-space: nowrap;\n }\n\n .form-select {\n min-width: 120px;\n }\n\n .form-check {\n margin: 0;\n }\n }\n }\n }\n\n .associations-list {\n .association-item {\n background: white;\n border: 1px solid #dee2e6;\n border-radius: 0.5rem;\n padding: 1rem;\n margin-bottom: 1rem;\n transition: all 0.2s ease;\n\n &:hover {\n box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);\n transform: translateY(-1px);\n }\n\n &.inactive {\n opacity: 0.7;\n background: #f8f9fa;\n }\n\n &.new {\n border-color: #28a745;\n border-left-width: 4px;\n }\n\n &.modified {\n border-color: #ffc107;\n border-left-width: 4px;\n }\n\n .association-header {\n display: flex;\n justify-content: space-between;\n align-items: center;\n margin-bottom: 0.75rem;\n\n .association-names {\n display: flex;\n align-items: center;\n gap: 0.75rem;\n\n .prompt-name,\n .model-name {\n color: #495057;\n font-weight: 500;\n }\n\n i {\n color: #6c757d;\n }\n }\n\n .association-actions {\n display: flex;\n gap: 0.5rem;\n\n .btn {\n padding: 0.25rem 0.5rem;\n font-size: 0.75rem;\n }\n }\n }\n\n .association-details {\n display: flex;\n align-items: center;\n gap: 1rem;\n flex-wrap: wrap;\n\n .detail-item {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n\n .detail-label {\n font-size: 0.875rem;\n color: #6c757d;\n }\n\n .priority-badge {\n background: #007bff;\n color: white;\n padding: 0.25rem 0.5rem;\n border-radius: 0.25rem;\n font-size: 0.75rem;\n font-weight: 600;\n\n &.priority-1 { background: #28a745; }\n &.priority-2 { background: #20c997; }\n &.priority-3 { background: #ffc107; color: #212529; }\n &.priority-4 { background: #fd7e14; }\n &.priority-5 { background: #dc3545; }\n }\n\n .status-badge {\n padding: 0.25rem 0.5rem;\n border-radius: 0.25rem;\n font-size: 0.75rem;\n font-weight: 500;\n\n &.badge-success {\n background: #d4edda;\n color: #155724;\n }\n\n &.badge-secondary {\n background: #e2e3e5;\n color: #383d41;\n }\n }\n\n .change-badge {\n padding: 0.25rem 0.5rem;\n border-radius: 0.25rem;\n font-size: 0.75rem;\n font-weight: 500;\n display: flex;\n align-items: center;\n gap: 0.25rem;\n\n &.new {\n background: #d4edda;\n color: #155724;\n }\n\n &.modified {\n background: #fff3cd;\n color: #856404;\n }\n }\n }\n }\n }\n\n .no-associations-message {\n text-align: center;\n padding: 3rem 1rem;\n color: #6c757d;\n\n i {\n font-size: 3rem;\n margin-bottom: 1rem;\n display: block;\n opacity: 0.5;\n }\n\n p {\n margin: 0;\n font-size: 1rem;\n line-height: 1.5;\n }\n }\n }\n }\n\n .error-container {\n padding: 1rem;\n\n .alert {\n display: flex;\n align-items: center;\n gap: 0.5rem;\n }\n }\n}\n\n// Responsive adjustments\n@media (max-width: 1200px) {\n .model-prompt-priority-matrix {\n .matrix-toolbar {\n .toolbar-section {\n min-width: 100%;\n justify-content: space-between;\n }\n }\n\n .matrix-container {\n .matrix-scroll {\n .matrix-table {\n .matrix-cell {\n width: 60px;\n height: 50px;\n }\n }\n }\n }\n }\n}\n\n@media (max-width: 768px) {\n .model-prompt-priority-matrix {\n .matrix-toolbar {\n padding: 0.75rem;\n \n .toolbar-section {\n flex-wrap: wrap;\n gap: 0.5rem;\n }\n }\n\n .bulk-edit-panel {\n padding: 0.75rem;\n\n .bulk-edit-controls {\n flex-direction: column;\n align-items: stretch;\n gap: 0.75rem;\n }\n }\n\n .matrix-container {\n .matrix-scroll {\n padding: 0.75rem;\n\n .matrix-table {\n .matrix-cell {\n width: 50px;\n height: 40px;\n }\n }\n }\n }\n\n .list-container {\n padding: 0.75rem;\n\n .list-header {\n .list-controls {\n flex-direction: column;\n align-items: stretch;\n }\n }\n\n .associations-list {\n .association-item {\n .association-header {\n flex-direction: column;\n align-items: flex-start;\n gap: 0.75rem;\n }\n\n .association-details {\n flex-direction: column;\n align-items: flex-start;\n }\n }\n }\n }\n }\n}"] }]
|
|
940
|
+
}], () => [{ type: i1.MJNotificationService }], { selectedPrompts: [{
|
|
941
|
+
type: Input
|
|
942
|
+
}], selectedModels: [{
|
|
943
|
+
type: Input
|
|
944
|
+
}], readonly: [{
|
|
945
|
+
type: Input
|
|
946
|
+
}], associationsChange: [{
|
|
947
|
+
type: Output
|
|
948
|
+
}], stateChange: [{
|
|
949
|
+
type: Output
|
|
950
|
+
}], promptSelected: [{
|
|
951
|
+
type: Output
|
|
952
|
+
}] }); })();
|
|
953
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(ModelPromptPriorityMatrixComponent, { className: "ModelPromptPriorityMatrixComponent", filePath: "src/AI/components/prompts/model-prompt-priority-matrix.component.ts", lineNumber: 32 }); })();
|
|
954
|
+
//# sourceMappingURL=model-prompt-priority-matrix.component.js.map
|