Skip to content

Commit e0aa8d3

Browse files
committed
fix: clarify local file access menu descriptions
1 parent e004426 commit e0aa8d3

7 files changed

Lines changed: 117 additions & 25 deletions

File tree

‎dashboard/src/components/shared/LocalPermissionMatrix.vue‎

Lines changed: 77 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
variant="outlined"
6868
density="compact"
6969
:color="accessModes[role] === 'full' ? 'warning' : 'primary'"
70-
:menu-props="{ rounded: 'lg' }"
70+
:menu-props="{ rounded: 'lg', maxWidth: 420 }"
7171
@update:model-value="updatePermission(role, accessPolicies[$event])"
7272
>
7373
<template #prepend-inner>
@@ -80,10 +80,34 @@
8080
/>
8181
</template>
8282
<template #item="{ props: itemProps, item }">
83-
<v-list-item v-bind="itemProps" role="option" :aria-selected="accessModes[role] === item.value">
83+
<v-list-item v-bind="itemProps" :lines="false" role="option" :aria-selected="accessModes[role] === item.value">
8484
<template #prepend>
8585
<component :is="accessIcons[item.value]" :size="18" class="mr-3" aria-hidden="true" />
8686
</template>
87+
<template #subtitle>
88+
<div class="scope-hint">
89+
{{ tm(item.value === 'none' ? 'scopeHints.none' : 'scopeHints.host') }}
90+
<v-menu
91+
v-if="item.value !== 'none'"
92+
open-on-hover
93+
open-on-click
94+
open-on-focus
95+
:close-on-content-click="false"
96+
location="top"
97+
:max-width="360"
98+
>
99+
<template #activator="{ props: helpProps }">
100+
<button v-bind="helpProps" type="button" class="scope-help" :aria-label="tm('filesystem')" @click.stop>
101+
<CircleHelp :size="14" aria-hidden="true" />
102+
</button>
103+
</template>
104+
<v-card class="pa-3 text-body-2">
105+
<div>{{ tm('scopeDetails.account') }}</div>
106+
<div class="mt-2">{{ tm('scopeDetails.docker') }}</div>
107+
</v-card>
108+
</v-menu>
109+
</div>
110+
</template>
87111
</v-list-item>
88112
</template>
89113
</v-select>
@@ -124,19 +148,44 @@
124148
variant="outlined"
125149
density="compact"
126150
hide-details
151+
:menu-props="{ rounded: 'lg', maxWidth: 420 }"
127152
@update:model-value="updatePermission(role, { filesystem_scope: $event })"
128-
/>
153+
>
154+
<template #item="{ props: itemProps, item }">
155+
<v-list-item v-bind="itemProps" :lines="false" role="option" :aria-selected="policy(role).filesystem_scope === item.value">
156+
<template #subtitle>
157+
<div class="scope-hint">
158+
{{ tm(`scopeHints.${item.value}`) }}
159+
<v-menu
160+
v-if="item.value === 'host'"
161+
open-on-hover
162+
open-on-click
163+
open-on-focus
164+
:close-on-content-click="false"
165+
location="top"
166+
:max-width="360"
167+
>
168+
<template #activator="{ props: helpProps }">
169+
<button v-bind="helpProps" type="button" class="scope-help" :aria-label="tm('filesystem')" @click.stop>
170+
<CircleHelp :size="14" aria-hidden="true" />
171+
</button>
172+
</template>
173+
<v-card class="pa-3 text-body-2">
174+
<div>{{ tm('scopeDetails.account') }}</div>
175+
<div class="mt-2">{{ tm('scopeDetails.docker') }}</div>
176+
</v-card>
177+
</v-menu>
178+
</div>
179+
</template>
180+
</v-list-item>
181+
</template>
182+
</v-select>
129183
</td>
130184
</template>
131185
</tr>
132186
</tbody>
133187
</v-table>
134188

