odant-work 1.0.103 → 1.0.105
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/$server/$folder/$class/$ai/handlers/pages/form/system/ai/$handler/class.js +15 -12
- package/$server/$folder/$class/$module/$mcp/handlers/pages/form/system/mcp/$handler/class.js +17 -24
- package/$server/$folder/$class/$module/$provider/handlers/pages/form/system/ai/$handler/class.js +15 -12
- package/$server/$folder/$class/$structure/$project/class.js +39 -5
- package/$server/$folder/$class/$structure/$project/handlers/pages/form/system/modules/$handler/class.js +40 -25
- package/$server/$folder/$class/$structure/$project/handlers/pages/form/system/requisites/$handler/class.js +1 -0
- package/$server/$folder/$class/$structure/$server/handlers/pages/form/system/license/$handler/class.js +13 -12
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/agent/$handler/class.js +11 -1
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/messengers/$handler/class.js +11 -1
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/profile/$handler/class.js +1 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/requisites/$handler/class.js +3 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/settings/$handler/class.js +261 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/skills/$handler/class.js +11 -1
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/tokens/$handler/class.js +2 -0
- package/$server/$folder/$class/$structure/$user/handlers/pages/form/system/users/$handler/class.js +1 -0
- package/$server/$folder/$class/$structure/class.js +15 -0
- package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/class.js +17 -4
- package/$server/$folder/$class/$structure/handlers/pages/form/system/agent/$handler/class.js +19 -40
- package/$server/$folder/$class/$structure/handlers/pages/form/system/database/$handler/class.js +1 -0
- package/$server/$folder/$class/$structure/handlers/pages/form/system/messengers/$handler/class.js +1 -0
- package/$server/$folder/$class/$structure/handlers/pages/form/system/skills/$handler/class.js +276 -179
- package/$server/$folder/$class/$structure/handlers/pages/form/system/staff/$handler/class.js +1 -0
- package/$server/$folder/$class/ai/system.md +2 -2
- package/$server/$folder/$class/class.js +5 -1
- package/$server/$folder/$class/handlers/pages/form/system/requisites/$handler/class.js +39 -45
- package/$server/$folder/$file/$html/handlers/preview/$handler/preview.js +7 -0
- package/$server/$folder/$file/$image/handlers/preview/$handler/preview.js +11 -0
- package/$server/$folder/$file/$md/handlers/preview/$handler/preview.js +29 -8
- package/$server/$folder/$file/$office/handlers/preview/$handler/preview.js +6 -0
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/class.js +34 -2
- package/$server/$folder/$file/$task/handlers/pages/form/file/$handler/ui/feed.js +14 -11
- package/$server/$folder/$file/$task/handlers/preview/$handler/preview.js +1 -0
- package/$server/$folder/$file/$txt/handlers/preview/$handler/preview.js +9 -0
- package/$server/$folder/$file/$video/handlers/preview/$handler/preview.js +15 -0
- package/$server/$folder/handlers/pages/form/$handler/class.js +187 -3
- package/$server/$folder/handlers/pages/form/folder/$handler/class.js +3 -114
- package/$server/$folder/lib/explorer/explorer.js +63 -0
- package/$server/$folder/lib/folder-browser/folder-browser.js +793 -0
- package/$server/$folder/lib/folder-browser/readme.md +5 -0
- package/$server/$folder/lib/tree/tree.js +61 -20
- package/AGENTS.md +2 -2
- package/MODULES/$domain/handlers/pages/form/system/mcp/$handler/class.js +10 -21
- package/MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Local/$provider/handlers/pages/form/system/engine/$handler/class.js +1 -0
- package/MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Local/$provider/handlers/pages/form/system/models/$handler/class.js +5 -10
- package/MODULES//320/234/320/276/320/264/320/265/320/273/320/270/Local/$provider/handlers/pages/form/system/training/$handler/class.js +1 -0
- 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/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/237/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/216/$operation/print//320/241/321/207/321/221/321/202 /320/275/320/260 /320/276/320/277/320/273/320/260/321/202/321/203.html" +5 -1
- 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/OPERATIONS//320/240/320/265/320/260/320/273/320/270/320/267/320/260/321/206/320/270/321/217//320/237/320/276/320/272/321/203/320/277/320/260/321/202/320/265/320/273/321/216/$operation/print//320/242/320/276/320/262/320/260/321/200/320/275/320/260/321/217 /320/275/320/260/320/272/320/273/320/260/320/264/320/275/320/260/321/217.html" +1 -1
- package/NODES/$node/handlers/pages/form/network/$handler/class.js +552 -36
- package/oda/components/icon/icon.js +20 -7
- package/oda/components/layouts/editor-form/editor-form.js +54 -9
- package/package.json +1 -1
- package/sources/client.js +24 -0
- package/sources/data/print.js +27 -3
- package/sources/host/websocket.js +28 -1
- package/sources/modules/agent/index.js +25 -6
- package/sources/modules/agent/permissions.js +4 -2
- package/sources/modules/agent/scope.js +72 -5
- package/sources/modules/agent/session.js +59 -6
- package/sources/modules/agent/tools/work/classes.js +16 -1
- package/sources/modules/license/index.js +120 -0
- package/sources/modules/nodes/registry.js +57 -7
- package/sources/modules/trainer/local-engine.js +22 -9
- package/sources/modules/user-profile/user-profile.js +0 -129
- package/sources/modules/user-profile/user-tokens.js +381 -86
- package/sources/server/access/gateway.js +32 -5
- package/sources/server/class/base-template.js +18 -18
- package/sources/server/class.js +9 -0
- package/sources/server/folder.js +5 -1
- package/sources/server/handler.js +6 -0
- package/sources/server/node.js +16 -0
- package/sources/server/server.js +14 -5
- package/sources/server/user.js +3 -0
|
@@ -215,6 +215,104 @@ ODA({
|
|
|
215
215
|
border-color: color-mix(in srgb, var(--accent-color, #2563eb) 55%, transparent);
|
|
216
216
|
font-weight: 600;
|
|
217
217
|
}
|
|
218
|
+
.sub-main {
|
|
219
|
+
@apply --vertical;
|
|
220
|
+
@apply --flex;
|
|
221
|
+
min-width: 0;
|
|
222
|
+
min-height: 0;
|
|
223
|
+
overflow: hidden;
|
|
224
|
+
}
|
|
225
|
+
.sub-header {
|
|
226
|
+
@apply --horizontal;
|
|
227
|
+
align-items: center;
|
|
228
|
+
justify-content: space-between;
|
|
229
|
+
gap: 12px;
|
|
230
|
+
flex-wrap: wrap;
|
|
231
|
+
padding: 12px 20px;
|
|
232
|
+
border-bottom: 1px solid var(--subtle-border, var(--border-color));
|
|
233
|
+
background: var(--content-background);
|
|
234
|
+
flex-shrink: 0;
|
|
235
|
+
box-sizing: border-box;
|
|
236
|
+
}
|
|
237
|
+
.sub-header-main {
|
|
238
|
+
@apply --horizontal;
|
|
239
|
+
align-items: center;
|
|
240
|
+
gap: 12px;
|
|
241
|
+
min-width: 0;
|
|
242
|
+
flex: 1 1 260px;
|
|
243
|
+
}
|
|
244
|
+
.sub-header-ico {
|
|
245
|
+
width: 36px;
|
|
246
|
+
height: 36px;
|
|
247
|
+
border-radius: 10px;
|
|
248
|
+
display: flex;
|
|
249
|
+
align-items: center;
|
|
250
|
+
justify-content: center;
|
|
251
|
+
background: color-mix(in srgb, var(--accent-color, #2563eb) 12%, transparent);
|
|
252
|
+
color: var(--accent-color, #2563eb);
|
|
253
|
+
flex-shrink: 0;
|
|
254
|
+
}
|
|
255
|
+
.sub-header-text {
|
|
256
|
+
@apply --vertical;
|
|
257
|
+
min-width: 0;
|
|
258
|
+
gap: 2px;
|
|
259
|
+
}
|
|
260
|
+
.sub-header-title {
|
|
261
|
+
font-size: 16px;
|
|
262
|
+
font-weight: 700;
|
|
263
|
+
line-height: 1.25;
|
|
264
|
+
color: var(--content-color);
|
|
265
|
+
word-break: break-word;
|
|
266
|
+
}
|
|
267
|
+
.sub-header-desc {
|
|
268
|
+
font-size: 12.5px;
|
|
269
|
+
line-height: 1.35;
|
|
270
|
+
color: var(--muted-color, #64748b);
|
|
271
|
+
}
|
|
272
|
+
.sub-header-actions {
|
|
273
|
+
@apply --horizontal;
|
|
274
|
+
align-items: center;
|
|
275
|
+
gap: 8px;
|
|
276
|
+
flex-wrap: wrap;
|
|
277
|
+
flex-shrink: 0;
|
|
278
|
+
}
|
|
279
|
+
.sub-header-status {
|
|
280
|
+
font-size: 12.5px;
|
|
281
|
+
color: var(--muted-color, #64748b);
|
|
282
|
+
}
|
|
283
|
+
.sub-header-btn {
|
|
284
|
+
display: inline-flex;
|
|
285
|
+
align-items: center;
|
|
286
|
+
gap: 6px;
|
|
287
|
+
padding: 6px 12px;
|
|
288
|
+
border: 1px solid var(--border-color, #cbd5e1);
|
|
289
|
+
border-radius: 8px;
|
|
290
|
+
background: var(--content-background);
|
|
291
|
+
color: var(--content-color);
|
|
292
|
+
font: inherit;
|
|
293
|
+
font-size: 12.5px;
|
|
294
|
+
font-weight: 600;
|
|
295
|
+
cursor: pointer;
|
|
296
|
+
white-space: nowrap;
|
|
297
|
+
}
|
|
298
|
+
.sub-header-btn:hover:not(:disabled) {
|
|
299
|
+
border-color: var(--accent-color, #2563eb);
|
|
300
|
+
background: color-mix(in srgb, var(--accent-color, #2563eb) 6%, var(--content-background));
|
|
301
|
+
}
|
|
302
|
+
.sub-header-btn.active {
|
|
303
|
+
background: var(--accent-soft);
|
|
304
|
+
border-color: var(--accent-color);
|
|
305
|
+
color: var(--accent-color);
|
|
306
|
+
}
|
|
307
|
+
.sub-header-btn.primary {
|
|
308
|
+
background: var(--accent-color, #2563eb);
|
|
309
|
+
border-color: transparent;
|
|
310
|
+
color: #ffffff;
|
|
311
|
+
}
|
|
312
|
+
.sub-header-btn:disabled {
|
|
313
|
+
opacity: 0.48;
|
|
314
|
+
cursor: default;
|
|
315
|
+
}
|
|
218
316
|
.sub-body {
|
|
219
317
|
@apply --vertical;
|
|
220
318
|
@apply --flex;
|
|
@@ -226,6 +324,9 @@ ODA({
|
|
|
226
324
|
:host {
|
|
227
325
|
flex-direction: column;
|
|
228
326
|
}
|
|
327
|
+
.sub-header {
|
|
328
|
+
padding: 10px 14px;
|
|
329
|
+
}
|
|
229
330
|
.sub-nav {
|
|
230
331
|
width: 100%;
|
|
231
332
|
flex-direction: row;
|
|
@@ -267,7 +368,31 @@ ODA({
|
|
|
267
368
|
</button>
|
|
268
369
|
</div>
|
|
269
370
|
</nav>
|
|
270
|
-
<div
|
|
371
|
+
<div class="sub-main">
|
|
372
|
+
<div ~if="showSubHeader" class="sub-header">
|
|
373
|
+
<div class="sub-header-main">
|
|
374
|
+
<div ~if="activeHeaderIcon" class="sub-header-ico">
|
|
375
|
+
<oda-icon :icon="activeHeaderIcon" icon-size="20"></oda-icon>
|
|
376
|
+
</div>
|
|
377
|
+
<div class="sub-header-text">
|
|
378
|
+
<div class="sub-header-title">{{activeHeaderTitle}}</div>
|
|
379
|
+
<div ~if="activeHeaderDescription" class="sub-header-desc">{{activeHeaderDescription}}</div>
|
|
380
|
+
</div>
|
|
381
|
+
</div>
|
|
382
|
+
<div ~if="activeHeaderStatus || activeHeaderActions.length" class="sub-header-actions">
|
|
383
|
+
<span ~if="activeHeaderStatus" class="sub-header-status">{{activeHeaderStatus}}</span>
|
|
384
|
+
<button ~for="activeHeaderActions" type="button"
|
|
385
|
+
class="sub-header-btn" ~class="{ primary: $for.item.primary, active: $for.item.active }"
|
|
386
|
+
:disabled="Boolean($for.item.disabled)"
|
|
387
|
+
:title="$for.item.title || $for.item.label || ''"
|
|
388
|
+
@tap="onHeaderAction($for.item)">
|
|
389
|
+
<oda-icon ~if="$for.item.icon" :icon="$for.item.icon" icon-size="14"></oda-icon>
|
|
390
|
+
<span ~if="$for.item.label">{{$for.item.label}}</span>
|
|
391
|
+
</button>
|
|
392
|
+
</div>
|
|
393
|
+
</div>
|
|
394
|
+
<div id="subBody" class="sub-body"></div>
|
|
395
|
+
</div>
|
|
271
396
|
`,
|
|
272
397
|
$public: {
|
|
273
398
|
layout: {
|
|
@@ -301,6 +426,7 @@ ODA({
|
|
|
301
426
|
_loadedFor: null,
|
|
302
427
|
_loadedHandler: null,
|
|
303
428
|
_attemptedMountIds: null,
|
|
429
|
+
_headerTick: 0,
|
|
304
430
|
$handler: {
|
|
305
431
|
$def: null,
|
|
306
432
|
set(n) {
|
|
@@ -321,6 +447,51 @@ ODA({
|
|
|
321
447
|
get activeControl() {
|
|
322
448
|
return this.activeId && this._controls ? (this._controls[this.activeId] || null) : null;
|
|
323
449
|
},
|
|
450
|
+
get showSubHeader() {
|
|
451
|
+
void this._headerTick;
|
|
452
|
+
const t = this.activeTab;
|
|
453
|
+
if (!t)
|
|
454
|
+
return false;
|
|
455
|
+
if (t.DATA?.hideHeader || this.activeControl?.hideContainerHeader)
|
|
456
|
+
return false;
|
|
457
|
+
return Boolean(this.activeHeaderTitle);
|
|
458
|
+
},
|
|
459
|
+
get activeHeaderIcon() {
|
|
460
|
+
void this._headerTick;
|
|
461
|
+
const c = this.activeControl;
|
|
462
|
+
const t = this.activeTab;
|
|
463
|
+
return c?.headerIcon || t?.DATA?.icon || t?.icon || '';
|
|
464
|
+
},
|
|
465
|
+
get activeHeaderTitle() {
|
|
466
|
+
void this._headerTick;
|
|
467
|
+
const c = this.activeControl;
|
|
468
|
+
const t = this.activeTab;
|
|
469
|
+
return c?.headerTitle || t?.DATA?.title || t?.DATA?.label || t?.label || t?.id || '';
|
|
470
|
+
},
|
|
471
|
+
get activeHeaderDescription() {
|
|
472
|
+
void this._headerTick;
|
|
473
|
+
const c = this.activeControl;
|
|
474
|
+
const t = this.activeTab;
|
|
475
|
+
const d = c?.headerDescription ?? t?.DATA?.description ?? t?.description ?? '';
|
|
476
|
+
return typeof d === 'function' ? '' : String(d || '');
|
|
477
|
+
},
|
|
478
|
+
get activeHeaderStatus() {
|
|
479
|
+
void this._headerTick;
|
|
480
|
+
return String(this.activeControl?.headerStatus || '');
|
|
481
|
+
},
|
|
482
|
+
get activeHeaderActions() {
|
|
483
|
+
void this._headerTick;
|
|
484
|
+
const acts = this.activeControl?.headerActions;
|
|
485
|
+
return Array.isArray(acts) ? acts : [];
|
|
486
|
+
},
|
|
487
|
+
refreshHeader() {
|
|
488
|
+
this._headerTick++;
|
|
489
|
+
this.render?.(true);
|
|
490
|
+
},
|
|
491
|
+
onHeaderAction(act) {
|
|
492
|
+
if (typeof act?.onClick === 'function')
|
|
493
|
+
act.onClick();
|
|
494
|
+
},
|
|
324
495
|
get allowSave() {
|
|
325
496
|
const c = this.activeControl;
|
|
326
497
|
if (c && typeof c.allowSave === 'boolean')
|
|
@@ -512,6 +683,7 @@ ODA({
|
|
|
512
683
|
if (!tab)
|
|
513
684
|
return;
|
|
514
685
|
this.activeId = id;
|
|
686
|
+
this._headerTick++;
|
|
515
687
|
this.render?.(true);
|
|
516
688
|
await this._mountTab(tab, nestedSubView);
|
|
517
689
|
this.$form?.syncFromView?.(this);
|
|
@@ -558,6 +730,7 @@ ODA({
|
|
|
558
730
|
if (!el)
|
|
559
731
|
return;
|
|
560
732
|
el.$form = this.$form;
|
|
733
|
+
el.$subviewHost = this;
|
|
561
734
|
el.style.flex = '1 1 auto';
|
|
562
735
|
el.style.minHeight = '0';
|
|
563
736
|
this._controls[tab.id] = el;
|
|
@@ -572,6 +745,7 @@ ODA({
|
|
|
572
745
|
el.render?.(true);
|
|
573
746
|
if (nestedSubView && typeof el.applyNav === 'function')
|
|
574
747
|
await el.applyNav({ subView: nestedSubView });
|
|
748
|
+
this._headerTick++;
|
|
575
749
|
this.$form?.syncFromView?.(this);
|
|
576
750
|
},
|
|
577
751
|
async applyNav(nav) {
|
|
@@ -1217,8 +1391,16 @@ ODA({is: 'work-form',
|
|
|
1217
1391
|
return localCons;
|
|
1218
1392
|
},
|
|
1219
1393
|
openView(e) {
|
|
1220
|
-
if (e.button === 0 && this.view)
|
|
1221
|
-
|
|
1394
|
+
if (e.button === 0 && this.view) {
|
|
1395
|
+
const target = this.currentItem || this.$item;
|
|
1396
|
+
const short = String(target?.short || target?.path || '').replace(/\/+$/, '');
|
|
1397
|
+
const base = short === '/' ? '' : short;
|
|
1398
|
+
const sub = (this.view_control?.localName === 'work-subview-container' && this.view_control?.activeId)
|
|
1399
|
+
? '/' + this.view_control.activeId
|
|
1400
|
+
: '';
|
|
1401
|
+
const viewSeg = this.view.id ? ('/' + this.view.id + sub) : '';
|
|
1402
|
+
window.open(encodeURI(base + '/~/handlers/pages/form' + viewSeg + '/index.html'));
|
|
1403
|
+
}
|
|
1222
1404
|
},
|
|
1223
1405
|
back(e) {
|
|
1224
1406
|
alert('надо скрыть')
|
|
@@ -1999,6 +2181,8 @@ ODA({is: 'work-form',
|
|
|
1999
2181
|
return;
|
|
2000
2182
|
if (this.view_control && vc !== this.view_control && vc !== this.view_control?.activeControl)
|
|
2001
2183
|
return;
|
|
2184
|
+
if (this.view_control && typeof this.view_control.refreshHeader === 'function')
|
|
2185
|
+
this.view_control.refreshHeader();
|
|
2002
2186
|
this.fallbackFocusedItem = vc.fallbackFocusedItem || null;
|
|
2003
2187
|
this.focusedItem = vc.$focusedItem !== undefined ? vc.$focusedItem : (vc.focusedItem || null);
|
|
2004
2188
|
this.focusedStateVersion++;
|
|
@@ -1,120 +1,9 @@
|
|
|
1
|
+
import { FOLDER_BROWSER_COMPONENT } from '/~/lib/folder-browser/folder-browser.js';
|
|
2
|
+
|
|
1
3
|
export default {
|
|
2
4
|
icon: 'fontawesome:r-folder-open',
|
|
3
5
|
label: 'Файлы',
|
|
4
6
|
order: 10,
|
|
5
7
|
default: true,
|
|
6
|
-
component:
|
|
7
|
-
imports: '~/lib//tree.js',
|
|
8
|
-
template: /* html */`
|
|
9
|
-
<style>
|
|
10
|
-
:host {
|
|
11
|
-
@apply --vertical;
|
|
12
|
-
overflow: hidden;
|
|
13
|
-
@apply --content;
|
|
14
|
-
min-height: 0;
|
|
15
|
-
}
|
|
16
|
-
.folder-bar {
|
|
17
|
-
@apply --horizontal;
|
|
18
|
-
align-items: center;
|
|
19
|
-
justify-content: flex-end;
|
|
20
|
-
gap: 10px;
|
|
21
|
-
padding: 6px 12px;
|
|
22
|
-
border-bottom: 1px solid var(--subtle-border, var(--border-color));
|
|
23
|
-
background: var(--subtle-background, var(--content-background));
|
|
24
|
-
flex-shrink: 0;
|
|
25
|
-
}
|
|
26
|
-
.sys-toggle {
|
|
27
|
-
@apply --horizontal;
|
|
28
|
-
align-items: center;
|
|
29
|
-
gap: 6px;
|
|
30
|
-
font-size: 12.5px;
|
|
31
|
-
color: var(--content-color);
|
|
32
|
-
cursor: pointer;
|
|
33
|
-
user-select: none;
|
|
34
|
-
}
|
|
35
|
-
.sys-toggle input {
|
|
36
|
-
margin: 0;
|
|
37
|
-
cursor: pointer;
|
|
38
|
-
accent-color: var(--accent-color);
|
|
39
|
-
}
|
|
40
|
-
</style>
|
|
41
|
-
<div ~if="isBoss" class="folder-bar">
|
|
42
|
-
<label class="sys-toggle">
|
|
43
|
-
<input type="checkbox" :checked="showSystem" @change="onShowSystemChange($event)">
|
|
44
|
-
<span>Показать системные</span>
|
|
45
|
-
</label>
|
|
46
|
-
</div>
|
|
47
|
-
<item-tree flex
|
|
48
|
-
:$item="storage"
|
|
49
|
-
:hide-system="!effectiveShowSystem"
|
|
50
|
-
:auto-run="false"
|
|
51
|
-
show-size
|
|
52
|
-
allow-search
|
|
53
|
-
allow-focus
|
|
54
|
-
show-tools
|
|
55
|
-
menu-mode="both"
|
|
56
|
-
items-selector="entries"
|
|
57
|
-
hide-tops="1"
|
|
58
|
-
hide-roots="1"
|
|
59
|
-
:execute="openEntry">
|
|
60
|
-
</item-tree>
|
|
61
|
-
`,
|
|
62
|
-
showSystem: false,
|
|
63
|
-
_isBoss: false,
|
|
64
|
-
$item: {
|
|
65
|
-
$def: null,
|
|
66
|
-
set(n) {
|
|
67
|
-
this._syncIsBoss(n);
|
|
68
|
-
},
|
|
69
|
-
},
|
|
70
|
-
attached() {
|
|
71
|
-
if (this.$item)
|
|
72
|
-
this._syncIsBoss(this.$item);
|
|
73
|
-
},
|
|
74
|
-
_syncIsBoss(it = this.$item) {
|
|
75
|
-
if (!it) {
|
|
76
|
-
this._isBoss = false;
|
|
77
|
-
return;
|
|
78
|
-
}
|
|
79
|
-
if (WORK?.DEV_MODE) {
|
|
80
|
-
this._isBoss = true;
|
|
81
|
-
return;
|
|
82
|
-
}
|
|
83
|
-
const seq = (this._bossSeq = (this._bossSeq || 0) + 1);
|
|
84
|
-
Promise.resolve(it.isBoss)
|
|
85
|
-
.then(v => {
|
|
86
|
-
if (seq === this._bossSeq)
|
|
87
|
-
this._isBoss = Boolean(v);
|
|
88
|
-
})
|
|
89
|
-
.catch(() => {
|
|
90
|
-
if (seq === this._bossSeq)
|
|
91
|
-
this._isBoss = false;
|
|
92
|
-
});
|
|
93
|
-
},
|
|
94
|
-
get isBoss() {
|
|
95
|
-
return Boolean(this._isBoss);
|
|
96
|
-
},
|
|
97
|
-
get effectiveShowSystem() {
|
|
98
|
-
return Boolean(this._isBoss && this.showSystem);
|
|
99
|
-
},
|
|
100
|
-
onShowSystemChange(e) {
|
|
101
|
-
this.showSystem = Boolean(e?.target?.checked);
|
|
102
|
-
},
|
|
103
|
-
get storage() {
|
|
104
|
-
return this.$item?.storage_folder;
|
|
105
|
-
},
|
|
106
|
-
openEntry(item) {
|
|
107
|
-
if (!item)
|
|
108
|
-
return;
|
|
109
|
-
if (item.type === '$handler') {
|
|
110
|
-
item.execute?.();
|
|
111
|
-
return;
|
|
112
|
-
}
|
|
113
|
-
if (typeof window?.execute === 'function') {
|
|
114
|
-
window.execute(item);
|
|
115
|
-
return;
|
|
116
|
-
}
|
|
117
|
-
item.execute?.();
|
|
118
|
-
},
|
|
119
|
-
},
|
|
8
|
+
component: FOLDER_BROWSER_COMPONENT,
|
|
120
9
|
};
|
|
@@ -114,8 +114,11 @@ export default {
|
|
|
114
114
|
buttons.push({
|
|
115
115
|
round: true,
|
|
116
116
|
icon: 'eva:o-phone-call-outline',
|
|
117
|
+
default: '',
|
|
117
118
|
title: 'Вернуться к звонку',
|
|
118
119
|
rainbow: true,
|
|
120
|
+
errorInvert: false,
|
|
121
|
+
style: '',
|
|
119
122
|
click: () => {
|
|
120
123
|
this.showCall = true;
|
|
121
124
|
},
|
|
@@ -126,10 +129,13 @@ export default {
|
|
|
126
129
|
buttons.push({
|
|
127
130
|
round: true,
|
|
128
131
|
icon: 'icons:help',
|
|
132
|
+
default: '',
|
|
129
133
|
title: supPending > 0
|
|
130
134
|
? `Служба поддержки (${supPending} уведомл.)`
|
|
131
135
|
: 'Служба поддержки (скриншот, видео, удалённый экран)',
|
|
132
136
|
rainbow: Boolean(this._supportRemotePending > 0 || this._supportUnread > 0),
|
|
137
|
+
errorInvert: false,
|
|
138
|
+
style: '',
|
|
133
139
|
click: () => {
|
|
134
140
|
this.openSupportPanel?.();
|
|
135
141
|
},
|
|
@@ -139,6 +145,8 @@ export default {
|
|
|
139
145
|
round: true,
|
|
140
146
|
icon: userIcon,
|
|
141
147
|
default: 'icons:account-circle',
|
|
148
|
+
title: user?.label || 'Профиль',
|
|
149
|
+
rainbow: false,
|
|
142
150
|
style: `color: white; fill: white; background:${userColor}`,
|
|
143
151
|
click: async () => {
|
|
144
152
|
if (WORK?.uid) {
|
|
@@ -157,6 +165,11 @@ export default {
|
|
|
157
165
|
buttons.push({
|
|
158
166
|
round: true,
|
|
159
167
|
icon: 'icons:apps',
|
|
168
|
+
default: '',
|
|
169
|
+
title: 'Главная',
|
|
170
|
+
rainbow: false,
|
|
171
|
+
errorInvert: false,
|
|
172
|
+
style: '',
|
|
160
173
|
click: (e) => {
|
|
161
174
|
e.stopPropagation();
|
|
162
175
|
this.visibleMode = 'main';
|
|
@@ -664,6 +677,52 @@ export default {
|
|
|
664
677
|
this._saveBookmarksState();
|
|
665
678
|
history.replaceState(null, '', window.location.pathname);
|
|
666
679
|
},
|
|
680
|
+
_handleNodeDeleted(detail) {
|
|
681
|
+
const delPath = String(detail?.path || '').replace(/\/+$/, '');
|
|
682
|
+
if (!delPath)
|
|
683
|
+
return;
|
|
684
|
+
const matchesDeleted = (bm) => {
|
|
685
|
+
const s = String(bm?.short || '').replace(/\/+$/, '');
|
|
686
|
+
if (s && (s === delPath || s.startsWith(delPath + '/')))
|
|
687
|
+
return true;
|
|
688
|
+
try {
|
|
689
|
+
const decoded = decodeURI(String(bm?.url || ''));
|
|
690
|
+
return decoded.includes(delPath + '/') || decoded.endsWith(delPath);
|
|
691
|
+
}
|
|
692
|
+
catch {
|
|
693
|
+
return false;
|
|
694
|
+
}
|
|
695
|
+
};
|
|
696
|
+
const currentList = this.bookmarks || [];
|
|
697
|
+
const removed = currentList.filter(matchesDeleted);
|
|
698
|
+
if (removed.length) {
|
|
699
|
+
const focusedWasRemoved = removed.some(b => b.url === this.focusedPage);
|
|
700
|
+
for (const b of removed)
|
|
701
|
+
this.pages.remove(b.url);
|
|
702
|
+
const nextList = currentList.filter(b => !matchesDeleted(b));
|
|
703
|
+
this.bookmarks = nextList;
|
|
704
|
+
if (focusedWasRemoved) {
|
|
705
|
+
const next = nextList.at(-1);
|
|
706
|
+
if (next)
|
|
707
|
+
this.activateBookmark(next);
|
|
708
|
+
else {
|
|
709
|
+
this.focusedPage = '';
|
|
710
|
+
this._saveBookmarksState();
|
|
711
|
+
history.replaceState(null, '', window.location.pathname);
|
|
712
|
+
if (typeof window.execute === 'function' && this.$item)
|
|
713
|
+
window.execute(this.$item);
|
|
714
|
+
}
|
|
715
|
+
}
|
|
716
|
+
else {
|
|
717
|
+
this._saveBookmarksState();
|
|
718
|
+
}
|
|
719
|
+
ODA.showMessage?.('Узел удалён');
|
|
720
|
+
}
|
|
721
|
+
for (const t of this.$$?.('item-tree') || []) {
|
|
722
|
+
t?.$item?.reset?.();
|
|
723
|
+
t?.render?.();
|
|
724
|
+
}
|
|
725
|
+
},
|
|
667
726
|
|
|
668
727
|
load_page(explicitUrl = '') {
|
|
669
728
|
let url = explicitUrl;
|
|
@@ -795,6 +854,10 @@ export default {
|
|
|
795
854
|
this._syncExplorerTreeScope();
|
|
796
855
|
this.render?.();
|
|
797
856
|
});
|
|
857
|
+
if (!this._onNodeDeleted && WORK.chatEvents) {
|
|
858
|
+
this._onNodeDeleted = (ev) => this._handleNodeDeleted(ev?.detail);
|
|
859
|
+
WORK.chatEvents.addEventListener('node.deleted', this._onNodeDeleted);
|
|
860
|
+
}
|
|
798
861
|
window.execute = async ($item, nav) => {
|
|
799
862
|
if (!$item)
|
|
800
863
|
return;
|