odant-work 1.0.93 → 1.0.94

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.
Files changed (81) hide show
  1. package/#system/package-manifest.json +620 -651
  2. package/$server/$folder/$class/$ai/class.js +1 -0
  3. package/$server/$folder/$class/$ai/handlers/pages/form/system/ai/$handler/class.js +4 -1
  4. package/$server/$folder/$class/$data/$catalog/$virtual/class.js +1 -0
  5. package/$server/$folder/$class/$data/$catalog/class.js +1 -0
  6. package/$server/$folder/$class/$data/$operation/class.js +1 -0
  7. package/$server/$folder/$class/$data/$register/$account/class.js +1 -0
  8. package/$server/$folder/$class/$data/$register/class.js +1 -0
  9. package/$server/$folder/$class/$data/$struct/class.js +1 -0
  10. package/$server/$folder/$class/$domain/class.js +1 -0
  11. package/$server/$folder/$class/$module/$mcp/class.js +1 -0
  12. package/$server/$folder/$class/$module/$provider/class.js +1 -0
  13. package/$server/$folder/$class/$module/$provider/handlers/pages/form/system/ai/$handler/class.js +38 -6
  14. package/$server/$folder/$class/$module/class.js +1 -0
  15. package/$server/$folder/$class/$structure/$project/class.js +1 -0
  16. package/$server/$folder/$class/$structure/$server/class.js +1 -0
  17. package/$server/$folder/$class/$structure/$user/class.js +2 -0
  18. package/$server/$folder/$class/$structure/class.js +1 -0
  19. package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/chat-task.js +20 -6
  20. package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/class.js +23 -17
  21. package/$server/$folder/$class/$structure/handlers/pages/form/system/agent/$handler/class.js +35 -3
  22. package/$server/$folder/$class/$structure/handlers/pages/form/system/messengers/$handler/class.js +38 -3
  23. package/$server/$folder/$class/$users/class.js +1 -0
  24. package/$server/$folder/$class/handlers/pages/form/system/requisites/$handler/class.js +95 -24
  25. package/$server/$folder/$class/handlers/pages/storage/$handler/class.js +22 -4
  26. package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/class.js +4 -3
  27. package/$server/$folder/handlers/pages/form/$handler/class.js +81 -7
  28. package/$server/$folder/lib/explorer/explorer.js +2 -1
  29. package/$server/$folder/lib/icon/icon.js +2 -2
  30. package/$server/$folder/lib/node/node.js +3 -11
  31. package/$server/$folder/lib/prompt-bar/prompt-bar.js +4 -2
  32. package/$server/$folder/lib/tree/tree.js +12 -1
  33. package/MODULES//320/224/320/260/320/275/320/275/321/213/320/265/Geo/$module/class.js +1 -0
  34. package/MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Local/$provider/handlers/pages/form/system/engine/$handler/class.js +445 -0
  35. package/MODULES//320/243/321/207/321/221/321/202 /320/270 /320/277/321/200/320/276/321/206/320/265/321/201/321/201/321/213/Register/$module/class.js" +1 -0
  36. package/package.json +1 -1
  37. package/run.mjs +11 -0
  38. package/scripts/agent-eval.mjs +1 -1
  39. package/scripts/migrate-tree.mjs +9 -438
  40. package/sources/client/class.js +1 -1
  41. package/sources/host/auto-updater.js +34 -24
  42. package/sources/host/tree-migration.js +580 -0
  43. package/sources/host/tree-migration.json +85 -0
  44. package/sources/modules/agent/index.js +23 -10
  45. package/sources/modules/agent/session.js +22 -2
  46. package/sources/modules/agent/tools/meta.js +1 -1
  47. package/sources/modules/agent/voice.js +6 -2
  48. package/sources/modules/trainer/dataset.js +6 -4
  49. package/sources/modules/trainer/halogen.js +9 -9
  50. package/sources/modules/trainer/huggingface.js +1 -1
  51. package/sources/modules/trainer/index.js +25 -5
  52. package/sources/modules/trainer/local-engine.js +17 -11
  53. package/sources/modules/trainer/runner.js +32 -9
  54. package/sources/server/class/distro.js +1 -1
  55. package/sources/server/class.js +8 -0
  56. package/sources/server/folder.js +9 -2
  57. package/$server/$folder/$class/$data/$catalog/$folder/$class/$data/$catalog/$virtual/class.js +0 -4
  58. package/$server/$folder/$class/$data/$catalog/$folder/$class/$data/$catalog/class.js +0 -4
  59. package/$server/$folder/$class/$data/$catalog/$virtual/$folder/$class/$data/$catalog/$virtual/class.js +0 -4
  60. package/$server/$folder/$class/$data/$operation/$folder/$class/$data/$operation/class.js +0 -4
  61. package/$server/$folder/$class/$data/$register/$account/$folder/$class/$data/$register/$account/class.js +0 -4
  62. package/$server/$folder/$class/$data/$register/$folder/$class/$data/$register/$account/class.js +0 -4
  63. package/$server/$folder/$class/$data/$register/$folder/$class/$data/$register/class.js +0 -4
  64. package/$server/$folder/$class/$data/$struct/$folder/$class/$data/$struct/class.js +0 -4
  65. package/$server/$folder/$class/$domain/$folder/$class/$domain/class.js +0 -4
  66. package/$server/$folder/$class/$module/$folder/$class/$data/$catalog/class.js +0 -4
  67. package/$server/$folder/$class/$module/$folder/$class/$data/$operation/class.js +0 -4
  68. package/$server/$folder/$class/$module/$folder/$class/$data/$register/class.js +0 -4
  69. package/$server/$folder/$class/$module/$folder/$class/$data/$struct/class.js +0 -4
  70. package/$server/$folder/$class/$module/$folder/$class/$domain/class.js +0 -4
  71. package/$server/$folder/$class/$module/$folder/$class/$module/class.js +0 -4
  72. package/$server/$folder/$class/$structure/$folder/$class/$structure/class.js +0 -4
  73. package/$server/$folder/$class/$structure/$project/$folder/$class/$data/$catalog/class.js +0 -4
  74. package/$server/$folder/$class/$structure/$project/$folder/$class/$data/$operation/class.js +0 -4
  75. package/$server/$folder/$class/$structure/$project/$folder/$class/$data/$register/class.js +0 -4
  76. package/$server/$folder/$class/$structure/$project/$folder/$class/$data/$struct/class.js +0 -4
  77. package/$server/$folder/$class/$structure/$project/$folder/$class/$domain/class.js +0 -4
  78. package/$server/$folder/$class/$structure/$project/$folder/$class/$structure/$project/class.js +0 -4
  79. package/$server/$folder/$class/$structure/$project/$folder/$class/$structure/class.js +0 -4
  80. package/$server/$folder/$class/$structure/$server/$folder/$class/$domain/class.js +0 -4
  81. package/$server/$folder/$class/$users/$folder/$class/$structure/$user/class.js +0 -4