135-
<div class="text-caption text-medium-emphasis">
136-
<p v-if="!unsupported">{{ tm('scopeHints.workspace') }}</p>
137-
<p>{{ tm('scopeHints.host') }}</p>
138-
</div>
139-
140189
<v-alert v-if="memberHasElevatedAccess" type="warning" variant="tonal" density="compact">
141190
{{ tm('memberWarning') }}
142191
</v-alert>
@@ -152,7 +201,7 @@ export const windowsPermissionDefaults = {
152201

153202
<script setup>
154203
import { computed, onMounted, ref } from 'vue'
155-
import { Cpu, FolderOpen, LockKeyhole, Monitor, Shield, ShieldAlert, ShieldOff } from '@lucide/vue'
204+
import { CircleHelp, Cpu, FolderOpen, LockKeyhole, Monitor, Shield, ShieldAlert, ShieldOff } from '@lucide/vue'
156205
import { useModuleI18n } from '@/i18n/composables'
157206
import { statsApi } from '@/api/v1'
158207
@@ -265,6 +314,25 @@ const memberHasElevatedAccess = computed(() => {
265314
</script>
266315
267316
<style scoped>
317+
.scope-hint {
318+
padding-top: 4px;
319+
white-space: normal;
320+
overflow-wrap: anywhere;
321+
font-size: 0.75rem;
322+
line-height: 1.5;
323+
}
324+
325+
.scope-help {
326+
display: inline-flex;
327+
align-items: center;
328+
justify-content: center;
329+
width: 28px;
330+
height: 28px;
331+
color: inherit;
332+
vertical-align: middle;
333+
cursor: help;
334+
}
335+
268336
.sandbox-error {
269337
white-space: pre-wrap;
270338
overflow-wrap: anywhere;

‎dashboard/src/i18n/locales/en-US/features/config-metadata.json‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,16 @@
308308
"filesystem": "File access scope",
309309
"scopes": {
310310
"workspace": "Workspace",
311-
"host": "Host files"
311+
"host": "Entire environment"
312312
},
313313
"scopeHints": {
314-
"workspace": "Workspace: restricted access to the session workspace, temporary directories, and skill files.",
315-
"host": "Host files: access files permitted by the account running AstrBot. In Docker, this means files inside the container and mounted files, not all files on the Docker host."
314+
"none": "No file access allowed",
315+
"workspace": "Restricted workspace, temporary directories, and skill files.",
316+
"host": "All files in the environment where AstrBot runs."
317+
},
318+
"scopeDetails": {
319+
"account": "1. Access is limited to files permitted by the account running AstrBot.",
320+
"docker": "2. If deployed through Docker, only files inside the container and mounted files are accessible, not all files on the Docker host."
316321
},
317322
"roles": {
318323
"member": "Member",
@@ -326,7 +331,7 @@
326331
},
327332
"unsupportedSelection": "Current policy is unsupported",
328333
"runtimeUnknown": "Runtime information is unavailable.",
329-
"memberWarning": "Members have network or host file access.",
334+
"memberWarning": "Members have network access or file access across the entire environment.",
330335
"runtime": {
331336
"os": "OS",
332337
"arch": "Architecture",

‎dashboard/src/i18n/locales/ja-JP/features/config-metadata.json‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -396,11 +396,16 @@
396396
"filesystem": "ファイルアクセス範囲",
397397
"scopes": {
398398
"workspace": "ワークスペース",
399-
"host": "ホストのファイル"
399+
"host": "環境全体"
400400
},
401401
"scopeHints": {
402-
"workspace": "ワークスペース:セッションのワークスペース、一時ディレクトリ、スキルファイルに制限付きでアクセスします。",
403-
"host": "ホストのファイル:AstrBot の実行アカウントに権限があるファイルにアクセスできます。Docker 環境ではコンテナ内およびマウントされたファイルを指し、Docker ホストの全ファイルではありません。"
402+
"none": "すべてのファイルへのアクセスを禁止",
403+
"workspace": "制限されたワークスペース、一時ディレクトリ、スキルファイル。",
404+
"host": "AstrBot が動作する環境内のすべてのファイル。"
405+
},
406+
"scopeDetails": {
407+
"account": "1. AstrBot の実行アカウントに権限があるファイルにアクセスできます。",
408+
"docker": "2. Docker でデプロイした場合、コンテナ内およびマウントされたファイルのみが対象で、Docker ホストの全ファイルではありません。"
404409
},
405410
"roles": {
406411
"member": "一般メンバー",
@@ -414,7 +419,7 @@
414419
},
415420
"unsupportedSelection": "現在のポリシーはサポートされていません",
416421
"runtimeUnknown": "実行環境の情報を取得できません。",
417-
"memberWarning": "一般メンバーにネットワーク接続またはホストのファイルへのアクセスが許可されています。",
422+
"memberWarning": "一般メンバーにネットワーク接続または環境全体へのアクセスが許可されています。",
418423
"runtime": {
419424
"os": "OS",
420425
"arch": "アーキテクチャ",

‎dashboard/src/i18n/locales/ru-RU/features/config-metadata.json‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -435,11 +435,16 @@
435435
"filesystem": "Область доступа к файлам",
436436
"scopes": {
437437
"workspace": "Рабочая область",
438-
"host": "Файлы компьютера"
438+
"host": "Вся среда"
439439
},
440440
"scopeHints": {
441-
"workspace": "Рабочая область: ограниченный доступ к рабочей области сеанса, временным каталогам и файлам навыков.",
442-
"host": "Файлы компьютера: доступ к файлам в пределах прав учётной записи, запускающей AstrBot. В Docker это файлы внутри контейнера и подключённые файлы, а не все файлы хоста Docker."
441+
"none": "Доступ к любым файлам запрещён",
442+
"workspace": "Ограниченная рабочая область, временные каталоги и файлы навыков.",
443+
"host": "Все файлы среды, в которой работает AstrBot."
444+
},
445+
"scopeDetails": {
446+
"account": "1. Доступ ограничен правами учётной записи, запускающей AstrBot.",
447+
"docker": "2. При развёртывании через Docker доступны только файлы внутри контейнера и подключённые файлы, а не все файлы хоста Docker."
443448
},
444449
"roles": {
445450
"member": "Участник",
@@ -453,7 +458,7 @@
453458
},
454459
"unsupportedSelection": "Текущая политика не поддерживается",
455460
"runtimeUnknown": "Сведения о среде выполнения недоступны.",
456-
"memberWarning": "Участникам разрешён доступ к сети или файлам компьютера.",
461+
"memberWarning": "Участникам разрешён доступ к сети или файлам всей среды.",
457462
"runtime": {
458463
"os": "ОС",
459464
"arch": "Архитектура",

‎dashboard/src/i18n/locales/zh-CN/features/config-metadata.json‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,11 +324,16 @@
324324
"filesystem": "文件访问范围",
325325
"scopes": {
326326
"workspace": "工作区",
327-
"host": "主机文件"
327+
"host": "整个环境"
328328
},
329329
"scopeHints": {
330-
"workspace": "工作区:在受限范围内访问会话工作区、临时目录和技能文件。",
331-
"host": "主机文件:可访问 AstrBot 运行账户有权限访问的文件;Docker 部署时指容器内及挂载的文件,并非宿主机全部文件。"
330+
"none": "不允许访问任何文件",
331+
"workspace": "受限的工作区、临时目录和技能文件。",
332+
"host": "AstrBot 所在运行环境的所有文件。"
333+
},
334+
"scopeDetails": {
335+
"account": "1. 可访问 AstrBot 运行账户有权限访问的文件。",
336+
"docker": "2. 如果通过 Docker 部署,则仅可访问容器内及挂载的文件,并非宿主机全部文件。"
332337
},
333338
"roles": {
334339
"member": "普通成员",
@@ -342,7 +347,7 @@
342347
},
343348
"unsupportedSelection": "当前策略不受支持",
344349
"runtimeUnknown": "运行环境信息不可用。",
345-
"memberWarning": "普通成员已获得联网或主机文件访问权限。",
350+
"memberWarning": "普通成员已获得联网或整个环境访问权限。",
346351
"runtime": {
347352
"os": "操作系统",
348353
"arch": "架构",

‎docs/en/use/computer.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ The local Shell tool includes basic blocking for dangerous commands such as `rm
6666

6767
### Permission Model
6868

69+
In the local permission table, open the **File access scope** menu to read each option's description. **Workspace** restricts access to the session workspace, temporary directories, and skill files. **Entire environment** (formerly **Host files**) allows access to files permitted by the account running AstrBot. In Docker, this means files inside the container and mounted files, not all files on the Docker host. **Disabled** prevents file access through local Computer Use tools. These descriptions now appear under the corresponding menu options instead of below the table. Hover over or tap the question mark after “All files in the environment where AstrBot runs.” for details about account permissions and Docker file access.
70+
6971
Computer Use has a separate option:
7072

7173
- `Require AstrBot admin permission`

‎docs/zh/use/computer.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ data/workspaces/{normalized_umo}/notes/todo.txt
6464

6565
### 权限模型
6666

67+
在本地权限表中,展开“文件访问范围”下拉菜单即可查看各选项的说明。“工作区”允许受限访问会话工作区、临时目录和技能文件;“整个环境”(原“主机文件”)允许访问 AstrBot 运行账户有权限访问的文件。Docker 部署时,“整个环境”指容器内及挂载的文件,并非宿主机全部文件。“关闭”不允许通过本地电脑能力工具访问任何文件。范围说明已从表格下方移到下拉菜单的对应选项中;将鼠标悬停在“AstrBot 所在运行环境的所有文件。”后的问号上,或点按问号,可查看账户权限和 Docker 访问范围的详细说明。
68+
6769
电脑能力还有一个独立开关:
6870

6971
- `需要 AstrBot 管理员权限`

0 commit comments

Comments
 (0)