odant-work 1.0.80 → 1.0.82
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/#system/package-manifest.json +40 -38
- package/$server/$folder/$class/$structure/handlers/pages/form/calendar/$handler/calendar.js +38 -8
- package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/chat.js +91 -9
- package/$server/$folder/$class/$structure/handlers/pages/form/chat/$handler/video.html +8 -0
- package/$server/$folder/$class/$structure/handlers/pages/form/email/$handler/email.js +95 -8
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/system.js +33 -0
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/database.js +22 -1
- package/$server/$folder/$class/$structure/handlers/pages/form/system/$handler/tabs/messengers.js +7 -7
- package/$server/$folder/$class/handlers/pages/form/object/$handler/object.js +8 -6
- package/$server/$folder/$class/handlers/pages/form/objects/$handler/objects.js +14 -2
- package/$server/$folder/handlers/pages/form/$handler/form.js +47 -6
- package/$server/$folder/lib/calendar-form/calendar-form.js +7 -5
- package/$server/$folder/lib/class-picker/class-picker.js +5 -2
- package/$server/$folder/lib/dialogs/confirm/confirm.js +6 -2
- package/$server/$folder/lib/dialogs/input/input.js +15 -9
- package/$server/$folder/lib/editor-form/editor-form.js +8 -5
- package/$server/$folder/lib/explorer/explorer.js +76 -13
- package/$server/$folder/lib/local-models-transfer/local-models-transfer.js +3 -2
- package/$server/$folder/lib/messenger-settings/messenger-settings.js +4 -4
- package/$server/$folder/lib/prompt-bar/prompt-bar.js +2 -2
- package/$server/$folder/lib/support/support.js +1373 -0
- package/oda/components/containers/containers.js +2 -2
- package/oda/components/containers/popover/popover.js +83 -18
- package/oda/components/inputs/link/link.js +7 -5
- package/oda/components/layouts/app-layout/app-layout.js +33 -10
- package/oda/components/menus/menu/menu.js +2 -2
- package/oda/oda.js +13 -2
- package/oda/tools/styles/styles.js +68 -0
- package/package.json +1 -1
- package/sources/client/folder.js +1 -0
- package/sources/index.html +7 -4
- package/sources/manifest.json +12 -6
- package/sources/modules/support/index.js +414 -0
- package/sources/modules/user-profile/user-profile.js +27 -5
- package/sources/page.html +7 -4
- package/sources/server/access/gateway.js +3 -0
- package/sources/server/class.js +11 -0
- package/sources/tester.html +4 -4
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
icon: 'odant:structure',
|
|
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',
|
|
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
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>
|
|
@@ -13,17 +13,20 @@ export default {
|
|
|
13
13
|
<iframe ~show="focusedPage === $for.item" style="border: none;" flex ~for="pages" :src="$for.item"></iframe>
|
|
14
14
|
</div>
|
|
15
15
|
</div>
|
|
16
|
-
<
|
|
17
|
-
:
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
16
|
+
<div slot="footer" class="pe-no-print" horizontal ~show="hasBookmarks" style="z-index: 2; align-items: center; padding-bottom: var(--safe-bottom, 0px); background: var(--accent-color, var(--header-background));">
|
|
17
|
+
<oda-button ~if="mobile && left_drawer?.closed" accent-invert no-flex icon="icons:menu" title="Навигация" style="margin: 0 2px; flex-shrink: 0;" @tap="left_drawer.closed = false"></oda-button>
|
|
18
|
+
<oda-tabs id="bookmarksBar" flex variant="rail" allow-close allow-drag
|
|
19
|
+
:hidden="!hasBookmarks"
|
|
20
|
+
:items="bookmarkTabItems" :focused-index="bookmarkFocusedIndex"
|
|
21
|
+
@tab-select="onBookmarkSelect($event)"
|
|
22
|
+
@tab-close="onBookmarkClose($event)"
|
|
23
|
+
@close-others="onBookmarkCloseOthers($event)"
|
|
24
|
+
@close-right="onBookmarkCloseRight($event)"
|
|
25
|
+
@close-all="closeAllBookmarks($event)"
|
|
26
|
+
@reorder="onBookmarksReorder($event)"
|
|
27
|
+
style="min-width: 0;">
|
|
28
|
+
</oda-tabs>
|
|
29
|
+
</div>
|
|
27
30
|
`,
|
|
28
31
|
visibleMode: 'main',
|
|
29
32
|
showSize: false,
|
|
@@ -33,7 +36,10 @@ export default {
|
|
|
33
36
|
get hasBookmarks() {
|
|
34
37
|
if (typeof window !== 'undefined' && window !== window.top)
|
|
35
38
|
return false;
|
|
36
|
-
|
|
39
|
+
const ok = Array.isArray(this.bookmarks) && this.bookmarks.length > 0 && this.visibleMode === 'main';
|
|
40
|
+
if (this.left_drawer)
|
|
41
|
+
this.left_drawer.hideBackButton = Boolean(ok && this.mobile);
|
|
42
|
+
return ok;
|
|
37
43
|
},
|
|
38
44
|
get bookmarkTabItems() {
|
|
39
45
|
return (this.bookmarks || []).map(b => ({
|
|
@@ -118,6 +124,20 @@ export default {
|
|
|
118
124
|
},
|
|
119
125
|
});
|
|
120
126
|
}
|
|
127
|
+
if (WORK?.uid) {
|
|
128
|
+
const supPending = Number(this._supportUnread || 0) + Number(this._supportRemotePending || 0);
|
|
129
|
+
buttons.push({
|
|
130
|
+
round: true,
|
|
131
|
+
icon: 'icons:help',
|
|
132
|
+
title: supPending > 0
|
|
133
|
+
? `Служба поддержки (${supPending} уведомл.)`
|
|
134
|
+
: 'Служба поддержки (скриншот, видео, удалённый экран)',
|
|
135
|
+
rainbow: Boolean(this._supportRemotePending > 0 || this._supportUnread > 0),
|
|
136
|
+
click: () => {
|
|
137
|
+
this.openSupportPanel?.();
|
|
138
|
+
},
|
|
139
|
+
});
|
|
140
|
+
}
|
|
121
141
|
buttons.push({
|
|
122
142
|
round: true,
|
|
123
143
|
icon: user?.icon || 'icons:account-circle',
|
|
@@ -158,6 +178,42 @@ export default {
|
|
|
158
178
|
}
|
|
159
179
|
return this.left_buttons;
|
|
160
180
|
},
|
|
181
|
+
_supportUnread: 0,
|
|
182
|
+
_supportRemotePending: 0,
|
|
183
|
+
async openSupportPanel() {
|
|
184
|
+
if (typeof document === 'undefined') return;
|
|
185
|
+
const existing = document.querySelector('work-support-panel');
|
|
186
|
+
if (existing) {
|
|
187
|
+
existing.minimized = false;
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
await ODA.waitReg?.('work-support-panel').catch(() => {});
|
|
191
|
+
const panel = document.createElement('work-support-panel');
|
|
192
|
+
if (this._supportUnread > 0 || this._supportRemotePending > 0)
|
|
193
|
+
panel.activeTab = 'list';
|
|
194
|
+
panel.addEventListener('support-closed', (e) => {
|
|
195
|
+
if (typeof e?.detail?.unreadTotal === 'number') {
|
|
196
|
+
this._supportUnread = e.detail.unreadTotal;
|
|
197
|
+
this._refreshLeftButtons();
|
|
198
|
+
}
|
|
199
|
+
this._refreshSupportBadge();
|
|
200
|
+
});
|
|
201
|
+
document.body.appendChild(panel);
|
|
202
|
+
},
|
|
203
|
+
async _refreshSupportBadge() {
|
|
204
|
+
if (!WORK?.uid || typeof WORK?.fetch !== 'function') return;
|
|
205
|
+
try {
|
|
206
|
+
const res = await WORK.fetch('/', 'support_list');
|
|
207
|
+
const nextUnread = Number(res?.unreadTotal || 0);
|
|
208
|
+
const nextRemote = Number(res?.remoteRequests || 0);
|
|
209
|
+
if (nextUnread !== this._supportUnread || nextRemote !== this._supportRemotePending) {
|
|
210
|
+
this._supportUnread = nextUnread;
|
|
211
|
+
this._supportRemotePending = nextRemote;
|
|
212
|
+
this._refreshLeftButtons();
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
catch { /* ignore */ }
|
|
216
|
+
},
|
|
161
217
|
_onFocusedIndexChanged(e) {
|
|
162
218
|
this.visibleMode = 'main';
|
|
163
219
|
const drawer = this.left_drawer;
|
|
@@ -573,6 +629,8 @@ export default {
|
|
|
573
629
|
this.pages.add(url);
|
|
574
630
|
this.visibleMode = 'main';
|
|
575
631
|
this.focusedPage = url;
|
|
632
|
+
if (this.mobile && this.left_drawer && !this.left_drawer.closed)
|
|
633
|
+
this.left_drawer.closed = true;
|
|
576
634
|
const bm = this._upsertBookmarkForUrl(url);
|
|
577
635
|
if (bm?.stateKey || bm?.short)
|
|
578
636
|
this.syncTreeToPath(bm.stateKey || bm.short);
|
|
@@ -668,10 +726,15 @@ export default {
|
|
|
668
726
|
}
|
|
669
727
|
this._refreshLeftButtons();
|
|
670
728
|
this._initTopLicenseBanner();
|
|
729
|
+
this._refreshSupportBadge();
|
|
730
|
+
if (!this._supportBadgeTimer && typeof window !== 'undefined') {
|
|
731
|
+
this._supportBadgeTimer = setInterval(() => this._refreshSupportBadge(), 60_000);
|
|
732
|
+
}
|
|
671
733
|
WORK.authEvents?.addEventListener('auth', () => {
|
|
672
734
|
this.user_icon = undefined;
|
|
673
735
|
this._refreshLeftButtons();
|
|
674
736
|
this._initTopLicenseBanner();
|
|
737
|
+
this._refreshSupportBadge();
|
|
675
738
|
this.render?.();
|
|
676
739
|
});
|
|
677
740
|
window.execute = async ($item, nav) => {
|
|
@@ -8,8 +8,9 @@ const TRANSFER_STYLE = /*css*/`
|
|
|
8
8
|
@apply --vertical;
|
|
9
9
|
gap: 12px;
|
|
10
10
|
padding: 14px 18px;
|
|
11
|
-
width: min(820px,
|
|
12
|
-
max-
|
|
11
|
+
width: min(820px, calc(100vw - 24px));
|
|
12
|
+
max-width: 100%;
|
|
13
|
+
max-height: 78dvh;
|
|
13
14
|
overflow-y: auto;
|
|
14
15
|
box-sizing: border-box;
|
|
15
16
|
background: var(--content-background, #ffffff);
|
|
@@ -59,7 +59,7 @@ export const MESSENGER_SETTINGS_DEF = {
|
|
|
59
59
|
font-size: 12px;
|
|
60
60
|
font-weight: 600;
|
|
61
61
|
color: var(--muted-color);
|
|
62
|
-
min-width:
|
|
62
|
+
min-width: min(120px, 100%);
|
|
63
63
|
}
|
|
64
64
|
.badge {
|
|
65
65
|
display: inline-flex;
|
|
@@ -186,7 +186,7 @@ export const MESSENGER_SETTINGS_DEF = {
|
|
|
186
186
|
</div>
|
|
187
187
|
<span ~if="!currentUser?.telegram" class="muted">не привязан</span>
|
|
188
188
|
|
|
189
|
-
<span class="field-label" style="min-width: 70px;
|
|
189
|
+
<span class="field-label" style="min-width: 70px;">MAX:</span>
|
|
190
190
|
<div ~if="currentUser?.max" class="chip">
|
|
191
191
|
<span>Привязан: {{currentUser.max.username || currentUser.max.firstName || currentUser.max.chatId}}</span>
|
|
192
192
|
<span style="cursor:pointer; font-weight:bold;" title="Отвязать MAX" @tap="unbind('user', 'max')">×</span>
|
|
@@ -225,11 +225,11 @@ export const MESSENGER_SETTINGS_DEF = {
|
|
|
225
225
|
<option value="max">MAX Bot API</option>
|
|
226
226
|
</select>
|
|
227
227
|
<span class="field-label" style="min-width: 110px;">Название бота:</span>
|
|
228
|
-
<input type="text" placeholder="Например: Бот Маслоторг" :value="draftBotLabel" @input="draftBotLabel = $event.target.value" style="min-width:
|
|
228
|
+
<input type="text" placeholder="Например: Бот Маслоторг" :value="draftBotLabel" @input="draftBotLabel = $event.target.value" style="min-width: 140px; flex: 1 1 160px; max-width: 100%; box-sizing: border-box;">
|
|
229
229
|
</div>
|
|
230
230
|
<div class="row">
|
|
231
231
|
<span class="field-label">Токен бота:</span>
|
|
232
|
-
<input type="password" :placeholder="ownBot?.tokenMask ? 'Сохранён (' + ownBot.tokenMask + ') — введите новый для замены' : 'Токен от @BotFather или MAX'" :value="draftBotToken" @input="draftBotToken = $event.target.value" style="min-width:
|
|
232
|
+
<input type="password" :placeholder="ownBot?.tokenMask ? 'Сохранён (' + ownBot.tokenMask + ') — введите новый для замены' : 'Токен от @BotFather или MAX'" :value="draftBotToken" @input="draftBotToken = $event.target.value" style="min-width: 160px; flex: 1 1 200px; max-width: 100%; box-sizing: border-box;">
|
|
233
233
|
<span class="field-label" style="min-width: 90px;">@username:</span>
|
|
234
234
|
<input type="text" placeholder="авто или имя_бота" :value="draftBotUsername" @input="draftBotUsername = $event.target.value" style="width: 150px;">
|
|
235
235
|
</div>
|
|
@@ -364,11 +364,11 @@ ODA({ is: 'work-prompt-bar',
|
|
|
364
364
|
.file oda-button { padding: 0; border-radius: 50%; }
|
|
365
365
|
textarea {
|
|
366
366
|
border: none; outline: none; resize: none; background: transparent; color: inherit;
|
|
367
|
-
font: inherit; font-size: 15px; line-height: 1.5; padding: 12px 16px 4px; height: 24px; max-height:
|
|
367
|
+
font: inherit; font-size: 15px; line-height: 1.5; padding: 12px 16px 4px; height: 24px; max-height: 36dvh;
|
|
368
368
|
overflow-y: auto; box-sizing: content-box;
|
|
369
369
|
}
|
|
370
370
|
textarea::placeholder { color: var(--muted-color, inherit); opacity: .8; }
|
|
371
|
-
.row { @apply --horizontal; align-items: center; gap: 4px; padding: 6px 8px 8px; min-width: 0; }
|
|
371
|
+
.row { @apply --horizontal; align-items: center; flex-wrap: wrap; gap: 4px; padding: 6px 8px 8px; min-width: 0; }
|
|
372
372
|
.pill {
|
|
373
373
|
@apply --horizontal; align-items: center; gap: 4px; height: 30px; padding: 0 10px; border-radius: 999px; flex-shrink: 1; min-width: 0;
|
|
374
374
|
border: none; background: transparent; color: inherit; fill: currentColor; font: inherit; font-size: small; cursor: pointer; white-space: nowrap;
|