@olares/lares-mobile 0.15.34 → 0.15.36
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/package.json +2 -2
- package/src/App.vue +4 -1
- package/src/chat/ApprovalCard.vue +138 -0
- package/src/chat/ChatBar.vue +1 -1
- package/src/chat/Composer.vue +1 -1
- package/src/desktop/DesktopComposer.vue +10 -26
- package/src/desktop/DesktopQueue.vue +5 -1
- package/src/mobile/MobileDirectorySheet.vue +1 -1
- package/src/mobile/MobileNewSession.vue +1 -1
- package/src/mobile/MobileShell.vue +127 -3
- package/src/settings/SettingRow.vue +20 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olares/lares-mobile",
|
|
3
|
-
"version": "0.15.
|
|
3
|
+
"version": "0.15.36",
|
|
4
4
|
"description": "Lares chat component for LarePass",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
"vue": "^3.2.0"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@olares/lares-core": "0.15.
|
|
31
|
+
"@olares/lares-core": "0.15.36",
|
|
32
32
|
"markdown-it": "^14.3.0"
|
|
33
33
|
}
|
|
34
34
|
}
|
package/src/App.vue
CHANGED
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
@hold-start="onHoldStart"
|
|
93
93
|
@voice-action="onVoiceAction"
|
|
94
94
|
@close-model="modelSheet = false"
|
|
95
|
+
@choose-permission="choosePermission"
|
|
95
96
|
@choose-model="chooseModel"
|
|
96
97
|
@close-effort="effortSheet = false"
|
|
97
98
|
@choose-effort="chooseEffort"
|
|
@@ -102,6 +103,7 @@
|
|
|
102
103
|
@pick-command="pickCommand"
|
|
103
104
|
@toggle-speak="toggleSpeak"
|
|
104
105
|
@dismiss-speak="speakNotice = ''"
|
|
106
|
+
@answer-approval="answerApproval"
|
|
105
107
|
/>
|
|
106
108
|
<LaresVoicePanel v-if="voicePanelState" :view="voicePanelState" :t="t"
|
|
107
109
|
@close="runVoicePanel('close')" @edit="voicePanel.edit($event)" @preset="voicePanel.selectPreset($event, true).catch(() => {})"
|
|
@@ -154,6 +156,7 @@ import {
|
|
|
154
156
|
effortSwitchSelection,
|
|
155
157
|
} from "@olares/lares-core/router/session-model";
|
|
156
158
|
import { messageFromCode } from "@olares/lares-core/i18n/t";
|
|
159
|
+
import { presentApproval } from "@olares/lares-core/larepass/approval";
|
|
157
160
|
import { parseAskUserQuestions, singleSelectAnswer } from "@olares/lares-core/larepass/questions";
|
|
158
161
|
import { applyCommand } from "@olares/lares-core/larepass/commands";
|
|
159
162
|
import { permissionOption, presetDescription, presetLabel } from "@olares/lares-core/larepass/permissions";
|
|
@@ -785,7 +788,7 @@ export default {
|
|
|
785
788
|
this.queue = snap.queue ?? [];
|
|
786
789
|
this.question = snap.question || null;
|
|
787
790
|
if (!this.question) this.questionBusy = false;
|
|
788
|
-
this.approval = snap.approval
|
|
791
|
+
this.approval = presentApproval(snap.approval, snap.items, this.locale);
|
|
789
792
|
if (!this.approval) this.approvalBusy = false;
|
|
790
793
|
if (this.pendingUser && snap.items.some((row) => row.type === "user" && row.text === this.pendingUser)) {
|
|
791
794
|
this.pendingUser = "";
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section
|
|
3
|
+
class="lares-approval"
|
|
4
|
+
:aria-busy="busy ? 'true' : 'false'"
|
|
5
|
+
@keydown="onKeydown"
|
|
6
|
+
>
|
|
7
|
+
<div class="lares-approval__strip">
|
|
8
|
+
<span aria-hidden="true" />
|
|
9
|
+
{{ t("approval.waiting") }}
|
|
10
|
+
</div>
|
|
11
|
+
<div
|
|
12
|
+
class="lares-approval__body"
|
|
13
|
+
tabindex="0"
|
|
14
|
+
role="group"
|
|
15
|
+
:aria-label="t('approval.detail')"
|
|
16
|
+
>
|
|
17
|
+
<p class="lares-approval__headline">{{ headline }}</p>
|
|
18
|
+
<p v-if="approval.command" class="lares-approval__command">{{ approval.command }}</p>
|
|
19
|
+
</div>
|
|
20
|
+
<div class="lares-approval__actions">
|
|
21
|
+
<button type="button" :disabled="busy" @click="$emit('answer', 'rejected')">
|
|
22
|
+
{{ t("approval.reject") }}
|
|
23
|
+
</button>
|
|
24
|
+
<button type="button" :disabled="busy" @click="$emit('answer', 'allowed-once')">
|
|
25
|
+
{{ t("approval.allowOnce") }}
|
|
26
|
+
</button>
|
|
27
|
+
</div>
|
|
28
|
+
</section>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<script>
|
|
32
|
+
export default {
|
|
33
|
+
name: "LaresApprovalCard",
|
|
34
|
+
props: {
|
|
35
|
+
approval: { type: Object, required: true },
|
|
36
|
+
busy: { type: Boolean, default: false },
|
|
37
|
+
t: { type: Function, required: true },
|
|
38
|
+
},
|
|
39
|
+
emits: ["answer"],
|
|
40
|
+
computed: {
|
|
41
|
+
headline() {
|
|
42
|
+
return this.approval.reason || this.t("approval.escalation", { toolName: this.approval.toolName });
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
methods: {
|
|
46
|
+
onKeydown(event) {
|
|
47
|
+
const target = event.target;
|
|
48
|
+
if (event.defaultPrevented || this.busy) return;
|
|
49
|
+
if (event.key !== "Enter" && event.key !== "Escape") return;
|
|
50
|
+
if (target?.closest?.("input, textarea, select, [contenteditable='true']")) return;
|
|
51
|
+
if (event.key === "Enter" && target?.closest?.("button, a[href], [role='button']")) return;
|
|
52
|
+
if (event.ctrlKey || event.metaKey || event.altKey || event.shiftKey || event.repeat) return;
|
|
53
|
+
event.preventDefault();
|
|
54
|
+
this.$emit("answer", event.key === "Enter" ? "allowed-once" : "rejected");
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
</script>
|
|
59
|
+
|
|
60
|
+
<style scoped>
|
|
61
|
+
.lares-approval {
|
|
62
|
+
overflow: hidden;
|
|
63
|
+
border: 1px solid var(--q-orange-default);
|
|
64
|
+
border-radius: 14px;
|
|
65
|
+
background: var(--q-background-1);
|
|
66
|
+
box-shadow: 0 1px 3px rgb(0 0 0 / 8%);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.lares-approval__strip {
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
72
|
+
gap: 8px;
|
|
73
|
+
padding: 10px 16px;
|
|
74
|
+
background: var(--q-orange-alpha);
|
|
75
|
+
color: var(--q-orange-default);
|
|
76
|
+
font-size: 13px;
|
|
77
|
+
line-height: 18px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.lares-approval__strip span {
|
|
81
|
+
width: 6px;
|
|
82
|
+
height: 6px;
|
|
83
|
+
flex: none;
|
|
84
|
+
border-radius: 50%;
|
|
85
|
+
background: var(--q-orange-default);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.lares-approval__body {
|
|
89
|
+
display: flex;
|
|
90
|
+
max-height: 160px;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
gap: 6px;
|
|
93
|
+
overflow-y: auto;
|
|
94
|
+
padding: 12px 16px 0;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.lares-approval__headline {
|
|
98
|
+
margin: 0;
|
|
99
|
+
color: var(--q-ink-1);
|
|
100
|
+
font-size: 15px;
|
|
101
|
+
font-weight: 500;
|
|
102
|
+
line-height: 24px;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.lares-approval__command {
|
|
106
|
+
margin: 0;
|
|
107
|
+
color: var(--q-ink-3);
|
|
108
|
+
font: 400 13px/20px ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
109
|
+
word-break: break-all;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.lares-approval__actions {
|
|
113
|
+
display: flex;
|
|
114
|
+
justify-content: flex-end;
|
|
115
|
+
gap: 8px;
|
|
116
|
+
padding: 14px 16px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.lares-approval__actions button {
|
|
120
|
+
height: 32px;
|
|
121
|
+
border: 1px solid var(--q-separator);
|
|
122
|
+
border-radius: 7px;
|
|
123
|
+
padding: 0 13px;
|
|
124
|
+
background: transparent;
|
|
125
|
+
color: var(--q-ink-2);
|
|
126
|
+
font: inherit;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.lares-approval__actions button:last-child {
|
|
130
|
+
border-color: transparent;
|
|
131
|
+
background: var(--q-blue-default);
|
|
132
|
+
color: var(--q-ink-on-brand);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.lares-approval__actions button:disabled {
|
|
136
|
+
opacity: 0.45;
|
|
137
|
+
}
|
|
138
|
+
</style>
|
package/src/chat/ChatBar.vue
CHANGED
package/src/chat/Composer.vue
CHANGED
|
@@ -139,23 +139,14 @@
|
|
|
139
139
|
</div>
|
|
140
140
|
|
|
141
141
|
<Transition name="lares-panel" mode="out-in">
|
|
142
|
-
<
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
<div class="desktop-composer__approval-actions">
|
|
151
|
-
<button type="button" :disabled="state.approvalBusy" @click="$emit('answer-approval', 'rejected')">
|
|
152
|
-
{{ t("approval.reject") }}
|
|
153
|
-
</button>
|
|
154
|
-
<button type="button" :disabled="state.approvalBusy" @click="$emit('answer-approval', 'allowed-once')">
|
|
155
|
-
{{ t("approval.allowOnce") }}
|
|
156
|
-
</button>
|
|
157
|
-
</div>
|
|
158
|
-
</div>
|
|
142
|
+
<LaresApprovalCard
|
|
143
|
+
v-if="state.approval"
|
|
144
|
+
key="approval"
|
|
145
|
+
:approval="state.approval"
|
|
146
|
+
:busy="state.approvalBusy"
|
|
147
|
+
:t="t"
|
|
148
|
+
@answer="$emit('answer-approval', $event)"
|
|
149
|
+
/>
|
|
159
150
|
<LaresDesktopQuestions
|
|
160
151
|
v-else-if="state.question?.questions?.length"
|
|
161
152
|
key="questions"
|
|
@@ -480,6 +471,7 @@ import { DEFAULT_WORKSPACE_TITLE } from "@olares/lares-core/workspace/constants"
|
|
|
480
471
|
import { activeReferenceToken, insertReference } from "@olares/lares-core/larepass/references";
|
|
481
472
|
import { draftImageStatus } from "@olares/lares-core/files/draft-images";
|
|
482
473
|
import LaresVoiceInput from "../chat/VoiceInput.vue";
|
|
474
|
+
import LaresApprovalCard from "../chat/ApprovalCard.vue";
|
|
483
475
|
import LaresDesktopQueue from "./DesktopQueue.vue";
|
|
484
476
|
import LaresDesktopQuestions from "./DesktopQuestions.vue";
|
|
485
477
|
import LaresDesktopContextMeter from "./DesktopContextMeter.vue";
|
|
@@ -542,7 +534,7 @@ const PermissionIcon = {
|
|
|
542
534
|
|
|
543
535
|
export default {
|
|
544
536
|
name: "LaresDesktopComposer",
|
|
545
|
-
components: { LaresVoiceInput, LaresDesktopContextMeter, LaresDesktopGoal, LaresDesktopQuestions, LaresDesktopQueue, LaresDesktopTodos, LaresPcDialog, LaresPcPopover, LaresPcTooltip, ChevronIcon, CheckIcon, PlusIcon, PaperclipIcon, ArrowIcon, StopIcon, CloseIcon, MicIcon, PermissionIcon },
|
|
537
|
+
components: { LaresApprovalCard, LaresVoiceInput, LaresDesktopContextMeter, LaresDesktopGoal, LaresDesktopQuestions, LaresDesktopQueue, LaresDesktopTodos, LaresPcDialog, LaresPcPopover, LaresPcTooltip, ChevronIcon, CheckIcon, PlusIcon, PaperclipIcon, ArrowIcon, StopIcon, CloseIcon, MicIcon, PermissionIcon },
|
|
546
538
|
props: {
|
|
547
539
|
state: { type: Object, required: true },
|
|
548
540
|
t: { type: Function, required: true },
|
|
@@ -959,14 +951,6 @@ export default {
|
|
|
959
951
|
.desktop-composer__reference-item[data-selected="true"] { background:var(--q-background-hover); }
|
|
960
952
|
.desktop-composer__reference-name { max-width:40%; flex:none; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
|
|
961
953
|
.desktop-composer__reference-path { min-width:0; flex:1; overflow:hidden; color:var(--q-ink-3); text-overflow:ellipsis; white-space:nowrap; }
|
|
962
|
-
.desktop-composer__approval { overflow:hidden; border:1px solid var(--q-separator); border-radius:14px; background:var(--q-background-2); box-shadow:0 1px 3px rgb(0 0 0 / 8%); }
|
|
963
|
-
.desktop-composer__approval-strip { display:flex; height:30px; align-items:center; gap:7px; padding:0 12px; background:var(--q-background-3); color:var(--q-ink-3); font-size:12px; }
|
|
964
|
-
.desktop-composer__approval-strip span { width:6px; height:6px; border-radius:50%; background:var(--q-orange-default); }
|
|
965
|
-
.desktop-composer__approval-body { max-height:96px; overflow:auto; padding:14px 16px; color:var(--q-ink-1); font-size:14px; line-height:20px; }
|
|
966
|
-
.desktop-composer__approval-actions { display:flex; justify-content:flex-end; gap:8px; padding:8px 12px 12px; }
|
|
967
|
-
.desktop-composer__approval-actions button { height:32px; border:1px solid var(--q-separator); border-radius:7px; padding:0 13px; background:transparent; color:var(--q-ink-2); font:inherit; cursor:pointer; }
|
|
968
|
-
.desktop-composer__approval-actions button:last-child { border-color:transparent; background:var(--q-blue-default); color:var(--q-ink-on-brand); }
|
|
969
|
-
.desktop-composer__approval-actions button:disabled { opacity:.45; cursor:default; }
|
|
970
954
|
.desktop-composer__attachments { display:flex; gap:8px; overflow-x:auto; padding:0 0 8px 2px; }
|
|
971
955
|
.desktop-composer__attachments figure { position:relative; width:64px; height:64px; flex:0 0 64px; overflow:hidden; margin:0; border:1px solid var(--q-separator); border-radius:9px; background:var(--q-background-3); }
|
|
972
956
|
.desktop-composer__attachments img { width:100%; height:100%; object-fit:cover; transition:opacity .22s ease; }
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div v-if="rows.length" class="desktop-queue lares-queue-in">
|
|
2
|
+
<div v-if="rows.length" class="desktop-queue lares-queue-in" :data-tone="tone">
|
|
3
3
|
<div class="desktop-queue__panel">
|
|
4
4
|
<button
|
|
5
5
|
v-if="rows.length > 1"
|
|
@@ -128,6 +128,7 @@ export default {
|
|
|
128
128
|
items: { type: Array, default: () => [] },
|
|
129
129
|
running: { type: Boolean, default: false },
|
|
130
130
|
busy: { type: String, default: "" },
|
|
131
|
+
tone: { type: String, default: "" },
|
|
131
132
|
t: { type: Function, required: true },
|
|
132
133
|
},
|
|
133
134
|
emits: ["action"],
|
|
@@ -198,4 +199,7 @@ export default {
|
|
|
198
199
|
:deep(.desktop-queue__action:disabled) { opacity:.45; cursor:default; }
|
|
199
200
|
.desktop-queue svg,
|
|
200
201
|
:deep(.desktop-queue__action svg) { width:16px; height:16px; fill:none; stroke:currentColor; stroke-width:1.4; stroke-linecap:round; stroke-linejoin:round; }
|
|
202
|
+
.desktop-queue[data-tone="mobile"] { width:auto; margin:0 16px 8px; padding:0; }
|
|
203
|
+
.desktop-queue[data-tone="mobile"] .desktop-queue__panel { border-bottom:1px solid var(--q-separator); border-radius:14px; }
|
|
204
|
+
.desktop-queue[data-tone="mobile"] :deep(.desktop-queue__action) { width:36px; height:36px; }
|
|
201
205
|
</style>
|
|
@@ -146,7 +146,7 @@ export default {
|
|
|
146
146
|
.mobile-directory__status,
|
|
147
147
|
.mobile-directory__error { margin:16px 8px; color:var(--q-ink-3); font-size:15px; text-align:center; }
|
|
148
148
|
.mobile-directory__error { color:var(--q-orange-default); }
|
|
149
|
-
.mobile-directory__footer { display:flex; flex-direction:column; gap:10px; padding:12px 20px
|
|
149
|
+
.mobile-directory__footer { display:flex; flex-direction:column; gap:10px; padding:12px 20px; border-top:1px solid var(--q-separator); }
|
|
150
150
|
.mobile-directory__path { width:100%; margin:0; overflow:hidden; color:var(--q-ink-3); font-size:13px; text-overflow:ellipsis; white-space:nowrap; }
|
|
151
151
|
.mobile-directory__tools { display:flex; flex-wrap:wrap; align-items:center; gap:10px 14px; }
|
|
152
152
|
.mobile-directory__new-folder { display:inline-flex; align-items:center; gap:6px; border:1px solid var(--q-separator); border-radius:999px; padding:0 12px; min-height:36px; background:transparent; color:var(--q-ink-2); font:inherit; font-size:14px; }
|
|
@@ -130,13 +130,23 @@
|
|
|
130
130
|
@answer="forwardAnswer"
|
|
131
131
|
/>
|
|
132
132
|
<LaresDesktopQueue
|
|
133
|
+
tone="mobile"
|
|
133
134
|
:items="state.queue"
|
|
134
135
|
:running="state.running"
|
|
135
136
|
:busy="state.queueBusy"
|
|
136
137
|
:t="t"
|
|
137
138
|
@action="(itemId, action) => $emit('queue-action', itemId, action)"
|
|
138
139
|
/>
|
|
140
|
+
<div v-if="state.approval" class="lares-mobile-shell__approval">
|
|
141
|
+
<LaresApprovalCard
|
|
142
|
+
:approval="state.approval"
|
|
143
|
+
:busy="state.approvalBusy"
|
|
144
|
+
:t="t"
|
|
145
|
+
@answer="$emit('answer-approval', $event)"
|
|
146
|
+
/>
|
|
147
|
+
</div>
|
|
139
148
|
<LaresComposer
|
|
149
|
+
v-else
|
|
140
150
|
ref="composer"
|
|
141
151
|
:draft="state.draft"
|
|
142
152
|
:sending="state.sending"
|
|
@@ -202,6 +212,33 @@
|
|
|
202
212
|
@click="$emit('choose-effort', row.id)"
|
|
203
213
|
/>
|
|
204
214
|
</template>
|
|
215
|
+
<template v-if="state.permissionRows.length">
|
|
216
|
+
<p class="lares-shell__heading">{{ t("permission.title") }}</p>
|
|
217
|
+
<LaresSettingRow
|
|
218
|
+
v-for="row in state.permissionRows"
|
|
219
|
+
:key="row.value"
|
|
220
|
+
:label="row.label"
|
|
221
|
+
:hint="row.hint"
|
|
222
|
+
:checked="row.value === state.permissionCurrent"
|
|
223
|
+
:disabled="state.permissionBusy"
|
|
224
|
+
@click="pickPermission(row.value)"
|
|
225
|
+
/>
|
|
226
|
+
<div v-if="accessConfirm" class="lares-shell__access">
|
|
227
|
+
<p>{{ t("access.confirm.description") }}</p>
|
|
228
|
+
<label>
|
|
229
|
+
<input v-model="accessAcknowledged" type="checkbox" />
|
|
230
|
+
<span>{{ t("access.confirm.acknowledge") }}</span>
|
|
231
|
+
</label>
|
|
232
|
+
<div class="lares-shell__access-actions">
|
|
233
|
+
<button type="button" @click="cancelAccess">{{ t("access.confirm.cancel") }}</button>
|
|
234
|
+
<button
|
|
235
|
+
type="button"
|
|
236
|
+
:disabled="!accessAcknowledged || state.permissionBusy"
|
|
237
|
+
@click="confirmAccess"
|
|
238
|
+
>{{ t("access.confirm.enable") }}</button>
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
</template>
|
|
205
242
|
<template #footer>
|
|
206
243
|
<button type="button" class="lares-shell__refresh" @click="state.refreshModels()">{{ t('agent.refresh') }}</button>
|
|
207
244
|
</template>
|
|
@@ -231,6 +268,7 @@
|
|
|
231
268
|
import LaresChatBar from "../chat/ChatBar.vue";
|
|
232
269
|
import LaresHistoryPanel from "../chat/HistoryPanel.vue";
|
|
233
270
|
import LaresTranscript from "../chat/Transcript.vue";
|
|
271
|
+
import LaresApprovalCard from "../chat/ApprovalCard.vue";
|
|
234
272
|
import LaresComposer from "../chat/Composer.vue";
|
|
235
273
|
import LaresDesktopQueue from "../desktop/DesktopQueue.vue";
|
|
236
274
|
import LaresPreview from "../preview/Preview.vue";
|
|
@@ -245,6 +283,7 @@ export default {
|
|
|
245
283
|
LaresChatBar,
|
|
246
284
|
LaresHistoryPanel,
|
|
247
285
|
LaresTranscript,
|
|
286
|
+
LaresApprovalCard,
|
|
248
287
|
LaresComposer,
|
|
249
288
|
LaresDesktopQueue,
|
|
250
289
|
LaresPreview,
|
|
@@ -266,9 +305,9 @@ export default {
|
|
|
266
305
|
},
|
|
267
306
|
emits: [
|
|
268
307
|
"history", "create", "toggle-speak", "close-history", "pick-session", "retry", "open-file",
|
|
269
|
-
"answer", "update-draft", "send", "queue-action", "open-model", "open-effort", "files",
|
|
308
|
+
"answer", "answer-approval", "update-draft", "send", "queue-action", "open-model", "open-effort", "files",
|
|
270
309
|
"voice", "voice-action", "hold-start", "hold-end", "close-model", "choose-model",
|
|
271
|
-
"close-effort", "choose-effort", "close-preview",
|
|
310
|
+
"close-effort", "choose-effort", "choose-permission", "close-preview",
|
|
272
311
|
"open-commands", "open-references", "pick-command", "remove-image",
|
|
273
312
|
"refresh-workspaces", "browse-workspaces", "browse-directory",
|
|
274
313
|
"close-directory", "choose-directory", "create-folder", "toggle-hidden",
|
|
@@ -277,7 +316,12 @@ export default {
|
|
|
277
316
|
"dismiss-speak",
|
|
278
317
|
],
|
|
279
318
|
data() {
|
|
280
|
-
return { composerMode: "text" };
|
|
319
|
+
return { composerMode: "text", accessConfirm: false, accessAcknowledged: false };
|
|
320
|
+
},
|
|
321
|
+
watch: {
|
|
322
|
+
"state.modelSheet"(open) {
|
|
323
|
+
if (!open) this.cancelAccess();
|
|
324
|
+
},
|
|
281
325
|
},
|
|
282
326
|
computed: {
|
|
283
327
|
newSessionHero() {
|
|
@@ -295,6 +339,25 @@ export default {
|
|
|
295
339
|
},
|
|
296
340
|
},
|
|
297
341
|
methods: {
|
|
342
|
+
pickPermission(value) {
|
|
343
|
+
if (!value || value === this.state.permissionCurrent || this.state.permissionBusy) return;
|
|
344
|
+
if (value === "danger-full-access") {
|
|
345
|
+
this.accessAcknowledged = false;
|
|
346
|
+
this.accessConfirm = true;
|
|
347
|
+
return;
|
|
348
|
+
}
|
|
349
|
+
this.cancelAccess();
|
|
350
|
+
this.$emit("choose-permission", value);
|
|
351
|
+
},
|
|
352
|
+
cancelAccess() {
|
|
353
|
+
this.accessConfirm = false;
|
|
354
|
+
this.accessAcknowledged = false;
|
|
355
|
+
},
|
|
356
|
+
confirmAccess() {
|
|
357
|
+
if (!this.accessAcknowledged || this.state.permissionBusy) return;
|
|
358
|
+
this.cancelAccess();
|
|
359
|
+
this.$emit("choose-permission", "danger-full-access");
|
|
360
|
+
},
|
|
298
361
|
forwardAnswer(label, row) {
|
|
299
362
|
this.$emit("answer", label, row);
|
|
300
363
|
},
|
|
@@ -335,6 +398,11 @@ export default {
|
|
|
335
398
|
flex-direction: column;
|
|
336
399
|
}
|
|
337
400
|
|
|
401
|
+
.lares-mobile-shell__approval {
|
|
402
|
+
flex: none;
|
|
403
|
+
margin: 0 16px 12px;
|
|
404
|
+
}
|
|
405
|
+
|
|
338
406
|
.lares-shell__status,
|
|
339
407
|
.lares-shell__hint {
|
|
340
408
|
margin: 0 20px;
|
|
@@ -417,4 +485,60 @@ export default {
|
|
|
417
485
|
font-weight: 500;
|
|
418
486
|
line-height: 18px;
|
|
419
487
|
}
|
|
488
|
+
|
|
489
|
+
.lares-shell__access {
|
|
490
|
+
display: flex;
|
|
491
|
+
flex-direction: column;
|
|
492
|
+
gap: 12px;
|
|
493
|
+
margin: 8px 16px 16px;
|
|
494
|
+
padding: 12px;
|
|
495
|
+
border-radius: 12px;
|
|
496
|
+
background: var(--q-background-3);
|
|
497
|
+
color: var(--q-ink-2);
|
|
498
|
+
font-size: 14px;
|
|
499
|
+
line-height: 20px;
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
.lares-shell__access p {
|
|
503
|
+
margin: 0;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
.lares-shell__access label {
|
|
507
|
+
display: flex;
|
|
508
|
+
align-items: flex-start;
|
|
509
|
+
gap: 8px;
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
.lares-shell__access input {
|
|
513
|
+
width: 18px;
|
|
514
|
+
height: 18px;
|
|
515
|
+
flex: none;
|
|
516
|
+
margin: 1px 0 0;
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
.lares-shell__access-actions {
|
|
520
|
+
display: flex;
|
|
521
|
+
justify-content: flex-end;
|
|
522
|
+
gap: 8px;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
.lares-shell__access-actions button {
|
|
526
|
+
border: 0;
|
|
527
|
+
border-radius: 8px;
|
|
528
|
+
padding: 8px 12px;
|
|
529
|
+
background: transparent;
|
|
530
|
+
color: var(--q-ink-2);
|
|
531
|
+
font: inherit;
|
|
532
|
+
font-size: 14px;
|
|
533
|
+
font-weight: 600;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
.lares-shell__access-actions button:last-child {
|
|
537
|
+
background: var(--q-blue-alpha);
|
|
538
|
+
color: var(--q-blue-default);
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.lares-shell__access-actions button:disabled {
|
|
542
|
+
opacity: 0.45;
|
|
543
|
+
}
|
|
420
544
|
</style>
|
|
@@ -6,7 +6,10 @@
|
|
|
6
6
|
:disabled="disabled"
|
|
7
7
|
@click="$emit('click')"
|
|
8
8
|
>
|
|
9
|
-
<span class="lares-set-
|
|
9
|
+
<span class="lares-set-row__copy">
|
|
10
|
+
<span class="lares-set-row__label">{{ label }}</span>
|
|
11
|
+
<span v-if="hint" class="lares-set-row__hint">{{ hint }}</span>
|
|
12
|
+
</span>
|
|
10
13
|
<span class="lares-set-row__side">
|
|
11
14
|
<span v-if="value" class="lares-set-row__value">{{ value }}</span>
|
|
12
15
|
<svg v-if="chevron" class="lares-set-row__icon" viewBox="0 0 24 24" aria-hidden="true">
|
|
@@ -29,6 +32,7 @@ export default {
|
|
|
29
32
|
name: "LaresSettingRow",
|
|
30
33
|
props: {
|
|
31
34
|
label: { type: String, required: true },
|
|
35
|
+
hint: { type: String, default: "" },
|
|
32
36
|
value: { type: String, default: "" },
|
|
33
37
|
chevron: { type: Boolean, default: false },
|
|
34
38
|
checked: { type: Boolean, default: false },
|
|
@@ -73,14 +77,28 @@ export default {
|
|
|
73
77
|
background: var(--q-background-hover);
|
|
74
78
|
}
|
|
75
79
|
|
|
76
|
-
.lares-set-
|
|
80
|
+
.lares-set-row__copy {
|
|
81
|
+
display: flex;
|
|
77
82
|
min-width: 0;
|
|
78
83
|
flex: 1;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
gap: 2px;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.lares-set-row__label {
|
|
89
|
+
min-width: 0;
|
|
79
90
|
font-size: 16px;
|
|
80
91
|
line-height: 22px;
|
|
81
92
|
word-break: break-word;
|
|
82
93
|
}
|
|
83
94
|
|
|
95
|
+
.lares-set-row__hint {
|
|
96
|
+
color: var(--q-ink-3);
|
|
97
|
+
font-size: 13px;
|
|
98
|
+
line-height: 18px;
|
|
99
|
+
word-break: break-word;
|
|
100
|
+
}
|
|
101
|
+
|
|
84
102
|
.lares-set-row__side {
|
|
85
103
|
display: flex;
|
|
86
104
|
flex-shrink: 0;
|