@@ -2,6 +2,8 @@ export default {
2
2
  label: 'Свойства',
3
3
  icon: 'editor:mode-edit',
4
4
  order: 10,
5
+ allowSave: true,
6
+ hasSettings: true,
5
7
  async allowUse($context) {
6
8
  try {
7
9
  const md = await $context?.METADATA;
@@ -13,7 +15,7 @@ export default {
13
15
  }
14
16
  },
15
17
  component: {
16
- imports: 'oda//icon, oda//button, ~/lib//editor-form',
18
+ imports: 'oda//icon, oda//button, /oda/components/layouts/editor-form/editor-form.js',
17
19
  template: /* html */`
18
20
  <style>
19
21
  :host {
@@ -23,13 +25,13 @@ export default {
23
25
  background: var(--content-background);
24
26
  color: var(--content-color);
25
27
  }
26
- .req-bar {
28
+ .req-head {
27
29
  @apply --horizontal;
28
30
  align-items: center;
29
31
  justify-content: space-between;
30
32
  flex-wrap: wrap;
31
- gap: 10px;
32
- padding: 10px 16px;
33
+ gap: 8px;
34
+ padding: 8px 14px;
33
35
  border-bottom: 1px solid var(--subtle-border, var(--border-color));
34
36
  background: var(--content-background);
35
37
  flex-shrink: 0;
@@ -38,25 +40,58 @@ export default {
38
40
  font-size: 12.5px;
39
41
  color: var(--muted-color);
40
42
  }
41
- @media (max-width: 768px) {
42
- .req-bar {
43
- padding: 8px 12px;
44
- }
43
+ .design-btn {
44
+ display: inline-flex;
45
+ align-items: center;
46
+ gap: 5px;
47
+ padding: 4px 10px;
48
+ border: 1px solid var(--border-color);
49
+ border-radius: 6px;
50
+ background: var(--content-background);
51
+ color: var(--content-color);
52
+ font-size: 12px;
53
+ font-weight: 600;
54
+ cursor: pointer;
55
+ }
56
+ .design-btn.active {
57
+ background: var(--accent-soft);
58
+ border-color: var(--accent-color);
59
+ color: var(--accent-color);
60
+ }
61
+ .req-scroll {
62
+ @apply --flex;
63
+ overflow: auto;
64
+ min-height: 0;
65
+ }
66
+ oda-editor-form {
67
+ max-width: 980px;
45
68
  }
46
69
  </style>
47
- <div class="req-bar">
70
+ <div class="req-head" ~if="schema">
48
71
  <span style="font-weight:700;font-size:14px;">{{tabTitle}}</span>
49
72
  <div class="horizontal" style="gap:8px;align-items:center;">
50
73
  <span ~if="reqStatus" class="req-status">{{reqStatus}}</span>
51
- <oda-button ~if="dataAccessNode" icon="icons:save" info-invert @tap="saveRequisites()">Сохранить</oda-button>
74
+ <button type="button" class="design-btn" ~class="{ active: designMode }" title="Дизайн расположения и кастомизация полей формы" @tap="toggleDesignMode()">
75
+ <oda-icon icon="icons:settings" icon-size="14"></oda-icon>
76
+ <span>{{designMode ? 'Готово' : 'Поля'}}</span>
77
+ </button>
52
78
  </div>
53
79
  </div>
54
- <item-editor-form ~if="dataAccessNode" flex :data-access-node="dataAccessNode"></item-editor-form>
55
- <div ~if="!dataAccessNode" style="padding:20px;color:var(--muted-color);">Для этого узла статические поля не объявлены.</div>
80
+ <div class="req-scroll" ~if="schema && editing">
81
+ <oda-editor-form hide-title ::design-mode="designMode" :layout-key="layoutKey"
82
+ :metadata="schema" :data="editing"
83
+ @input="onFormInput" @change="onFormInput" @cell-changed="onFormInput"></oda-editor-form>
84
+ </div>
85
+ <div ~if="!schema" style="padding:20px;color:var(--muted-color);">Для этого узла статические поля не объявлены.</div>
56
86
  `,
57
87
  $handler: null,
58
- dataAccessNode: null,
59
- requisitesBody: null,
88
+ $form: null,
89
+ allowSave: true,
90
+ hasSettings: true,
91
+ designMode: false,
92
+ schema: null,
93
+ editing: null,
94
+ _dirty: false,
60
95
  reqStatus: '',
61
96
  $item: {
62
97
  $def: null,
@@ -67,33 +102,69 @@ export default {
67
102
  get tabTitle() {
68
103
  return this.$handler?.DATA?.label || this.$handler?.label || 'Свойства';
69
104
  },
105
+ get layoutKey() {
106
+ const p = this.$item?.short || this.$item?.path || this.$item?.id || '';
107
+ return p ? `class-static:${p}` : '';
108
+ },
109
+ get isChanged() {
110
+ return Boolean(this._dirty);
111
+ },
112
+ isDirty() {
113
+ return Boolean(this._dirty);
114
+ },
115
+ showSettings() {
116
+ this.toggleDesignMode();
117
+ },
118
+ toggleDesignMode() {
119
+ this.designMode = !this.designMode;
120
+ },
121
+ _notifyForm() {
122
+ this.$form?.syncFromView?.(this);
123
+ },
70
124
  async attached() {
71
125
  if (this.$item) await this._syncRequisites(this.$item);
72
126
  },
73
127
  async _syncRequisites(item) {
74
128
  this.reqStatus = '';
75
- this.dataAccessNode = null;
76
- this.requisitesBody = null;
129
+ this.schema = null;
130
+ this.editing = null;
131
+ this._dirty = false;
132
+ this._notifyForm();
77
133
  try {
78
- const md = await item.METADATA;
134
+ const md = await item.metadata;
79
135
  const raw = md?.STATIC?.length ? md.STATIC : md?.FIELDS;
80
136
  const list = Array.isArray(raw) ? raw : Array.isArray(raw?.fields) ? raw.fields : [];
81
137
  if (!list.length) return;
82
- const node = await item.dataAccessRoot;
83
- this.dataAccessNode = node?.children?.find(n => n.field.id === 'STATIC') || node?.children?.find(n => n.field.id === 'FIELDS') || null;
84
- this.requisitesBody = node ? await node.getDataRoot() : null;
138
+ const body = await item.body;
139
+ this.schema = {
140
+ path: item.path || '',
141
+ title: item.label || item.id || '',
142
+ FIELDS: list,
143
+ LAYOUT: md?.STATIC_LAYOUT || md?.LAYOUT || null,
144
+ };
145
+ this.editing = body && typeof body === 'object' ? body : {};
85
146
  } catch {
86
- this.dataAccessNode = null;
147
+ this.schema = null;
148
+ this.editing = null;
87
149
  }
88
150
  },
89
- async saveRequisites() {
90
- if (!this.$item?.save || !this.requisitesBody) return;
151
+ onFormInput() {
152
+ this._dirty = true;
153
+ this.reqStatus = '';
154
+ this._notifyForm();
155
+ },
156
+ async save() {
157
+ if (!this.$item?.save || !this.editing) return;
91
158
  this.reqStatus = 'Сохранение…';
92
159
  try {
93
- await this.$item.save(this.requisitesBody);
160
+ await this.$item.save(this.editing);
161
+ this._dirty = false;
94
162
  this.reqStatus = 'Сохранено';
163
+ this._notifyForm();
95
164
  } catch (e) {
96
165
  this.reqStatus = String(e?.message || e);
166
+ this._notifyForm();
167
+ throw e;
97
168
  }
98
169
  }
99
170
  }
@@ -8,12 +8,30 @@ export default {
8
8
  hideTops: 0,
9
9
  hideRoots: 1,
10
10
  showSize: true,
11
+ cleanStructure: false,
11
12
  itemsSelector: 'entries',
13
+ _resolvedStorageFolder: null,
12
14
  async ready() {
13
- if (this.$item) {
14
- this.$context = this.$item;
15
- this.$item = undefined;
16
- this.$item = await this.$context.storage_folder;
15
+ await this._switchToStorageFolder();
16
+ },
17
+ async attached() {
18
+ await this._switchToStorageFolder();
19
+ },
20
+ $observers: {
21
+ async _itemChanged($item) {
22
+ if ($item && $item !== this._resolvedStorageFolder) {
23
+ await this._switchToStorageFolder();
24
+ }
25
+ }
26
+ },
27
+ async _switchToStorageFolder() {
28
+ const src = this.$item;
29
+ if (!src || src === this._resolvedStorageFolder) return;
30
+ this.$context = src;
31
+ const sf = await src.storage_folder;
32
+ if (sf && this.$item === src) {
33
+ this._resolvedStorageFolder = sf;
34
+ this.$item = sf;
17
35
  }
18
36
  },
19
37
  $public: {
@@ -225,8 +225,9 @@ export default {
225
225
  },
226
226
  $listeners: {
227
227
  resize() {
228
- if (this._lastMobile !== ODA.states.mobileMode) {
229
- this._lastMobile = ODA.states.mobileMode;
228
+ const mode = globalThis.ODA?.states?.mobileMode;
229
+ if (this._lastMobile !== mode) {
230
+ this._lastMobile = mode;
230
231
  this.invalidate('mobile');
231
232
  }
232
233
  },
@@ -280,7 +281,7 @@ export default {
280
281
  this._stopPcPoll();
281
282
  },
282
283
  get mobile() {
283
- return ODA.states.mobileMode;
284
+ return Boolean(globalThis.ODA?.states?.mobileMode);
284
285
  },
285
286
  get showMain() {
286
287
  return !(this.dockOpen && this.mobile);
@@ -197,7 +197,8 @@ ODA({
197
197
  .sub-btn:hover {
198
198
  background: color-mix(in srgb, var(--accent-color, #2563eb) 6%, transparent);
199
199
  }
200
- .sub-btn.active {
200
+ .sub-btn.active,
201
+ .sub-btn[data-active="1"] {
201
202
  background: color-mix(in srgb, var(--accent-color, #2563eb) 10%, var(--content-background, #ffffff));
202
203
  color: var(--accent-color, #2563eb);
203
204
  border-color: color-mix(in srgb, var(--accent-color, #2563eb) 55%, transparent);
@@ -242,7 +243,8 @@ ODA({
242
243
  <div ~for="groupedItems" style="display:contents;">
243
244
  <div ~if="$for.item.isSep" class="sub-sep"></div>
244
245
  <button ~if="!$for.item.isSep" type="button" class="sub-btn"
245
- ~class="{ active: activeId === $for.item.id }"
246
+ :data-active="$for.item.active ? '1' : ''"
247
+ ~class="{ active: $for.item.active }"
246
248
  @tap="selectTab($for.item.id)">
247
249
  <oda-icon :icon="$for.item.icon" icon-size="18"></oda-icon>
248
250
  <span>{{$for.item.label}}</span>
@@ -266,6 +268,7 @@ ODA({
266
268
  _mountSeq: 0,
267
269
  _loadSeq: 0,
268
270
  _attachedDone: false,
271
+ _pendingSubView: '',
269
272
  $handler: null,
270
273
  $item: {
271
274
  $def: null,
@@ -274,7 +277,56 @@ ODA({
274
277
  this._loadTabs(n);
275
278
  }
276
279
  },
280
+ get activeTab() {
281
+ return (this.tabs || []).find(t => t.id === this.activeId) || null;
282
+ },
283
+ get activeControl() {
284
+ return this.activeId && this._controls ? (this._controls[this.activeId] || null) : null;
285
+ },
286
+ get allowSave() {
287
+ const c = this.activeControl;
288
+ if (c && typeof c.allowSave === 'boolean')
289
+ return c.allowSave;
290
+ const t = this.activeTab;
291
+ if (t && typeof t.DATA?.allowSave === 'boolean')
292
+ return t.DATA.allowSave;
293
+ return false;
294
+ },
295
+ get isChanged() {
296
+ const c = this.activeControl;
297
+ if (!c)
298
+ return false;
299
+ if (typeof c.isChanged === 'boolean')
300
+ return c.isChanged;
301
+ if (typeof c.isDirty === 'function')
302
+ return Boolean(c.canSave !== false && c.isDirty());
303
+ return false;
304
+ },
305
+ isDirty() {
306
+ return this.isChanged;
307
+ },
308
+ get hasSettings() {
309
+ const c = this.activeControl;
310
+ const t = this.activeTab;
311
+ return Boolean(c?.hasSettings || t?.hasSettings || t?.DATA?.hasSettings);
312
+ },
313
+ showSettings() {
314
+ const c = this.activeControl;
315
+ if (typeof c?.showSettings === 'function')
316
+ return c.showSettings();
317
+ const t = this.activeTab;
318
+ return t?.showSettings?.();
319
+ },
320
+ async save() {
321
+ const c = this.activeControl;
322
+ if (typeof c?.save === 'function') {
323
+ const res = await c.save();
324
+ this.$form?.syncFromView?.(this);
325
+ return res;
326
+ }
327
+ },
277
328
  get groupedItems() {
329
+ const cur = this.activeId;
278
330
  const list = Array.isArray(this.tabs) ? this.tabs : [];
279
331
  const visible = list.filter(t => !(t.hidden || t.DATA?.hidden));
280
332
  // Группируем по group (порядок групп: 'main' первой, затем остальные по порядку появления).
@@ -288,6 +340,7 @@ ODA({
288
340
  groups.get(g).push({
289
341
  isSep: false,
290
342
  id: t.id,
343
+ active: cur === t.id,
291
344
  label: t.DATA?.label || t.label || t.id,
292
345
  icon: t.DATA?.icon || t.icon || '',
293
346
  });
@@ -302,7 +355,7 @@ ODA({
302
355
  const out = [];
303
356
  orderedGroups.forEach((arr, idx) => {
304
357
  if (idx > 0 && out.length)
305
- out.push({ isSep: true, id: `sep-${idx}`, label: '', icon: '' });
358
+ out.push({ isSep: true, id: `sep-${idx}`, active: false, label: '', icon: '' });
306
359
  for (const entry of arr)
307
360
  out.push(entry);
308
361
  });
@@ -310,8 +363,14 @@ ODA({
310
363
  },
311
364
  attached() {
312
365
  this._attachedDone = true;
313
- if (this.$item && (!this.tabs || !this.tabs.length))
366
+ if (this.$item && (!this.tabs || !this.tabs.length)) {
314
367
  this._loadTabs(this.$item);
368
+ }
369
+ else if (this.activeId && !this.$?.('#subBody')?.children?.length) {
370
+ const tab = (this.tabs || []).find(t => t.id === this.activeId);
371
+ if (tab)
372
+ this._mountTab(tab, this._pendingSubView || '');
373
+ }
315
374
  },
316
375
  _handlerRelativePath() {
317
376
  const raw = String(this.$handler?.path || this.$handler?.short || '');
@@ -371,12 +430,18 @@ ODA({
371
430
  return;
372
431
  this.activeId = id;
373
432
  await this._mountTab(tab, nestedSubView);
433
+ this.$form?.syncFromView?.(this);
374
434
  },
375
435
  async _mountTab(tab, nestedSubView = '') {
436
+ if (!tab)
437
+ return;
376
438
  const seq = ++this._mountSeq;
377
439
  const body = this.$?.('#subBody');
378
- if (!body)
440
+ if (!body) {
441
+ this._pendingSubView = nestedSubView || '';
379
442
  return;
443
+ }
444
+ this._pendingSubView = '';
380
445
  this._controls ||= {};
381
446
  let el = this._controls[tab.id];
382
447
  if (!el) {
@@ -415,6 +480,7 @@ ODA({
415
480
  }
416
481
  if (nestedSubView && typeof el.applyNav === 'function')
417
482
  await el.applyNav({ subView: nestedSubView });
483
+ this.$form?.syncFromView?.(this);
418
484
  },
419
485
  async applyNav(nav) {
420
486
  if (!nav || typeof nav !== 'object')
@@ -638,7 +704,7 @@ ODA({is: 'work-form',
638
704
  @tap.stop="switchView($for.item, $event)"
639
705
  @pointerdown.stop="view?.id === $for.item.id && openView($event)"
640
706
  >
641
- <oda-button ~if="view?.id === $for.item.id && (view?.hasSettings || view?.DATA?.hasSettings || view_control?.hasSettings)" icon="icons:settings" @pointerdown.stop.prevent="(view_control?.showSettings ? view_control.showSettings() : view?.showSettings?.())" style="padding: 0;"></oda-button>
707
+ <oda-button ~if="view?.id === $for.item.id && activeHasSettings" icon="icons:settings" @pointerdown.stop.prevent="(view_control?.showSettings ? view_control.showSettings() : view?.showSettings?.())" style="padding: 0;"></oda-button>
642
708
  </item-node>
643
709
  </div>
644
710
  </div>
@@ -1723,6 +1789,10 @@ ODA({is: 'work-form',
1723
1789
  hasSlottedToolbar: false,
1724
1790
  focusedStateVersion: 0,
1725
1791
  fallbackFocusedItem: null,
1792
+ get activeHasSettings() {
1793
+ void this.focusedStateVersion;
1794
+ return Boolean(this.view?.hasSettings || this.view?.DATA?.hasSettings || this.view_control?.hasSettings);
1795
+ },
1726
1796
  get isObjectViewActive() {
1727
1797
  return Boolean(this.view?.id === 'object' || this.view_control?.isObjectView);
1728
1798
  },
@@ -1782,7 +1852,9 @@ ODA({is: 'work-form',
1782
1852
  }
1783
1853
  },
1784
1854
  syncFromView(vc = this.view_control) {
1785
- if (!vc || (this.view_control && vc !== this.view_control))
1855
+ if (!vc)
1856
+ return;
1857
+ if (this.view_control && vc !== this.view_control && vc !== this.view_control?.activeControl)
1786
1858
  return;
1787
1859
  this.fallbackFocusedItem = vc.fallbackFocusedItem || null;
1788
1860
  this.focusedItem = vc.$focusedItem !== undefined ? vc.$focusedItem : (vc.focusedItem || null);
@@ -1915,6 +1987,8 @@ ODA({is: 'work-form',
1915
1987
  }
1916
1988
  finally {
1917
1989
  this.saving = false;
1990
+ this.syncFromView?.();
1991
+ this._wakeBars?.();
1918
1992
  }
1919
1993
  }, 100)
1920
1994
  },
@@ -3,7 +3,7 @@ export default {
3
3
  imports: 'oda//app-layout.js, oda//tabs.js, oda//icon, oda//button, ~/lib//tree.js, ~/lib//node-explorer.js, ~/lib//consultant.js, ~/lib//class-picker.js, ~/lib//support.js',
4
4
  extends: 'oda-app-layout',
5
5
  template: /*html*/`
6
- <item-tree order="0" slot='left-panel' allow-search clean-structure :items-selector :show-size show-status show-users allow-focus :hide-roots :hide-tops :$item style="height: 0"></item-tree>
6
+ <item-tree order="0" slot='left-panel' allow-search :clean-structure="cleanStructure" :items-selector :show-size show-status show-users allow-focus :hide-roots :hide-tops :$item style="height: 0"></item-tree>
7
7
  <item-consultant order="3" slot='left-panel' id="consultant" label="ИИ" icon="bootstrap:robot" :$item hidden style="height: 0"></item-consultant>
8
8
  <div flex vertical slot='main' style="overflow: hidden; position: relative;">
9
9
  <call-form ~if="showCall" id="callForm"></call-form>
@@ -26,6 +26,7 @@ export default {
26
26
  </oda-tabs>
27
27
  `,
28
28
  visibleMode: 'main',
29
+ cleanStructure: true,
29
30
  showSize: false,
30
31
  pages: [],
31
32
  bookmarks: [],
@@ -56,7 +56,7 @@ export default {
56
56
  if (!it || this.isUser || isLinkNode(it) || ('isPlace' in Object(it) && it.isPlace))
57
57
  return null;
58
58
  const t = it.type;
59
- if (t !== '$project' && t !== '$project' && t !== '$structure' && t !== '$server')
59
+ if (t !== '$project' && t !== '$structure' && t !== '$server')
60
60
  return null;
61
61
  it.__version;
62
62
  const bossIds = it.DATA?.roleIds?.BOSS;
@@ -163,7 +163,7 @@ export default {
163
163
  $type: Boolean,
164
164
  get() {
165
165
  const it = this.$item;
166
- if (!it || it.id === 'MODELS' || (it.type !== '$ai' && it.type !== '$provider'))
166
+ if (!it || (it.type !== '$ai' && it.type !== '$provider'))
167
167
  return false;
168
168
  return (it.aiActive ?? it.DATA?.aiActive) === false;
169
169
  }
@@ -433,17 +433,9 @@ export default {
433
433
  const isNetServer = t === '$node' && this.$item?.id !== 'NODES';
434
434
  if(this.isUser || t === '$user' || t === '$project' || t === '$structure' || t === '$server' || isNetServer)
435
435
  return 48;
436
- if(this.isStructureLike)
437
- return 28;
438
- if(!this.showStatus)
439
- return 24;
440
- if(this.$item){
441
- if(this.$item instanceof CORE.$handler)
442
- return 26;
443
- if(this.$item instanceof CORE.$class)
444
- return 24;
445
- return 24;
446
- }
436
+ if(t === '$module' || t === '$provider' || t === '$mcp')
437
+ return 32;
438
+ return 24;
447
439
  },
448
440
  showStatus: false,
449
441
  isExplorer: false,
@@ -535,7 +535,7 @@ ODA({ is: 'work-prompt-bar',
535
535
  get modelName() {
536
536
  return String(this.model || '').split('/').pop() || 'Модель';
537
537
  },
538
- /** Иконка выбранной модели — её собственная (наследуется от провайдера), как в дереве /MODELS. */
538
+ /** Иконка выбранной модели — её собственная (наследуется от провайдера), как в дереве /MODULES/Модели. */
539
539
  get modelIcon() {
540
540
  const fallback = 'carbon:machine-learning-model';
541
541
  if (!this.model)
@@ -547,7 +547,9 @@ ODA({ is: 'work-prompt-bar',
547
547
  /** Подсказка: провайдер и модель (одинаковые имена у разных провайдеров различимы). */
548
548
  get modelTitle() {
549
549
  const parts = String(this.model || '').split('/').filter(Boolean);
550
- return parts.length >= 3 ? 'Модель: ' + parts.slice(1).join(' / ') : 'Выбрать модель';
550
+ const modIdx = parts.indexOf('Модели');
551
+ const short = modIdx >= 0 ? parts.slice(modIdx + 1) : (parts[0]?.toUpperCase() === 'MODELS' ? parts.slice(1) : parts);
552
+ return short.length >= 2 ? 'Модель: ' + short.join(' / ') : 'Выбрать модель';
551
553
  },
552
554
  get modeMeta() {
553
555
  return (this.modes || []).find(m => m.id === this.mode) || this.modes?.[0];
@@ -48,6 +48,8 @@ function filterMainTreeItems(items, parent) {
48
48
  }
49
49
  if (isModulesContainer(parent))
50
50
  return items.filter(f => f && (f.type === '$folder' || f.type === '$module' || f.type === '$provider' || f.type === '$mcp'));
51
+ if (parent.type === '$folder')
52
+ return items;
51
53
  if (isRootSectionNode(parent))
52
54
  return items.filter(f => f && MAIN_TREE_ENV_TYPES.has(f.type));
53
55
  if (isMainTreeLeaf(parent))
@@ -639,6 +641,10 @@ ODA({is: 'oda-tree-node',
639
641
  height: 52px;
640
642
  min-height: 52px;
641
643
  }
644
+ .node.medium-icon-node {
645
+ height: 38px;
646
+ min-height: 38px;
647
+ }
642
648
  .node.structure-only-node {
643
649
  height: 36px;
644
650
  min-height: 36px;
@@ -709,7 +715,7 @@ ODA({is: 'oda-tree-node',
709
715
  padding: 0px;
710
716
  }
711
717
  </style>
712
- <div draggable="true" ~if="hideTops<1" class='node' ~class="{'node-focused': isFocused, 'is-stuck': isStuck, 'module-blocked': isModuleBlocked, 'large-icon-node': isLargeIconNode, 'structure-only-node': isDepartmentNode}" :style="nodeStickyStyle" :category="isCategory" @tap="isCategory?$pdp.focusedItem=$pdp.focusedItem:$pdp.focusedItem = $item" @dragstart>
718
+ <div draggable="true" ~if="hideTops<1" class='node' ~class="{'node-focused': isFocused, 'is-stuck': isStuck, 'module-blocked': isModuleBlocked, 'large-icon-node': isLargeIconNode, 'medium-icon-node': isMediumIconNode, 'structure-only-node': isDepartmentNode}" :style="nodeStickyStyle" :category="isCategory" @tap="isCategory?$pdp.focusedItem=$pdp.focusedItem:$pdp.focusedItem = $item" @dragstart>
713
719
  <oda-icon ~if="hideRoots<1" ~show="showExpander" :disabled="!expanderIcon" :icon="expanderIcon" :icon-size="expanderIconSize" @tap.stop="expanded = !expanded"></oda-icon>
714
720
  <div vertical flex style="min-width: 0; overflow: hidden;">
715
721
  <div horizontal flex style="min-width: 0; overflow: hidden; align-items: center;">
@@ -815,12 +821,17 @@ ODA({is: 'oda-tree-node',
815
821
  const isNetServer = t === '$node' && it.id !== 'NODES';
816
822
  return it instanceof CORE.$user || t === '$user' || t === '$project' || t === '$structure' || t === '$server' || isNetServer;
817
823
  },
824
+ get isMediumIconNode() {
825
+ return this.isModule;
826
+ },
818
827
  get isDepartmentNode() {
819
828
  return false;
820
829
  },
821
830
  get rowHeight() {
822
831
  if (this.isLargeIconNode)
823
832
  return 52;
833
+ if (this.isMediumIconNode)
834
+ return 38;
824
835
  if (this.isDepartmentNode)
825
836
  return 36;
826
837
  return 30;
@@ -1,3 +1,4 @@
1
1
  export default {
2
2
  label: 'Геолокация и координаты',
3
+ icon: 'carbon:location',
3
4
  }