create-windy 0.2.33 → 0.3.0
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/dist/cli.js +173 -17
- package/package.json +1 -1
- package/template/.agents/skills/windy-business-module/SKILL.md +10 -1
- package/template/.windy-template.json +2 -2
- package/template/AGENTS.md +9 -0
- package/template/README.md +3 -1
- package/template/apps/agent-server/Dockerfile +1 -0
- package/template/apps/agent-server/README.md +28 -5
- package/template/apps/agent-server/adk_web_agents/__init__.py +1 -0
- package/template/apps/agent-server/adk_web_agents/safe_debug/__init__.py +3 -0
- package/template/apps/agent-server/adk_web_agents/safe_debug/agent.py +40 -0
- package/template/apps/agent-server/pyproject.toml +1 -1
- package/template/apps/agent-server/src/southwind_agent_server/adk_adapter.py +191 -16
- package/template/apps/agent-server/src/southwind_agent_server/adk_failure.py +13 -0
- package/template/apps/agent-server/src/southwind_agent_server/adk_model.py +225 -0
- package/template/apps/agent-server/src/southwind_agent_server/adk_tools.py +76 -0
- package/template/apps/agent-server/src/southwind_agent_server/app.py +63 -3
- package/template/apps/agent-server/src/southwind_agent_server/contracts.py +35 -0
- package/template/apps/agent-server/src/southwind_agent_server/engine.py +2 -0
- package/template/apps/agent-server/src/southwind_agent_server/openai_engine.py +31 -3
- package/template/apps/agent-server/src/southwind_agent_server/openai_provider.py +22 -9
- package/template/apps/agent-server/src/southwind_agent_server/provider_audit.py +144 -0
- package/template/apps/agent-server/src/southwind_agent_server/provider_governance.py +227 -0
- package/template/apps/agent-server/src/southwind_agent_server/service.py +1 -0
- package/template/apps/agent-server/tests/test_adk_adapter.py +305 -0
- package/template/apps/agent-server/tests/test_adk_web_agent.py +12 -0
- package/template/apps/agent-server/tests/test_api.py +16 -1
- package/template/apps/agent-server/tests/test_openai_provider.py +79 -0
- package/template/apps/agent-server/tests/test_provider_governance.py +215 -0
- package/template/apps/server/package.json +4 -1
- package/template/apps/server/src/agent/provider-input-governance.test.ts +82 -0
- package/template/apps/server/src/agent/provider-input-governance.ts +140 -0
- package/template/apps/server/src/agent/remote-runtime.test.ts +22 -0
- package/template/apps/server/src/agent/remote-runtime.ts +1 -0
- package/template/apps/server/src/agent/run-contracts.ts +2 -0
- package/template/apps/server/src/agent/run-facade.test.ts +52 -2
- package/template/apps/server/src/agent/run-facade.ts +38 -9
- package/template/apps/server/src/agent/tool-registry.ts +2 -6
- package/template/apps/server/src/application-services.ts +50 -0
- package/template/apps/server/src/audit/drizzle-log-store.ts +25 -0
- package/template/apps/server/src/audit/search-summary.ts +2 -6
- package/template/apps/server/src/auth/credential-restriction.ts +1 -0
- package/template/apps/server/src/auth/password.ts +30 -21
- package/template/apps/server/src/auth/routes.test.ts +44 -3
- package/template/apps/server/src/auth/routes.ts +6 -1
- package/template/apps/server/src/auth/runtime.ts +4 -1
- package/template/apps/server/src/auth/service.ts +25 -7
- package/template/apps/server/src/configuration/bootstrap.ts +20 -1
- package/template/apps/server/src/configuration/definition.test.ts +71 -0
- package/template/apps/server/src/configuration/definition.ts +242 -12
- package/template/apps/server/src/configuration/drizzle-repository.ts +36 -2
- package/template/apps/server/src/configuration/repository.ts +27 -2
- package/template/apps/server/src/configuration/routes.ts +4 -1
- package/template/apps/server/src/configuration/service.test.ts +100 -0
- package/template/apps/server/src/configuration/service.ts +50 -10
- package/template/apps/server/src/data-access/scoped-repository.integration.test.ts +3 -2
- package/template/apps/server/src/data-governance/export/service.ts +2 -6
- package/template/apps/server/src/example-modules.ts +4 -1
- package/template/apps/server/src/guards.ts +18 -5
- package/template/apps/server/src/http/request-source.test.ts +85 -0
- package/template/apps/server/src/http/request-source.ts +90 -0
- package/template/apps/server/src/index.ts +45 -45
- package/template/apps/server/src/license/routes.ts +2 -0
- package/template/apps/server/src/license/runtime-service.ts +10 -11
- package/template/apps/server/src/module-bootstrap.ts +2 -2
- package/template/apps/server/src/module-host/initialize-contracts.ts +6 -0
- package/template/apps/server/src/module-host/initialize.ts +30 -44
- package/template/apps/server/src/module-host/request-context.ts +29 -23
- package/template/apps/server/src/module-host/resource-file-policies.test.ts +197 -0
- package/template/apps/server/src/module-host/resource-file-policies.ts +108 -0
- package/template/apps/server/src/module-host/route-declaration.ts +45 -0
- package/template/apps/server/src/module-host/route-installer.ts +27 -3
- package/template/apps/server/src/module-host/storage-port.test.ts +170 -1
- package/template/apps/server/src/module-host/storage-port.ts +134 -1
- package/template/apps/server/src/module-host/storage-scope.ts +89 -0
- package/template/apps/server/src/module-host/tool-handlers.test.ts +305 -0
- package/template/apps/server/src/module-host/tool-handlers.ts +38 -4
- package/template/apps/server/src/module-host/user-directory-composition.test.ts +126 -0
- package/template/apps/server/src/module-host/user-directory-port.test.ts +238 -0
- package/template/apps/server/src/module-host/user-directory-port.ts +139 -0
- package/template/apps/server/src/module-host.ts +4 -0
- package/template/apps/server/src/notification/channel-adapter.ts +46 -0
- package/template/apps/server/src/notification/delivery-policy.test.ts +59 -0
- package/template/apps/server/src/notification/delivery-policy.ts +37 -0
- package/template/apps/server/src/notification/delivery-repository.ts +198 -0
- package/template/apps/server/src/notification/delivery-worker.test.ts +87 -0
- package/template/apps/server/src/notification/delivery-worker.ts +88 -0
- package/template/apps/server/src/notification/drizzle-management.ts +180 -0
- package/template/apps/server/src/notification/drizzle-query.ts +160 -0
- package/template/apps/server/src/notification/drizzle-repository.integration.test.ts +301 -0
- package/template/apps/server/src/notification/drizzle-repository.ts +156 -90
- package/template/apps/server/src/notification/extension-routes.test.ts +119 -0
- package/template/apps/server/src/notification/extension-routes.ts +111 -0
- package/template/apps/server/src/notification/memory-delivery-repository.ts +137 -0
- package/template/apps/server/src/notification/memory-support.ts +72 -0
- package/template/apps/server/src/notification/preference-repository.ts +95 -0
- package/template/apps/server/src/notification/recipient-directory.ts +104 -0
- package/template/apps/server/src/notification/repository.test.ts +171 -0
- package/template/apps/server/src/notification/repository.ts +179 -32
- package/template/apps/server/src/notification/revision-routes.test.ts +186 -0
- package/template/apps/server/src/notification/route-support.ts +225 -0
- package/template/apps/server/src/notification/routes.test.ts +182 -0
- package/template/apps/server/src/notification/routes.ts +225 -132
- package/template/apps/server/src/notification/service.test.ts +104 -0
- package/template/apps/server/src/notification/service.ts +140 -0
- package/template/apps/server/src/notification/smtp-adapter.test.ts +65 -0
- package/template/apps/server/src/notification/smtp-adapter.ts +68 -0
- package/template/apps/server/src/persistence.integration.test.ts +41 -2
- package/template/apps/server/src/route-guards.ts +1 -0
- package/template/apps/server/src/runtime-audit-list.test.ts +39 -0
- package/template/apps/server/src/runtime-development.ts +2 -0
- package/template/apps/server/src/runtime.test.ts +23 -9
- package/template/apps/server/src/runtime.ts +39 -2
- package/template/apps/server/src/scheduler/audit.ts +2 -11
- package/template/apps/server/src/scheduler/definitions.test.ts +6 -0
- package/template/apps/server/src/scheduler/definitions.ts +7 -0
- package/template/apps/server/src/scheduler/recovery-service.ts +2 -11
- package/template/apps/server/src/scheduler/routes.ts +2 -7
- package/template/apps/server/src/search/opensearch-client.test.ts +45 -0
- package/template/apps/server/src/search/opensearch-client.ts +145 -0
- package/template/apps/server/src/search/service.ts +2 -6
- package/template/apps/server/src/settings/routes.ts +15 -3
- package/template/apps/server/src/settings/runtime.ts +10 -1
- package/template/apps/server/src/storage/runtime.ts +13 -0
- package/template/apps/server/src/system/audit-query.ts +33 -4
- package/template/apps/server/src/system/audit-routes.test.ts +58 -4
- package/template/apps/server/src/system/audit-routes.ts +6 -5
- package/template/apps/server/src/system/built-in-roles.ts +1 -0
- package/template/apps/server/src/system/department-organization.ts +320 -0
- package/template/apps/server/src/system/department-routes.test.ts +207 -48
- package/template/apps/server/src/system/department-routes.ts +114 -33
- package/template/apps/server/src/system/drizzle-repository.ts +15 -7
- package/template/apps/server/src/system/drizzle-scoped-repository.ts +5 -3
- package/template/apps/server/src/system/drizzle-system.ts +37 -9
- package/template/apps/server/src/system/drizzle-transaction-context.ts +14 -0
- package/template/apps/server/src/system/identity-route-config.ts +7 -2
- package/template/apps/server/src/system/mutation-runner.ts +23 -0
- package/template/apps/server/src/system/organization-postgres.integration.test.ts +176 -0
- package/template/apps/server/src/system/resource-access-response.ts +12 -6
- package/template/apps/server/src/system/role-department-scope-policy.ts +55 -0
- package/template/apps/server/src/system/route-helpers.ts +2 -5
- package/template/apps/server/src/system/route-types.ts +12 -3
- package/template/apps/server/src/system/routes-validation.test.ts +26 -0
- package/template/apps/server/src/system/routes.test.ts +10 -2
- package/template/apps/server/src/system/routes.ts +70 -36
- package/template/apps/server/src/system/seed.ts +7 -0
- package/template/apps/server/src/work-order/data-scope.integration.test.ts +9 -2
- package/template/apps/server/src/work-order/opensearch-index.test.ts +97 -0
- package/template/apps/server/src/work-order/opensearch-index.ts +313 -0
- package/template/apps/server/src/work-order/search-provider.ts +60 -1
- package/template/apps/server/src/work-order/service.ts +42 -10
- package/template/apps/web/src/app/error-pages.ts +9 -0
- package/template/apps/web/src/components/auth/PasswordChangeForm.vue +16 -11
- package/template/apps/web/src/components/auth/PasswordChangeForm.webtest.ts +14 -0
- package/template/apps/web/src/components/common/FormDialog.vue +16 -2
- package/template/apps/web/src/components/common/ModalLayout.webtest.ts +20 -1
- package/template/apps/web/src/composables/useGlobalSearch.ts +68 -0
- package/template/apps/web/src/composables/usePlatformSettings.ts +8 -7
- package/template/apps/web/src/layout/GlobalSearchResults.vue +58 -0
- package/template/apps/web/src/layout/NavigationSearchDialog.vue +42 -6
- package/template/apps/web/src/layout/NavigationSearchDialog.webtest.ts +71 -0
- package/template/apps/web/src/layout/NotificationMenu.vue +73 -31
- package/template/apps/web/src/layout/NotificationMenu.webtest.ts +44 -1
- package/template/apps/web/src/layout/NotificationMenuItem.vue +61 -0
- package/template/apps/web/src/layout/NotificationPreferencesDialog.vue +181 -0
- package/template/apps/web/src/layout/NotificationPreferencesDialog.webtest.ts +80 -0
- package/template/apps/web/src/lib/date-time.ts +22 -10
- package/template/apps/web/src/lib/date-time.webtest.ts +9 -1
- package/template/apps/web/src/main.ts +14 -1
- package/template/apps/web/src/pages/auth/ChangePasswordPage.vue +16 -1
- package/template/apps/web/src/pages/configuration/components/ModuleConfigVersionList.vue +1 -0
- package/template/apps/web/src/pages/configuration/components/ModuleConfigurationEditor.vue +10 -0
- package/template/apps/web/src/pages/configuration/components/ModuleConfigurationWorkbench.vue +37 -6
- package/template/apps/web/src/pages/errors/PlatformErrorPage.vue +115 -0
- package/template/apps/web/src/pages/errors/PlatformErrorPage.webtest.ts +44 -0
- package/template/apps/web/src/pages/errors/error-page-extension.ts +26 -0
- package/template/apps/web/src/pages/system/SystemNotificationsPage.vue +136 -68
- package/template/apps/web/src/pages/system/SystemNotificationsPage.webtest.ts +224 -12
- package/template/apps/web/src/pages/system/audit-log-presenter.ts +86 -0
- package/template/apps/web/src/pages/system/audit-time-range.ts +28 -0
- package/template/apps/web/src/pages/system/components/AuditActionCell.vue +10 -69
- package/template/apps/web/src/pages/system/components/AuditActionCell.webtest.ts +20 -27
- package/template/apps/web/src/pages/system/components/AuditLogDetailDialog.vue +134 -0
- package/template/apps/web/src/pages/system/components/AuditLogDetailDialog.webtest.ts +76 -0
- package/template/apps/web/src/pages/system/components/AuditLogFilters.vue +116 -52
- package/template/apps/web/src/pages/system/components/AuditLogFilters.webtest.ts +52 -15
- package/template/apps/web/src/pages/system/components/NotificationHistoryDialog.vue +129 -0
- package/template/apps/web/src/pages/system/components/NotificationManagementCard.vue +91 -0
- package/template/apps/web/src/pages/system/components/NotificationPublishDialog.vue +121 -0
- package/template/apps/web/src/pages/system/components/NotificationPublishForm.vue +162 -1
- package/template/apps/web/src/pages/system/components/SystemResourceActions.vue +68 -0
- package/template/apps/web/src/pages/system/components/SystemResourceEditor.vue +74 -0
- package/template/apps/web/src/pages/system/components/SystemResourceFilters.vue +3 -4
- package/template/apps/web/src/pages/system/components/SystemResourcePage.vue +91 -98
- package/template/apps/web/src/pages/system/components/SystemResourcePage.webtest.ts +68 -0
- package/template/apps/web/src/pages/system/components/SystemResourceTable.vue +20 -1
- package/template/apps/web/src/pages/system/components/SystemResourceTable.webtest.ts +28 -7
- package/template/apps/web/src/pages/system/components/department/DepartmentOrganizationForm.vue +210 -0
- package/template/apps/web/src/pages/system/components/department/DepartmentTransitionDialog.vue +112 -0
- package/template/apps/web/src/pages/system/components/user-account/UserAccountForm.vue +17 -4
- package/template/apps/web/src/pages/system/composables/useDepartmentTransitions.ts +79 -0
- package/template/apps/web/src/pages/system/composables/useNotificationPermissions.ts +14 -0
- package/template/apps/web/src/pages/system/composables/useSystemResource.ts +2 -0
- package/template/apps/web/src/pages/system/composables/useSystemResource.webtest.ts +15 -2
- package/template/apps/web/src/pages/system/resource-config.ts +12 -4
- package/template/apps/web/src/router/error-navigation.ts +50 -0
- package/template/apps/web/src/router/error-navigation.webtest.ts +106 -0
- package/template/apps/web/src/router/index.ts +71 -0
- package/template/apps/web/src/router/index.webtest.ts +29 -0
- package/template/apps/web/src/router/manifest-routes.webtest.ts +4 -0
- package/template/apps/web/src/router/shared-scaffold-neutrality.webtest.ts +12 -0
- package/template/apps/web/src/services/auth-api.ts +5 -0
- package/template/apps/web/src/services/http.ts +43 -6
- package/template/apps/web/src/services/http.webtest.ts +70 -0
- package/template/apps/web/src/services/notification-api.ts +85 -2
- package/template/apps/web/src/services/notification-api.webtest.ts +110 -0
- package/template/apps/web/src/services/search-api.ts +39 -0
- package/template/apps/web/src/services/system-api.ts +18 -0
- package/template/apps/web/vitest.config.ts +1 -0
- package/template/docker-compose.yml +68 -0
- package/template/docs/architecture/ai-egress.md +49 -7
- package/template/docs/architecture/ai-runtime.md +34 -6
- package/template/docs/architecture/data-scope-query-enforcement.md +4 -0
- package/template/docs/architecture/object-storage.md +22 -2
- package/template/docs/architecture/search-provider-protocol.md +38 -2
- package/template/docs/development/custom-error-pages.md +78 -0
- package/template/docs/development/custom-login-page.md +3 -3
- package/template/docs/platform/agent-runtime.md +76 -7
- package/template/docs/platform/audit-reliability.md +46 -2
- package/template/docs/platform/business-user-directory.md +82 -0
- package/template/docs/platform/module-configuration.md +13 -4
- package/template/docs/platform/notifications.md +67 -11
- package/template/docs/platform/organization-membership.md +17 -3
- package/template/docs/platform/system-crud-api.md +16 -0
- package/template/docs/platform/web-system-crud.md +6 -2
- package/template/package.json +4 -0
- package/template/packages/config/index.test.ts +45 -0
- package/template/packages/config/package.json +1 -1
- package/template/packages/config/src/platform.ts +169 -48
- package/template/packages/database/drizzle/0035_material_nightshade.sql +10 -0
- package/template/packages/database/drizzle/0036_hesitant_speed.sql +35 -0
- package/template/packages/database/drizzle/0037_absent_nick_fury.sql +2 -0
- package/template/packages/database/drizzle/0038_uneven_wasp.sql +38 -0
- package/template/packages/database/drizzle/meta/0035_snapshot.json +7331 -0
- package/template/packages/database/drizzle/meta/0036_snapshot.json +7436 -0
- package/template/packages/database/drizzle/meta/0037_snapshot.json +7457 -0
- package/template/packages/database/drizzle/meta/0038_snapshot.json +7749 -0
- package/template/packages/database/drizzle/meta/_journal.json +28 -0
- package/template/packages/database/package.json +1 -1
- package/template/packages/database/src/schema/identity.ts +7 -0
- package/template/packages/database/src/schema/notifications.ts +135 -0
- package/template/packages/database/src/schema-notification-delivery.test.ts +54 -0
- package/template/packages/database/src/schema-workflow-notification.test.ts +40 -1
- package/template/packages/modules/package.json +1 -1
- package/template/packages/modules/src/ai-operation-composition.test.ts +68 -0
- package/template/packages/modules/src/ai-operation-composition.ts +115 -0
- package/template/packages/modules/src/manifest.ts +26 -0
- package/template/packages/modules/src/provider-data-policy-composition.test.ts +74 -0
- package/template/packages/modules/src/system-api-permissions.ts +54 -0
- package/template/packages/modules/src/system-audit-actions.ts +15 -0
- package/template/packages/modules/src/system-features.ts +6 -1
- package/template/packages/modules/src/system-module-catalog.test.ts +16 -0
- package/template/packages/modules/src/system-module-catalog.ts +28 -4
- package/template/packages/modules/src/system-modules.test.ts +13 -1
- package/template/packages/modules/src/system-modules.ts +12 -0
- package/template/packages/modules/src/system-permissions.ts +11 -5
- package/template/packages/server-sdk/index.ts +11 -0
- package/template/packages/server-sdk/package.json +3 -2
- package/template/packages/server-sdk/src/ai-operation-registration.ts +2 -1
- package/template/packages/server-sdk/src/module-host.ts +8 -0
- package/template/packages/server-sdk/src/request-context.ts +2 -0
- package/template/packages/server-sdk/src/storage-port.ts +66 -0
- package/template/packages/server-sdk/src/tool-registration.ts +6 -0
- package/template/packages/server-sdk/src/user-directory-port.ts +42 -0
- package/template/packages/shared/package.json +1 -1
- package/template/packages/shared/src/audit.ts +25 -0
- package/template/packages/shared/src/module-configuration.ts +5 -0
- package/template/packages/shared/src/notification.ts +92 -1
- package/template/packages/shared/src/password.ts +7 -2
- package/template/packages/shared/src/platform-settings.ts +2 -0
- package/template/packages/storage/package.json +1 -1
- package/template/packages/storage/src/upload-service.test.ts +16 -0
- package/template/packages/storage/src/upload-service.ts +5 -1
- package/template/scripts/notification-postgres-regression.ts +27 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export function localMinuteToIso(
|
|
2
|
+
value: string,
|
|
3
|
+
boundary: "start" | "end",
|
|
4
|
+
): string | undefined {
|
|
5
|
+
const match =
|
|
6
|
+
/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})$/.exec(value.trim());
|
|
7
|
+
if (!match) return undefined;
|
|
8
|
+
const [, year, month, day, hour, minute] = match;
|
|
9
|
+
const local = new Date(
|
|
10
|
+
Number(year),
|
|
11
|
+
Number(month) - 1,
|
|
12
|
+
Number(day),
|
|
13
|
+
Number(hour),
|
|
14
|
+
Number(minute),
|
|
15
|
+
boundary === "end" ? 59 : 0,
|
|
16
|
+
boundary === "end" ? 999 : 0,
|
|
17
|
+
);
|
|
18
|
+
if (
|
|
19
|
+
local.getFullYear() !== Number(year) ||
|
|
20
|
+
local.getMonth() !== Number(month) - 1 ||
|
|
21
|
+
local.getDate() !== Number(day) ||
|
|
22
|
+
local.getHours() !== Number(hour) ||
|
|
23
|
+
local.getMinutes() !== Number(minute)
|
|
24
|
+
) {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
return local.toISOString();
|
|
28
|
+
}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed } from "vue";
|
|
3
3
|
import { AUDIT_ACTION_DEFINITIONS } from "@southwind-ai/shared";
|
|
4
|
-
import {
|
|
5
|
-
Tooltip,
|
|
6
|
-
TooltipContent,
|
|
7
|
-
TooltipTrigger,
|
|
8
|
-
} from "@/components/ui/tooltip";
|
|
9
4
|
import { useAccessSnapshot } from "@/composables/useAccessSnapshot";
|
|
10
5
|
import type { SystemRecord } from "@/services/system-api";
|
|
6
|
+
import { auditOperationSummary } from "../audit-log-presenter";
|
|
11
7
|
|
|
12
8
|
const props = defineProps<{
|
|
13
9
|
item: SystemRecord;
|
|
@@ -22,71 +18,16 @@ const actionCatalog = computed(
|
|
|
22
18
|
const definition = computed(() =>
|
|
23
19
|
actionCatalog.value.find((item) => item.key === props.actionKey),
|
|
24
20
|
);
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
const values: string[] = [];
|
|
29
|
-
const message = text(props.item.message);
|
|
30
|
-
if (message) values.push(`补充说明:${message}`);
|
|
31
|
-
const targetLabel = text(target.value.label);
|
|
32
|
-
const targetType = text(target.value.type);
|
|
33
|
-
const targetId = text(target.value.id);
|
|
34
|
-
if (targetLabel || targetType || targetId) {
|
|
35
|
-
values.push(
|
|
36
|
-
`操作对象:${targetLabel || targetType || "未标注"}${targetId ? `(${targetId})` : ""}`,
|
|
37
|
-
);
|
|
38
|
-
}
|
|
39
|
-
const query = text(metadata.value.query);
|
|
40
|
-
if (query) values.push(`搜索内容:${query}`);
|
|
41
|
-
const matched = metadata.value.matched;
|
|
42
|
-
if (typeof matched === "number") values.push(`匹配结果:${matched} 条`);
|
|
43
|
-
const enabled = metadata.value.enabled;
|
|
44
|
-
if (typeof enabled === "boolean") {
|
|
45
|
-
values.push(`开关状态:${enabled ? "已启用" : "已停用"}`);
|
|
46
|
-
}
|
|
47
|
-
const visible = text(metadata.value.visible);
|
|
48
|
-
if (visible) {
|
|
49
|
-
values.push(`入口可见性:${visible === "hidden" ? "隐藏" : "显示"}`);
|
|
50
|
-
}
|
|
51
|
-
if (Object.hasOwn(metadata.value, "licenseVersionOverride")) {
|
|
52
|
-
values.push(formatLicenseScope(metadata.value.licenseVersionOverride));
|
|
53
|
-
}
|
|
54
|
-
return values;
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
function record(value: unknown): Record<string, unknown> {
|
|
58
|
-
return value && typeof value === "object" && !Array.isArray(value)
|
|
59
|
-
? (value as Record<string, unknown>)
|
|
60
|
-
: {};
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
function text(value: unknown): string | undefined {
|
|
64
|
-
return typeof value === "string" && value.trim() ? value.trim() : undefined;
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
function formatLicenseScope(value: unknown): string {
|
|
68
|
-
if (value === null) return "License 范围:跟随模块默认设置";
|
|
69
|
-
if (!Array.isArray(value) || value.length === 0) {
|
|
70
|
-
return "License 范围:基础能力(不限制版本)";
|
|
71
|
-
}
|
|
72
|
-
return `License 范围:${value.map(String).join("、")}`;
|
|
73
|
-
}
|
|
21
|
+
const summary = computed(() =>
|
|
22
|
+
auditOperationSummary(props.item, definition.value?.label),
|
|
23
|
+
);
|
|
74
24
|
</script>
|
|
75
25
|
|
|
76
26
|
<template>
|
|
77
|
-
<
|
|
78
|
-
<
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
{{ definition?.label || key }}
|
|
84
|
-
</button>
|
|
85
|
-
</TooltipTrigger>
|
|
86
|
-
<TooltipContent class="max-w-sm flex-col items-start gap-1 p-3">
|
|
87
|
-
<p><span class="opacity-70">Key:</span>{{ key }}</p>
|
|
88
|
-
<p>{{ definition?.description || "平台记录的自定义审计动作。" }}</p>
|
|
89
|
-
<p v-for="detail in details" :key="detail">{{ detail }}</p>
|
|
90
|
-
</TooltipContent>
|
|
91
|
-
</Tooltip>
|
|
27
|
+
<div class="min-w-48 max-w-md space-y-1">
|
|
28
|
+
<p class="font-medium">{{ definition?.label || key }}</p>
|
|
29
|
+
<p class="line-clamp-2 break-words text-xs text-muted-foreground">
|
|
30
|
+
{{ summary }}
|
|
31
|
+
</p>
|
|
32
|
+
</div>
|
|
92
33
|
</template>
|
|
@@ -3,7 +3,7 @@ import { mount } from "@vue/test-utils";
|
|
|
3
3
|
import AuditActionCell from "./AuditActionCell.vue";
|
|
4
4
|
|
|
5
5
|
describe("AuditActionCell", () => {
|
|
6
|
-
test("
|
|
6
|
+
test("直接显示中文动作名和稳定的搜索操作摘要", () => {
|
|
7
7
|
const wrapper = mount(AuditActionCell, {
|
|
8
8
|
props: {
|
|
9
9
|
actionKey: "data.search",
|
|
@@ -14,28 +14,13 @@ describe("AuditActionCell", () => {
|
|
|
14
14
|
metadata: { query: "张三", matched: 2 },
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
|
-
global: {
|
|
18
|
-
stubs: {
|
|
19
|
-
Tooltip: { template: "<div><slot /></div>" },
|
|
20
|
-
TooltipTrigger: { template: "<div><slot /></div>" },
|
|
21
|
-
TooltipContent: {
|
|
22
|
-
template: '<div data-testid="tooltip-content"><slot /></div>',
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
17
|
});
|
|
27
18
|
|
|
28
|
-
expect(wrapper.
|
|
29
|
-
expect(wrapper.
|
|
30
|
-
expect(wrapper.get('[data-testid="tooltip-content"]').text()).toContain(
|
|
31
|
-
"Key:data.search",
|
|
32
|
-
);
|
|
33
|
-
expect(wrapper.text()).toContain("操作对象:users");
|
|
34
|
-
expect(wrapper.text()).toContain("搜索内容:张三");
|
|
35
|
-
expect(wrapper.text()).toContain("匹配结果:2 条");
|
|
19
|
+
expect(wrapper.text()).toContain("数据搜索");
|
|
20
|
+
expect(wrapper.text()).toContain("搜索 users:张三");
|
|
36
21
|
});
|
|
37
22
|
|
|
38
|
-
test("
|
|
23
|
+
test("功能开关变更给出启停与对象摘要", () => {
|
|
39
24
|
const wrapper = mount(AuditActionCell, {
|
|
40
25
|
props: {
|
|
41
26
|
actionKey: "feature.update",
|
|
@@ -50,17 +35,25 @@ describe("AuditActionCell", () => {
|
|
|
50
35
|
},
|
|
51
36
|
},
|
|
52
37
|
},
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
expect(wrapper.text()).toContain("停用 features(system.audit)");
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
test("未知业务动作保留 key、对象和已记录上下文", () => {
|
|
44
|
+
const wrapper = mount(AuditActionCell, {
|
|
45
|
+
props: {
|
|
46
|
+
actionKey: "case.review.complete",
|
|
47
|
+
item: {
|
|
48
|
+
id: "audit_unknown",
|
|
49
|
+
action: "case.review.complete",
|
|
50
|
+
target: { type: "case", id: "case_1", label: "案件甲" },
|
|
51
|
+
message: "完成人工复核",
|
|
58
52
|
},
|
|
59
53
|
},
|
|
60
54
|
});
|
|
61
55
|
|
|
62
|
-
expect(wrapper.text()).toContain("
|
|
63
|
-
expect(wrapper.text()).toContain("
|
|
64
|
-
expect(wrapper.text()).toContain("License 范围:advanced");
|
|
56
|
+
expect(wrapper.text()).toContain("case.review.complete");
|
|
57
|
+
expect(wrapper.text()).toContain("完成人工复核;对象:案件甲");
|
|
65
58
|
});
|
|
66
59
|
});
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { AUDIT_ACTION_DEFINITIONS } from "@southwind-ai/shared";
|
|
4
|
+
import { Button } from "@/components/ui/button";
|
|
5
|
+
import {
|
|
6
|
+
Dialog,
|
|
7
|
+
DialogClose,
|
|
8
|
+
DialogContent,
|
|
9
|
+
DialogDescription,
|
|
10
|
+
DialogFooter,
|
|
11
|
+
DialogHeader,
|
|
12
|
+
DialogTitle,
|
|
13
|
+
} from "@/components/ui/dialog";
|
|
14
|
+
import { useAccessSnapshot } from "@/composables/useAccessSnapshot";
|
|
15
|
+
import { formatDateTime } from "@/lib/date-time";
|
|
16
|
+
import type { SystemRecord } from "@/services/system-api";
|
|
17
|
+
import {
|
|
18
|
+
auditActorLabel,
|
|
19
|
+
auditOperationSummary,
|
|
20
|
+
auditOutcomeLabel,
|
|
21
|
+
auditRecord,
|
|
22
|
+
auditTargetLabel,
|
|
23
|
+
auditText,
|
|
24
|
+
formatAuditMetadata,
|
|
25
|
+
} from "../audit-log-presenter";
|
|
26
|
+
|
|
27
|
+
const props = defineProps<{ item?: SystemRecord }>();
|
|
28
|
+
const open = defineModel<boolean>("open", { required: true });
|
|
29
|
+
const access = useAccessSnapshot();
|
|
30
|
+
const catalog = computed(
|
|
31
|
+
() => access.snapshot.value?.auditActionCatalog || AUDIT_ACTION_DEFINITIONS,
|
|
32
|
+
);
|
|
33
|
+
const definition = computed(() =>
|
|
34
|
+
catalog.value.find(({ key }) => key === props.item?.action),
|
|
35
|
+
);
|
|
36
|
+
const actor = computed(() => auditRecord(props.item?.actor));
|
|
37
|
+
const actionKey = computed(() => auditText(props.item?.action) || "unknown");
|
|
38
|
+
const actionLabel = computed(() => definition.value?.label || actionKey.value);
|
|
39
|
+
const summary = computed(() =>
|
|
40
|
+
props.item
|
|
41
|
+
? auditOperationSummary(props.item, actionLabel.value)
|
|
42
|
+
: "未记录",
|
|
43
|
+
);
|
|
44
|
+
|
|
45
|
+
function value(value: unknown): string {
|
|
46
|
+
return auditText(value) || "未记录";
|
|
47
|
+
}
|
|
48
|
+
</script>
|
|
49
|
+
|
|
50
|
+
<template>
|
|
51
|
+
<Dialog v-model:open="open">
|
|
52
|
+
<DialogContent class="max-h-[85vh] max-w-3xl overflow-y-auto">
|
|
53
|
+
<DialogHeader>
|
|
54
|
+
<DialogTitle>审计日志详情</DialogTitle>
|
|
55
|
+
<DialogDescription>
|
|
56
|
+
展示服务端已经脱敏并持久化的审计事实;未记录的信息不会推断补全。
|
|
57
|
+
</DialogDescription>
|
|
58
|
+
</DialogHeader>
|
|
59
|
+
|
|
60
|
+
<dl v-if="item" class="grid gap-x-6 gap-y-4 text-sm sm:grid-cols-2">
|
|
61
|
+
<div class="sm:col-span-2">
|
|
62
|
+
<dt class="text-muted-foreground">具体操作</dt>
|
|
63
|
+
<dd class="mt-1 break-words font-medium">{{ summary }}</dd>
|
|
64
|
+
</div>
|
|
65
|
+
<div>
|
|
66
|
+
<dt class="text-muted-foreground">动作</dt>
|
|
67
|
+
<dd class="mt-1 break-words">
|
|
68
|
+
{{ actionLabel }}({{ actionKey }})
|
|
69
|
+
</dd>
|
|
70
|
+
</div>
|
|
71
|
+
<div>
|
|
72
|
+
<dt class="text-muted-foreground">结果</dt>
|
|
73
|
+
<dd class="mt-1">{{ auditOutcomeLabel(item.outcome) }}</dd>
|
|
74
|
+
</div>
|
|
75
|
+
<div class="sm:col-span-2">
|
|
76
|
+
<dt class="text-muted-foreground">动作说明</dt>
|
|
77
|
+
<dd class="mt-1 break-words">
|
|
78
|
+
{{ definition?.description || "未记录该自定义动作的说明。" }}
|
|
79
|
+
</dd>
|
|
80
|
+
</div>
|
|
81
|
+
<div>
|
|
82
|
+
<dt class="text-muted-foreground">操作者</dt>
|
|
83
|
+
<dd class="mt-1 break-words">{{ auditActorLabel(item) }}</dd>
|
|
84
|
+
</div>
|
|
85
|
+
<div>
|
|
86
|
+
<dt class="text-muted-foreground">IP</dt>
|
|
87
|
+
<dd class="mt-1 break-all">{{ value(actor.ip) }}</dd>
|
|
88
|
+
</div>
|
|
89
|
+
<div>
|
|
90
|
+
<dt class="text-muted-foreground">时间</dt>
|
|
91
|
+
<dd class="mt-1">{{ formatDateTime(item.occurredAt) }}</dd>
|
|
92
|
+
</div>
|
|
93
|
+
<div>
|
|
94
|
+
<dt class="text-muted-foreground">操作对象</dt>
|
|
95
|
+
<dd class="mt-1 break-words">{{ auditTargetLabel(item) }}</dd>
|
|
96
|
+
</div>
|
|
97
|
+
<div>
|
|
98
|
+
<dt class="text-muted-foreground">模块</dt>
|
|
99
|
+
<dd class="mt-1 break-all">{{ value(item.module) }}</dd>
|
|
100
|
+
</div>
|
|
101
|
+
<div>
|
|
102
|
+
<dt class="text-muted-foreground">Request ID</dt>
|
|
103
|
+
<dd class="mt-1 break-all">{{ value(item.requestId) }}</dd>
|
|
104
|
+
</div>
|
|
105
|
+
<div class="sm:col-span-2">
|
|
106
|
+
<dt class="text-muted-foreground">Message</dt>
|
|
107
|
+
<dd class="mt-1 whitespace-pre-wrap break-words">
|
|
108
|
+
{{ value(item.message) }}
|
|
109
|
+
</dd>
|
|
110
|
+
</div>
|
|
111
|
+
<div class="sm:col-span-2">
|
|
112
|
+
<dt class="text-muted-foreground">User-Agent</dt>
|
|
113
|
+
<dd class="mt-1 whitespace-pre-wrap break-all">
|
|
114
|
+
{{ value(actor.userAgent) }}
|
|
115
|
+
</dd>
|
|
116
|
+
</div>
|
|
117
|
+
<div class="sm:col-span-2">
|
|
118
|
+
<dt class="text-muted-foreground">Metadata(已脱敏)</dt>
|
|
119
|
+
<dd class="mt-1">
|
|
120
|
+
<pre
|
|
121
|
+
class="max-h-64 overflow-auto whitespace-pre-wrap break-all rounded-md bg-muted p-3 font-mono text-xs"
|
|
122
|
+
>{{ formatAuditMetadata(item.metadata) }}</pre>
|
|
123
|
+
</dd>
|
|
124
|
+
</div>
|
|
125
|
+
</dl>
|
|
126
|
+
|
|
127
|
+
<DialogFooter>
|
|
128
|
+
<DialogClose as-child>
|
|
129
|
+
<Button variant="outline">关闭</Button>
|
|
130
|
+
</DialogClose>
|
|
131
|
+
</DialogFooter>
|
|
132
|
+
</DialogContent>
|
|
133
|
+
</Dialog>
|
|
134
|
+
</template>
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { flushPromises, mount } from "@vue/test-utils";
|
|
2
|
+
import { afterEach, describe, expect, test } from "vitest";
|
|
3
|
+
import AuditLogDetailDialog from "./AuditLogDetailDialog.vue";
|
|
4
|
+
|
|
5
|
+
afterEach(() => {
|
|
6
|
+
document.body.innerHTML = "";
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
describe("审计日志详情", () => {
|
|
10
|
+
test("以纯文本展示 IP、来源、对象、上下文和已脱敏 metadata", async () => {
|
|
11
|
+
const wrapper = mount(AuditLogDetailDialog, {
|
|
12
|
+
props: {
|
|
13
|
+
open: true,
|
|
14
|
+
item: {
|
|
15
|
+
id: "audit_1",
|
|
16
|
+
action: "feature.update",
|
|
17
|
+
outcome: "success",
|
|
18
|
+
actor: {
|
|
19
|
+
id: "user_1",
|
|
20
|
+
name: "管理员",
|
|
21
|
+
ip: "203.0.113.8",
|
|
22
|
+
userAgent: "Windy-Browser/1.0",
|
|
23
|
+
},
|
|
24
|
+
target: {
|
|
25
|
+
type: "features",
|
|
26
|
+
id: "system.audit",
|
|
27
|
+
label: "审计日志",
|
|
28
|
+
},
|
|
29
|
+
occurredAt: "2026-07-20T01:15:00.000Z",
|
|
30
|
+
message: "更新功能策略",
|
|
31
|
+
module: "system",
|
|
32
|
+
requestId: "request_1",
|
|
33
|
+
metadata: {
|
|
34
|
+
enabled: true,
|
|
35
|
+
token: "[REDACTED]",
|
|
36
|
+
note: "<script>unsafe()</script>",
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
attachTo: document.body,
|
|
41
|
+
});
|
|
42
|
+
await flushPromises();
|
|
43
|
+
|
|
44
|
+
expect(document.body.textContent).toContain("审计日志详情");
|
|
45
|
+
expect(document.body.textContent).toContain("管理员(user_1)");
|
|
46
|
+
expect(document.body.textContent).toContain("203.0.113.8");
|
|
47
|
+
expect(document.body.textContent).toContain("Windy-Browser/1.0");
|
|
48
|
+
expect(document.body.textContent).toContain("审计日志(features / system.audit)");
|
|
49
|
+
expect(document.body.textContent).toContain("[REDACTED]");
|
|
50
|
+
expect(document.body.querySelector("script")).toBeNull();
|
|
51
|
+
wrapper.unmount();
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test("未知动作和缺失字段使用明确 fallback", async () => {
|
|
55
|
+
const wrapper = mount(AuditLogDetailDialog, {
|
|
56
|
+
props: {
|
|
57
|
+
open: true,
|
|
58
|
+
item: {
|
|
59
|
+
id: "audit_unknown",
|
|
60
|
+
action: "case.review.complete",
|
|
61
|
+
outcome: "success",
|
|
62
|
+
actor: { id: "service_1", name: "案件服务" },
|
|
63
|
+
occurredAt: "2026-07-20T01:15:00.000Z",
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
attachTo: document.body,
|
|
67
|
+
});
|
|
68
|
+
await flushPromises();
|
|
69
|
+
|
|
70
|
+
expect(document.body.textContent).toContain("case.review.complete");
|
|
71
|
+
expect(document.body.textContent).toContain("未记录操作对象");
|
|
72
|
+
expect(document.body.textContent).toContain("IP");
|
|
73
|
+
expect(document.body.textContent).toContain("未记录");
|
|
74
|
+
wrapper.unmount();
|
|
75
|
+
});
|
|
76
|
+
});
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed, onMounted, shallowRef, watch } from "vue";
|
|
3
3
|
import { AUDIT_ACTION_DEFINITIONS } from "@southwind-ai/shared";
|
|
4
|
+
import { SearchIcon, XIcon } from "@lucide/vue";
|
|
5
|
+
import { Button } from "@/components/ui/button";
|
|
6
|
+
import { Checkbox } from "@/components/ui/checkbox";
|
|
7
|
+
import { Input } from "@/components/ui/input";
|
|
4
8
|
import {
|
|
5
9
|
Select,
|
|
6
10
|
SelectContent,
|
|
@@ -8,20 +12,28 @@ import {
|
|
|
8
12
|
SelectTrigger,
|
|
9
13
|
SelectValue,
|
|
10
14
|
} from "@/components/ui/select";
|
|
11
|
-
import { Checkbox } from "@/components/ui/checkbox";
|
|
12
15
|
import { useAccessSnapshot } from "@/composables/useAccessSnapshot";
|
|
13
16
|
import { listSystemResource, type SystemRecord } from "@/services/system-api";
|
|
17
|
+
import { localMinuteToIso } from "../audit-time-range";
|
|
18
|
+
|
|
19
|
+
export interface AuditLogFilterValue {
|
|
20
|
+
q?: string;
|
|
21
|
+
actorId?: string;
|
|
22
|
+
action?: string;
|
|
23
|
+
occurredAfter?: string;
|
|
24
|
+
occurredBefore?: string;
|
|
25
|
+
}
|
|
14
26
|
|
|
15
27
|
const emit = defineEmits<{
|
|
16
|
-
change: [
|
|
17
|
-
filters: { actorId?: string; action?: string; occurredAfter?: string },
|
|
18
|
-
];
|
|
28
|
+
change: [filters: AuditLogFilterValue];
|
|
19
29
|
"export-options": [options: { includeScheduler: boolean }];
|
|
20
30
|
}>();
|
|
21
31
|
|
|
32
|
+
const keyword = shallowRef("");
|
|
22
33
|
const actorId = shallowRef("all");
|
|
23
34
|
const action = shallowRef("all");
|
|
24
|
-
const
|
|
35
|
+
const occurredAfterLocal = shallowRef("");
|
|
36
|
+
const occurredBeforeLocal = shallowRef("");
|
|
25
37
|
const optionSource = shallowRef<SystemRecord[]>([]);
|
|
26
38
|
const includeScheduler = shallowRef(false);
|
|
27
39
|
const access = useAccessSnapshot();
|
|
@@ -53,66 +65,118 @@ onMounted(async () => {
|
|
|
53
65
|
}
|
|
54
66
|
});
|
|
55
67
|
|
|
56
|
-
watch(
|
|
68
|
+
watch(includeScheduler, (value) => {
|
|
69
|
+
emit("export-options", { includeScheduler: value });
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
function applyFilters() {
|
|
57
73
|
emit("change", {
|
|
74
|
+
q: keyword.value.trim() || undefined,
|
|
58
75
|
actorId: actorId.value === "all" ? undefined : actorId.value,
|
|
59
76
|
action: action.value === "all" ? undefined : action.value,
|
|
60
|
-
occurredAfter:
|
|
77
|
+
occurredAfter: localMinuteToIso(occurredAfterLocal.value, "start"),
|
|
78
|
+
occurredBefore: localMinuteToIso(occurredBeforeLocal.value, "end"),
|
|
61
79
|
});
|
|
62
|
-
}
|
|
80
|
+
}
|
|
63
81
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
82
|
+
function resetFilters() {
|
|
83
|
+
keyword.value = "";
|
|
84
|
+
actorId.value = "all";
|
|
85
|
+
action.value = "all";
|
|
86
|
+
occurredAfterLocal.value = "";
|
|
87
|
+
occurredBeforeLocal.value = "";
|
|
88
|
+
applyFilters();
|
|
89
|
+
}
|
|
67
90
|
|
|
68
|
-
function
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
week: 7 * 24 * 60 * 60 * 1_000,
|
|
72
|
-
month: 30 * 24 * 60 * 60 * 1_000,
|
|
73
|
-
}[value];
|
|
74
|
-
return duration ? new Date(Date.now() - duration).toISOString() : undefined;
|
|
91
|
+
function clearKeyword() {
|
|
92
|
+
keyword.value = "";
|
|
93
|
+
applyFilters();
|
|
75
94
|
}
|
|
76
95
|
</script>
|
|
77
96
|
|
|
78
97
|
<template>
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
+
<form
|
|
99
|
+
class="space-y-3"
|
|
100
|
+
data-testid="audit-filters"
|
|
101
|
+
@submit.prevent="applyFilters"
|
|
102
|
+
>
|
|
103
|
+
<div class="grid gap-3 lg:grid-cols-2 xl:grid-cols-4">
|
|
104
|
+
<div class="flex gap-2">
|
|
105
|
+
<Input
|
|
106
|
+
v-model="keyword"
|
|
107
|
+
aria-label="审计关键字"
|
|
108
|
+
placeholder="搜索动作、操作者、对象、IP 或上下文"
|
|
109
|
+
maxlength="120"
|
|
110
|
+
/>
|
|
111
|
+
<Button
|
|
112
|
+
v-if="keyword"
|
|
113
|
+
type="button"
|
|
114
|
+
variant="outline"
|
|
115
|
+
aria-label="清空审计关键字"
|
|
116
|
+
@click="clearKeyword"
|
|
98
117
|
>
|
|
99
|
-
|
|
100
|
-
</
|
|
101
|
-
</
|
|
102
|
-
|
|
118
|
+
清空
|
|
119
|
+
</Button>
|
|
120
|
+
</div>
|
|
121
|
+
<Select v-model="actorId">
|
|
122
|
+
<SelectTrigger aria-label="筛选操作者"><SelectValue /></SelectTrigger>
|
|
123
|
+
<SelectContent>
|
|
124
|
+
<SelectItem value="all">全部操作者</SelectItem>
|
|
125
|
+
<SelectItem v-for="actor in actors" :key="actor.id" :value="actor.id">
|
|
126
|
+
{{ actor.name }}({{ actor.id }})
|
|
127
|
+
</SelectItem>
|
|
128
|
+
</SelectContent>
|
|
129
|
+
</Select>
|
|
130
|
+
<Select v-model="action">
|
|
131
|
+
<SelectTrigger aria-label="筛选动作"><SelectValue /></SelectTrigger>
|
|
132
|
+
<SelectContent>
|
|
133
|
+
<SelectItem value="all">全部动作</SelectItem>
|
|
134
|
+
<SelectItem
|
|
135
|
+
v-for="definition in actionCatalog"
|
|
136
|
+
:key="definition.key"
|
|
137
|
+
:value="definition.key"
|
|
138
|
+
>
|
|
139
|
+
{{ definition.label }}({{ definition.key }})
|
|
140
|
+
</SelectItem>
|
|
141
|
+
</SelectContent>
|
|
142
|
+
</Select>
|
|
143
|
+
<div class="flex gap-2">
|
|
144
|
+
<Button type="submit" class="flex-1">
|
|
145
|
+
<SearchIcon data-icon="inline-start" />
|
|
146
|
+
查询
|
|
147
|
+
</Button>
|
|
148
|
+
<Button type="button" variant="outline" @click="resetFilters">
|
|
149
|
+
<XIcon data-icon="inline-start" />
|
|
150
|
+
重置
|
|
151
|
+
</Button>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
|
+
<div class="grid gap-3 md:grid-cols-2">
|
|
156
|
+
<label class="space-y-1 text-sm">
|
|
157
|
+
<span class="text-muted-foreground">开始时间(本地时间)</span>
|
|
158
|
+
<Input
|
|
159
|
+
v-model="occurredAfterLocal"
|
|
160
|
+
aria-label="审计开始时间"
|
|
161
|
+
type="datetime-local"
|
|
162
|
+
step="60"
|
|
163
|
+
/>
|
|
164
|
+
</label>
|
|
165
|
+
<label class="space-y-1 text-sm">
|
|
166
|
+
<span class="text-muted-foreground">结束时间(本地时间)</span>
|
|
167
|
+
<Input
|
|
168
|
+
v-model="occurredBeforeLocal"
|
|
169
|
+
aria-label="审计结束时间"
|
|
170
|
+
type="datetime-local"
|
|
171
|
+
step="60"
|
|
172
|
+
/>
|
|
173
|
+
</label>
|
|
174
|
+
</div>
|
|
175
|
+
</form>
|
|
103
176
|
|
|
104
|
-
<Select v-model="timeRange">
|
|
105
|
-
<SelectTrigger aria-label="筛选时间"><SelectValue /></SelectTrigger>
|
|
106
|
-
<SelectContent>
|
|
107
|
-
<SelectItem value="all">全部时间</SelectItem>
|
|
108
|
-
<SelectItem value="day">最近 24 小时</SelectItem>
|
|
109
|
-
<SelectItem value="week">最近 7 天</SelectItem>
|
|
110
|
-
<SelectItem value="month">最近 30 天</SelectItem>
|
|
111
|
-
</SelectContent>
|
|
112
|
-
</Select>
|
|
113
|
-
</div>
|
|
114
177
|
<p class="text-xs text-muted-foreground">
|
|
115
|
-
|
|
178
|
+
起点按所选分钟的 00.000 秒计算,终点包含所选分钟至 59.999
|
|
179
|
+
秒;操作者选项来自最近 100 条审计记录。
|
|
116
180
|
</p>
|
|
117
181
|
<label class="flex w-fit items-center gap-2 text-sm">
|
|
118
182
|
<Checkbox v-model="includeScheduler" aria-label="导出时包含定时器日志" />
|