Skip to content

Commit 716eb33

Browse files
committed
feat: 添加权限请求处理和用户工具权限解析功能
1 parent 7a66c8a commit 716eb33

3 files changed

Lines changed: 578 additions & 11 deletions

File tree

resources/webview.css

Lines changed: 146 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -905,6 +905,152 @@ body {
905905
color: var(--vscode-descriptionForeground);
906906
}
907907

908+
.permission-prompt-host {
909+
margin-bottom: 10px;
910+
}
911+
912+
.permission-card {
913+
border: 1px solid var(--vscode-panel-border);
914+
border-left: 3px solid var(--vscode-notificationsWarningIcon-foreground, #f59e0b);
915+
border-radius: 6px;
916+
background: var(--vscode-input-background);
917+
box-shadow: 0 4px 14px var(--shadow);
918+
padding: 12px;
919+
}
920+
921+
.permission-header {
922+
display: flex;
923+
align-items: flex-start;
924+
justify-content: space-between;
925+
gap: 12px;
926+
}
927+
928+
.permission-title {
929+
color: var(--vscode-notificationsWarningIcon-foreground, #f59e0b);
930+
font-weight: 700;
931+
}
932+
933+
.permission-progress {
934+
margin-top: 2px;
935+
color: var(--vscode-descriptionForeground);
936+
font-size: 11px;
937+
}
938+
939+
.permission-close {
940+
border: none;
941+
border-radius: 4px;
942+
background: transparent;
943+
color: var(--vscode-descriptionForeground);
944+
cursor: pointer;
945+
font-size: 18px;
946+
line-height: 1;
947+
padding: 0 4px;
948+
}
949+
950+
.permission-close:hover {
951+
background: var(--vscode-toolbar-hoverBackground);
952+
color: var(--vscode-foreground);
953+
}
954+
955+
.permission-tool {
956+
margin-top: 10px;
957+
font-weight: 700;
958+
}
959+
960+
.permission-command {
961+
margin-top: 6px;
962+
border-radius: 4px;
963+
background: var(--vscode-textCodeBlock-background);
964+
color: var(--vscode-editor-foreground);
965+
font-family: var(--vscode-editor-font-family);
966+
font-size: 12px;
967+
line-height: 1.45;
968+
padding: 8px;
969+
white-space: pre-wrap;
970+
word-break: break-word;
971+
}
972+
973+
.permission-description {
974+
margin-top: 8px;
975+
color: var(--vscode-descriptionForeground);
976+
line-height: 1.45;
977+
}
978+
979+
.permission-scope {
980+
display: inline-flex;
981+
align-items: center;
982+
margin-top: 10px;
983+
border-radius: 999px;
984+
font-size: 11px;
985+
font-weight: 700;
986+
padding: 3px 8px;
987+
}
988+
989+
.permission-scope.risk-low {
990+
background: rgba(34, 197, 94, 0.14);
991+
color: #22c55e;
992+
}
993+
994+
.permission-scope.risk-medium {
995+
background: rgba(245, 158, 11, 0.14);
996+
color: #f59e0b;
997+
}
998+
999+
.permission-scope.risk-high {
1000+
background: rgba(239, 68, 68, 0.14);
1001+
color: #ef4444;
1002+
}
1003+
1004+
.permission-question {
1005+
margin-top: 10px;
1006+
font-weight: 600;
1007+
}
1008+
1009+
.permission-actions {
1010+
display: flex;
1011+
flex-wrap: wrap;
1012+
gap: 8px;
1013+
margin-top: 10px;
1014+
}
1015+
1016+
.permission-action {
1017+
border: 1px solid var(--vscode-button-border, transparent);
1018+
border-radius: 4px;
1019+
background: var(--vscode-button-secondaryBackground);
1020+
color: var(--vscode-button-secondaryForeground);
1021+
cursor: pointer;
1022+
font-size: 12px;
1023+
padding: 6px 10px;
1024+
}
1025+
1026+
.permission-action:hover {
1027+
background: var(--vscode-button-secondaryHoverBackground);
1028+
}
1029+
1030+
.permission-allow,
1031+
.permission-always {
1032+
background: var(--vscode-button-background);
1033+
color: var(--vscode-button-foreground);
1034+
}
1035+
1036+
.permission-allow:hover,
1037+
.permission-always:hover {
1038+
background: var(--vscode-button-hoverBackground);
1039+
}
1040+
1041+
.permission-deny {
1042+
border-color: var(--vscode-inputValidation-errorBorder, #ef4444);
1043+
color: var(--vscode-errorForeground, #ef4444);
1044+
}
1045+
1046+
.permission-denied-card {
1047+
border-left-color: var(--vscode-errorForeground, #ef4444);
1048+
}
1049+
1050+
.permission-denied-card .permission-title {
1051+
color: var(--vscode-errorForeground, #ef4444);
1052+
}
1053+
9081054
/* Spinner dot for live thinking bubble */
9091055
.bubble-dot.spinner-dot {
9101056
background: transparent !important;

0 commit comments

Comments
 (0)