nuxt-observe 0.0.2
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/README.md +92 -0
- package/dist/module.d.mts +7 -0
- package/dist/module.json +9 -0
- package/dist/module.mjs +393 -0
- package/dist/runtime/app/assets/css/main.css +1 -0
- package/dist/runtime/app/components/ObserveActivityFeed.d.vue.ts +13 -0
- package/dist/runtime/app/components/ObserveActivityFeed.vue +77 -0
- package/dist/runtime/app/components/ObserveActivityFeed.vue.d.ts +13 -0
- package/dist/runtime/app/components/ObserveActivityTable.d.vue.ts +30 -0
- package/dist/runtime/app/components/ObserveActivityTable.vue +187 -0
- package/dist/runtime/app/components/ObserveActivityTable.vue.d.ts +30 -0
- package/dist/runtime/app/components/ObserveCan.d.vue.ts +27 -0
- package/dist/runtime/app/components/ObserveCan.vue +16 -0
- package/dist/runtime/app/components/ObserveCan.vue.d.ts +27 -0
- package/dist/runtime/app/components/ObserveErrorsTable.d.vue.ts +19 -0
- package/dist/runtime/app/components/ObserveErrorsTable.vue +105 -0
- package/dist/runtime/app/components/ObserveErrorsTable.vue.d.ts +19 -0
- package/dist/runtime/app/components/ObserveHealthHero.d.vue.ts +16 -0
- package/dist/runtime/app/components/ObserveHealthHero.vue +114 -0
- package/dist/runtime/app/components/ObserveHealthHero.vue.d.ts +16 -0
- package/dist/runtime/app/components/ObserveJourneySearch.d.vue.ts +13 -0
- package/dist/runtime/app/components/ObserveJourneySearch.vue +55 -0
- package/dist/runtime/app/components/ObserveJourneySearch.vue.d.ts +13 -0
- package/dist/runtime/app/components/ObserveJourneyTimeline.d.vue.ts +14 -0
- package/dist/runtime/app/components/ObserveJourneyTimeline.vue +119 -0
- package/dist/runtime/app/components/ObserveJourneyTimeline.vue.d.ts +14 -0
- package/dist/runtime/app/components/ObserveLogDetail.d.vue.ts +12 -0
- package/dist/runtime/app/components/ObserveLogDetail.vue +187 -0
- package/dist/runtime/app/components/ObserveLogDetail.vue.d.ts +12 -0
- package/dist/runtime/app/components/ObserveLogLevelBadge.d.vue.ts +10 -0
- package/dist/runtime/app/components/ObserveLogLevelBadge.vue +29 -0
- package/dist/runtime/app/components/ObserveLogLevelBadge.vue.d.ts +10 -0
- package/dist/runtime/app/components/ObserveLogsFilterBar.d.vue.ts +20 -0
- package/dist/runtime/app/components/ObserveLogsFilterBar.vue +134 -0
- package/dist/runtime/app/components/ObserveLogsFilterBar.vue.d.ts +20 -0
- package/dist/runtime/app/components/ObserveLogsTable.d.vue.ts +20 -0
- package/dist/runtime/app/components/ObserveLogsTable.vue +92 -0
- package/dist/runtime/app/components/ObserveLogsTable.vue.d.ts +20 -0
- package/dist/runtime/app/components/ObservePeriodSelector.d.vue.ts +3 -0
- package/dist/runtime/app/components/ObservePeriodSelector.vue +22 -0
- package/dist/runtime/app/components/ObservePeriodSelector.vue.d.ts +3 -0
- package/dist/runtime/app/components/ObserveRegressionAlert.d.vue.ts +12 -0
- package/dist/runtime/app/components/ObserveRegressionAlert.vue +27 -0
- package/dist/runtime/app/components/ObserveRegressionAlert.vue.d.ts +12 -0
- package/dist/runtime/app/components/ObserveServiceSwitcher.d.vue.ts +3 -0
- package/dist/runtime/app/components/ObserveServiceSwitcher.vue +49 -0
- package/dist/runtime/app/components/ObserveServiceSwitcher.vue.d.ts +3 -0
- package/dist/runtime/app/components/ObserveServicesTable.d.vue.ts +15 -0
- package/dist/runtime/app/components/ObserveServicesTable.vue +109 -0
- package/dist/runtime/app/components/ObserveServicesTable.vue.d.ts +15 -0
- package/dist/runtime/app/components/ObserveStatCard.d.vue.ts +14 -0
- package/dist/runtime/app/components/ObserveStatCard.vue +34 -0
- package/dist/runtime/app/components/ObserveStatCard.vue.d.ts +14 -0
- package/dist/runtime/app/components/charts/ObserveErrorRateChart.client.d.vue.ts +15 -0
- package/dist/runtime/app/components/charts/ObserveErrorRateChart.client.vue +170 -0
- package/dist/runtime/app/components/charts/ObserveErrorRateChart.client.vue.d.ts +15 -0
- package/dist/runtime/app/components/charts/ObserveServiceBreakdownChart.client.d.vue.ts +17 -0
- package/dist/runtime/app/components/charts/ObserveServiceBreakdownChart.client.vue +208 -0
- package/dist/runtime/app/components/charts/ObserveServiceBreakdownChart.client.vue.d.ts +17 -0
- package/dist/runtime/app/components/charts/ObserveVersionAdoptionChart.client.d.vue.ts +14 -0
- package/dist/runtime/app/components/charts/ObserveVersionAdoptionChart.client.vue +208 -0
- package/dist/runtime/app/components/charts/ObserveVersionAdoptionChart.client.vue.d.ts +14 -0
- package/dist/runtime/app/components/charts/ObserveVersionCompareChart.client.d.vue.ts +14 -0
- package/dist/runtime/app/components/charts/ObserveVersionCompareChart.client.vue +190 -0
- package/dist/runtime/app/components/charts/ObserveVersionCompareChart.client.vue.d.ts +14 -0
- package/dist/runtime/app/components/charts/ObserveVolumeChart.client.d.vue.ts +16 -0
- package/dist/runtime/app/components/charts/ObserveVolumeChart.client.vue +199 -0
- package/dist/runtime/app/components/charts/ObserveVolumeChart.client.vue.d.ts +16 -0
- package/dist/runtime/app/components/charts/chart-core.d.ts +64 -0
- package/dist/runtime/app/components/charts/chart-core.js +136 -0
- package/dist/runtime/app/components/settings/ObserveApiKeyPanel.d.vue.ts +8 -0
- package/dist/runtime/app/components/settings/ObserveApiKeyPanel.vue +145 -0
- package/dist/runtime/app/components/settings/ObserveApiKeyPanel.vue.d.ts +8 -0
- package/dist/runtime/app/components/settings/ObserveApiKeyRevealModal.d.vue.ts +19 -0
- package/dist/runtime/app/components/settings/ObserveApiKeyRevealModal.vue +106 -0
- package/dist/runtime/app/components/settings/ObserveApiKeyRevealModal.vue.d.ts +19 -0
- package/dist/runtime/app/components/settings/ObserveAssignmentEditor.d.vue.ts +12 -0
- package/dist/runtime/app/components/settings/ObserveAssignmentEditor.vue +67 -0
- package/dist/runtime/app/components/settings/ObserveAssignmentEditor.vue.d.ts +12 -0
- package/dist/runtime/app/components/settings/ObserveGroupFormModal.d.vue.ts +18 -0
- package/dist/runtime/app/components/settings/ObserveGroupFormModal.vue +60 -0
- package/dist/runtime/app/components/settings/ObserveGroupFormModal.vue.d.ts +18 -0
- package/dist/runtime/app/components/settings/ObserveGroupMembershipEditor.d.vue.ts +20 -0
- package/dist/runtime/app/components/settings/ObserveGroupMembershipEditor.vue +21 -0
- package/dist/runtime/app/components/settings/ObserveGroupMembershipEditor.vue.d.ts +20 -0
- package/dist/runtime/app/components/settings/ObserveOriginAllowlistEditor.d.vue.ts +15 -0
- package/dist/runtime/app/components/settings/ObserveOriginAllowlistEditor.vue +63 -0
- package/dist/runtime/app/components/settings/ObserveOriginAllowlistEditor.vue.d.ts +15 -0
- package/dist/runtime/app/components/settings/ObserveServiceEditForm.d.vue.ts +38 -0
- package/dist/runtime/app/components/settings/ObserveServiceEditForm.vue +216 -0
- package/dist/runtime/app/components/settings/ObserveServiceEditForm.vue.d.ts +38 -0
- package/dist/runtime/app/components/settings/ObserveServiceFormModal.d.vue.ts +37 -0
- package/dist/runtime/app/components/settings/ObserveServiceFormModal.vue +192 -0
- package/dist/runtime/app/components/settings/ObserveServiceFormModal.vue.d.ts +37 -0
- package/dist/runtime/app/components/settings/ObserveServiceTypeBadge.d.vue.ts +11 -0
- package/dist/runtime/app/components/settings/ObserveServiceTypeBadge.vue +18 -0
- package/dist/runtime/app/components/settings/ObserveServiceTypeBadge.vue.d.ts +11 -0
- package/dist/runtime/app/components/settings/ObserveSettingsServicesTable.d.vue.ts +19 -0
- package/dist/runtime/app/components/settings/ObserveSettingsServicesTable.vue +132 -0
- package/dist/runtime/app/components/settings/ObserveSettingsServicesTable.vue.d.ts +19 -0
- package/dist/runtime/app/components/settings/ObserveUserFormModal.d.vue.ts +27 -0
- package/dist/runtime/app/components/settings/ObserveUserFormModal.vue +108 -0
- package/dist/runtime/app/components/settings/ObserveUserFormModal.vue.d.ts +27 -0
- package/dist/runtime/app/components/settings/ObserveVersionTrackingField.d.vue.ts +17 -0
- package/dist/runtime/app/components/settings/ObserveVersionTrackingField.vue +20 -0
- package/dist/runtime/app/components/settings/ObserveVersionTrackingField.vue.d.ts +17 -0
- package/dist/runtime/app/composables/useObserveAbility.d.ts +15 -0
- package/dist/runtime/app/composables/useObserveAbility.js +20 -0
- package/dist/runtime/app/composables/useObserveActivity.d.ts +22 -0
- package/dist/runtime/app/composables/useObserveActivity.js +44 -0
- package/dist/runtime/app/composables/useObserveApiKeys.d.ts +15 -0
- package/dist/runtime/app/composables/useObserveApiKeys.js +19 -0
- package/dist/runtime/app/composables/useObserveAssignments.d.ts +19 -0
- package/dist/runtime/app/composables/useObserveAssignments.js +16 -0
- package/dist/runtime/app/composables/useObserveErrors.d.ts +33 -0
- package/dist/runtime/app/composables/useObserveErrors.js +85 -0
- package/dist/runtime/app/composables/useObserveGroups.d.ts +27 -0
- package/dist/runtime/app/composables/useObserveGroups.js +33 -0
- package/dist/runtime/app/composables/useObserveJourney.d.ts +19 -0
- package/dist/runtime/app/composables/useObserveJourney.js +19 -0
- package/dist/runtime/app/composables/useObserveLogFacets.d.ts +11 -0
- package/dist/runtime/app/composables/useObserveLogFacets.js +21 -0
- package/dist/runtime/app/composables/useObserveLogs.d.ts +28 -0
- package/dist/runtime/app/composables/useObserveLogs.js +100 -0
- package/dist/runtime/app/composables/useObserveMigrations.d.ts +17 -0
- package/dist/runtime/app/composables/useObserveMigrations.js +49 -0
- package/dist/runtime/app/composables/useObserveOverview.d.ts +14 -0
- package/dist/runtime/app/composables/useObserveOverview.js +23 -0
- package/dist/runtime/app/composables/useObservePeriod.d.ts +11 -0
- package/dist/runtime/app/composables/useObservePeriod.js +18 -0
- package/dist/runtime/app/composables/useObserveRollout.d.ts +20 -0
- package/dist/runtime/app/composables/useObserveRollout.js +55 -0
- package/dist/runtime/app/composables/useObserveScope.d.ts +13 -0
- package/dist/runtime/app/composables/useObserveScope.js +17 -0
- package/dist/runtime/app/composables/useObserveServices.d.ts +26 -0
- package/dist/runtime/app/composables/useObserveServices.js +33 -0
- package/dist/runtime/app/composables/useObserveStats.d.ts +14 -0
- package/dist/runtime/app/composables/useObserveStats.js +23 -0
- package/dist/runtime/app/composables/useObserveUsers.d.ts +29 -0
- package/dist/runtime/app/composables/useObserveUsers.js +33 -0
- package/dist/runtime/app/layouts/observe.d.vue.ts +13 -0
- package/dist/runtime/app/layouts/observe.vue +138 -0
- package/dist/runtime/app/layouts/observe.vue.d.ts +13 -0
- package/dist/runtime/app/middleware/observe-auth.global.d.ts +9 -0
- package/dist/runtime/app/middleware/observe-auth.global.js +8 -0
- package/dist/runtime/app/pages/activity.d.vue.ts +3 -0
- package/dist/runtime/app/pages/activity.vue +54 -0
- package/dist/runtime/app/pages/activity.vue.d.ts +3 -0
- package/dist/runtime/app/pages/error-detail.d.vue.ts +3 -0
- package/dist/runtime/app/pages/error-detail.vue +190 -0
- package/dist/runtime/app/pages/error-detail.vue.d.ts +3 -0
- package/dist/runtime/app/pages/errors.d.vue.ts +3 -0
- package/dist/runtime/app/pages/errors.vue +47 -0
- package/dist/runtime/app/pages/errors.vue.d.ts +3 -0
- package/dist/runtime/app/pages/journey.d.vue.ts +3 -0
- package/dist/runtime/app/pages/journey.vue +96 -0
- package/dist/runtime/app/pages/journey.vue.d.ts +3 -0
- package/dist/runtime/app/pages/log-detail.d.vue.ts +3 -0
- package/dist/runtime/app/pages/log-detail.vue +35 -0
- package/dist/runtime/app/pages/log-detail.vue.d.ts +3 -0
- package/dist/runtime/app/pages/login.d.vue.ts +3 -0
- package/dist/runtime/app/pages/login.vue +69 -0
- package/dist/runtime/app/pages/login.vue.d.ts +3 -0
- package/dist/runtime/app/pages/logs.d.vue.ts +3 -0
- package/dist/runtime/app/pages/logs.vue +36 -0
- package/dist/runtime/app/pages/logs.vue.d.ts +3 -0
- package/dist/runtime/app/pages/metrics.d.vue.ts +3 -0
- package/dist/runtime/app/pages/metrics.vue +68 -0
- package/dist/runtime/app/pages/metrics.vue.d.ts +3 -0
- package/dist/runtime/app/pages/overview.d.vue.ts +3 -0
- package/dist/runtime/app/pages/overview.vue +65 -0
- package/dist/runtime/app/pages/overview.vue.d.ts +3 -0
- package/dist/runtime/app/pages/rollout.d.vue.ts +3 -0
- package/dist/runtime/app/pages/rollout.vue +188 -0
- package/dist/runtime/app/pages/rollout.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/group-detail.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/group-detail.vue +149 -0
- package/dist/runtime/app/pages/settings/group-detail.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/groups.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/groups.vue +107 -0
- package/dist/runtime/app/pages/settings/groups.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/index.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/index.vue +47 -0
- package/dist/runtime/app/pages/settings/index.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/migrations.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/migrations.vue +275 -0
- package/dist/runtime/app/pages/settings/migrations.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/service-detail.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/service-detail.vue +133 -0
- package/dist/runtime/app/pages/settings/service-detail.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/services.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/services.vue +66 -0
- package/dist/runtime/app/pages/settings/services.vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/users/[id].d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/users/[id].vue +243 -0
- package/dist/runtime/app/pages/settings/users/[id].vue.d.ts +3 -0
- package/dist/runtime/app/pages/settings/users/index.d.vue.ts +3 -0
- package/dist/runtime/app/pages/settings/users/index.vue +129 -0
- package/dist/runtime/app/pages/settings/users/index.vue.d.ts +3 -0
- package/dist/runtime/options.d.ts +1 -0
- package/dist/runtime/options.js +1 -0
- package/dist/runtime/server/api/observe/activity.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/activity.get.js +30 -0
- package/dist/runtime/server/api/observe/auth/login.post.d.ts +4 -0
- package/dist/runtime/server/api/observe/auth/login.post.js +13 -0
- package/dist/runtime/server/api/observe/auth/logout.post.d.ts +4 -0
- package/dist/runtime/server/api/observe/auth/logout.post.js +6 -0
- package/dist/runtime/server/api/observe/auth/me.get.d.ts +2 -0
- package/dist/runtime/server/api/observe/auth/me.get.js +3 -0
- package/dist/runtime/server/api/observe/errors/[fingerprint].get.d.ts +3 -0
- package/dist/runtime/server/api/observe/errors/[fingerprint].get.js +56 -0
- package/dist/runtime/server/api/observe/errors/index.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/errors/index.get.js +41 -0
- package/dist/runtime/server/api/observe/facets.get.d.ts +8 -0
- package/dist/runtime/server/api/observe/facets.get.js +12 -0
- package/dist/runtime/server/api/observe/groups/[id]/assignments.put.d.ts +3 -0
- package/dist/runtime/server/api/observe/groups/[id]/assignments.put.js +12 -0
- package/dist/runtime/server/api/observe/groups/[id]/services.put.d.ts +5 -0
- package/dist/runtime/server/api/observe/groups/[id]/services.put.js +13 -0
- package/dist/runtime/server/api/observe/groups/[id].delete.d.ts +5 -0
- package/dist/runtime/server/api/observe/groups/[id].delete.js +11 -0
- package/dist/runtime/server/api/observe/groups/[id].get.d.ts +6 -0
- package/dist/runtime/server/api/observe/groups/[id].get.js +14 -0
- package/dist/runtime/server/api/observe/groups/[id].patch.d.ts +3 -0
- package/dist/runtime/server/api/observe/groups/[id].patch.js +12 -0
- package/dist/runtime/server/api/observe/groups/index.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/groups/index.get.js +7 -0
- package/dist/runtime/server/api/observe/groups/index.post.d.ts +3 -0
- package/dist/runtime/server/api/observe/groups/index.post.js +11 -0
- package/dist/runtime/server/api/observe/health.get.d.ts +6 -0
- package/dist/runtime/server/api/observe/health.get.js +10 -0
- package/dist/runtime/server/api/observe/ingest/frogger.d.ts +5 -0
- package/dist/runtime/server/api/observe/ingest/frogger.js +42 -0
- package/dist/runtime/server/api/observe/ingest.d.ts +5 -0
- package/dist/runtime/server/api/observe/ingest.js +38 -0
- package/dist/runtime/server/api/observe/journey.get.d.ts +9 -0
- package/dist/runtime/server/api/observe/journey.get.js +31 -0
- package/dist/runtime/server/api/observe/logs/[id].get.d.ts +3 -0
- package/dist/runtime/server/api/observe/logs/[id].get.js +19 -0
- package/dist/runtime/server/api/observe/logs.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/logs.get.js +54 -0
- package/dist/runtime/server/api/observe/migrations/index.get.d.ts +9 -0
- package/dist/runtime/server/api/observe/migrations/index.get.js +14 -0
- package/dist/runtime/server/api/observe/migrations/run.post.d.ts +13 -0
- package/dist/runtime/server/api/observe/migrations/run.post.js +35 -0
- package/dist/runtime/server/api/observe/overview.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/overview.get.js +19 -0
- package/dist/runtime/server/api/observe/rollout/compare.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/rollout/compare.get.js +24 -0
- package/dist/runtime/server/api/observe/rollout/regressions.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/rollout/regressions.get.js +31 -0
- package/dist/runtime/server/api/observe/rollout/versions.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/rollout/versions.get.js +20 -0
- package/dist/runtime/server/api/observe/services/[id]/assignments.put.d.ts +7 -0
- package/dist/runtime/server/api/observe/services/[id]/assignments.put.js +12 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/[keyId]/rotate.post.d.ts +4 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/[keyId]/rotate.post.js +14 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/[keyId].delete.d.ts +4 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/[keyId].delete.js +14 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/index.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/index.get.js +10 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/index.post.d.ts +3 -0
- package/dist/runtime/server/api/observe/services/[id]/keys/index.post.js +11 -0
- package/dist/runtime/server/api/observe/services/[id]/restore.post.d.ts +4 -0
- package/dist/runtime/server/api/observe/services/[id]/restore.post.js +11 -0
- package/dist/runtime/server/api/observe/services/[id].delete.d.ts +11 -0
- package/dist/runtime/server/api/observe/services/[id].delete.js +11 -0
- package/dist/runtime/server/api/observe/services/[id].get.d.ts +3 -0
- package/dist/runtime/server/api/observe/services/[id].get.js +12 -0
- package/dist/runtime/server/api/observe/services/[id].patch.d.ts +3 -0
- package/dist/runtime/server/api/observe/services/[id].patch.js +13 -0
- package/dist/runtime/server/api/observe/services/index.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/services/index.get.js +7 -0
- package/dist/runtime/server/api/observe/services/index.post.d.ts +3 -0
- package/dist/runtime/server/api/observe/services/index.post.js +16 -0
- package/dist/runtime/server/api/observe/stats.get.d.ts +3 -0
- package/dist/runtime/server/api/observe/stats.get.js +28 -0
- package/dist/runtime/server/api/observe/users/[id]/assignments.put.d.ts +3 -0
- package/dist/runtime/server/api/observe/users/[id]/assignments.put.js +14 -0
- package/dist/runtime/server/api/observe/users/[id].delete.d.ts +4 -0
- package/dist/runtime/server/api/observe/users/[id].delete.js +15 -0
- package/dist/runtime/server/api/observe/users/[id].get.d.ts +3 -0
- package/dist/runtime/server/api/observe/users/[id].get.js +11 -0
- package/dist/runtime/server/api/observe/users/[id].patch.d.ts +3 -0
- package/dist/runtime/server/api/observe/users/[id].patch.js +25 -0
- package/dist/runtime/server/api/observe/users/index.get.d.ts +8 -0
- package/dist/runtime/server/api/observe/users/index.get.js +7 -0
- package/dist/runtime/server/api/observe/users/index.post.d.ts +3 -0
- package/dist/runtime/server/api/observe/users/index.post.js +29 -0
- package/dist/runtime/server/auth/authorization.d.ts +7 -0
- package/dist/runtime/server/auth/authorization.js +5 -0
- package/dist/runtime/server/auth/provider.d.ts +17 -0
- package/dist/runtime/server/auth/provider.js +44 -0
- package/dist/runtime/server/auth/providers/config-provider.d.ts +18 -0
- package/dist/runtime/server/auth/providers/config-provider.js +54 -0
- package/dist/runtime/server/auth/providers/db-provider.d.ts +16 -0
- package/dist/runtime/server/auth/providers/db-provider.js +42 -0
- package/dist/runtime/server/auth/providers/jwt-provider.d.ts +24 -0
- package/dist/runtime/server/auth/providers/jwt-provider.js +72 -0
- package/dist/runtime/server/migrations/0001-services-kind.d.ts +8 -0
- package/dist/runtime/server/migrations/0001-services-kind.js +14 -0
- package/dist/runtime/server/migrations/0002-services-type.d.ts +7 -0
- package/dist/runtime/server/migrations/0002-services-type.js +14 -0
- package/dist/runtime/server/migrations/0003-services-deleted-at.d.ts +6 -0
- package/dist/runtime/server/migrations/0003-services-deleted-at.js +14 -0
- package/dist/runtime/server/migrations/0004-logs-error-fingerprint.d.ts +11 -0
- package/dist/runtime/server/migrations/0004-logs-error-fingerprint.js +15 -0
- package/dist/runtime/server/migrations/0005-users-columns.d.ts +9 -0
- package/dist/runtime/server/migrations/0005-users-columns.js +25 -0
- package/dist/runtime/server/migrations/index.d.ts +13 -0
- package/dist/runtime/server/migrations/index.js +13 -0
- package/dist/runtime/server/migrations/types.d.ts +15 -0
- package/dist/runtime/server/migrations/types.js +0 -0
- package/dist/runtime/server/plugins/observe-migrate.server.d.ts +2 -0
- package/dist/runtime/server/plugins/observe-migrate.server.js +18 -0
- package/dist/runtime/server/tasks/backfill-fingerprints.d.ts +11 -0
- package/dist/runtime/server/tasks/backfill-fingerprints.js +41 -0
- package/dist/runtime/server/tasks/purge.d.ts +5 -0
- package/dist/runtime/server/tasks/purge.js +12 -0
- package/dist/runtime/server/tsconfig.json +3 -0
- package/dist/runtime/server/utils/activity-query.d.ts +28 -0
- package/dist/runtime/server/utils/activity-query.js +70 -0
- package/dist/runtime/server/utils/api-keys.d.ts +48 -0
- package/dist/runtime/server/utils/api-keys.js +67 -0
- package/dist/runtime/server/utils/authz.d.ts +50 -0
- package/dist/runtime/server/utils/authz.js +60 -0
- package/dist/runtime/server/utils/db/users.d.ts +91 -0
- package/dist/runtime/server/utils/db/users.js +128 -0
- package/dist/runtime/server/utils/db.d.ts +10 -0
- package/dist/runtime/server/utils/db.js +5 -0
- package/dist/runtime/server/utils/frogger-adapter.d.ts +40 -0
- package/dist/runtime/server/utils/frogger-adapter.js +97 -0
- package/dist/runtime/server/utils/groups.d.ts +35 -0
- package/dist/runtime/server/utils/groups.js +59 -0
- package/dist/runtime/server/utils/ingest-cors.d.ts +23 -0
- package/dist/runtime/server/utils/ingest-cors.js +27 -0
- package/dist/runtime/server/utils/journey.d.ts +20 -0
- package/dist/runtime/server/utils/journey.js +44 -0
- package/dist/runtime/server/utils/logs.d.ts +50 -0
- package/dist/runtime/server/utils/logs.js +154 -0
- package/dist/runtime/server/utils/loop-guard.d.ts +11 -0
- package/dist/runtime/server/utils/loop-guard.js +11 -0
- package/dist/runtime/server/utils/migrate.d.ts +21 -0
- package/dist/runtime/server/utils/migrate.js +144 -0
- package/dist/runtime/server/utils/migration-runner.d.ts +42 -0
- package/dist/runtime/server/utils/migration-runner.js +129 -0
- package/dist/runtime/server/utils/observe-errors.d.ts +58 -0
- package/dist/runtime/server/utils/observe-errors.js +206 -0
- package/dist/runtime/server/utils/overview.d.ts +20 -0
- package/dist/runtime/server/utils/overview.js +119 -0
- package/dist/runtime/server/utils/provisioning.d.ts +62 -0
- package/dist/runtime/server/utils/provisioning.js +299 -0
- package/dist/runtime/server/utils/rate-limit.d.ts +11 -0
- package/dist/runtime/server/utils/rate-limit.js +22 -0
- package/dist/runtime/server/utils/require-observe-session.d.ts +15 -0
- package/dist/runtime/server/utils/require-observe-session.js +25 -0
- package/dist/runtime/server/utils/rollout.d.ts +19 -0
- package/dist/runtime/server/utils/rollout.js +56 -0
- package/dist/runtime/server/utils/scope.d.ts +14 -0
- package/dist/runtime/server/utils/scope.js +28 -0
- package/dist/runtime/server/utils/seed.d.ts +18 -0
- package/dist/runtime/server/utils/seed.js +70 -0
- package/dist/runtime/server/utils/services.d.ts +91 -0
- package/dist/runtime/server/utils/services.js +142 -0
- package/dist/runtime/server/utils/stats-query.d.ts +40 -0
- package/dist/runtime/server/utils/stats-query.js +104 -0
- package/dist/runtime/shared/auth/roles.d.ts +34 -0
- package/dist/runtime/shared/auth/roles.js +6 -0
- package/dist/runtime/shared/auth/schema.d.ts +85 -0
- package/dist/runtime/shared/auth/schema.js +41 -0
- package/dist/runtime/shared/auth/types.d.ts +68 -0
- package/dist/runtime/shared/auth/types.js +0 -0
- package/dist/runtime/shared/rbac/capabilities.d.ts +46 -0
- package/dist/runtime/shared/rbac/capabilities.js +48 -0
- package/dist/runtime/shared/schema/activity.d.ts +77 -0
- package/dist/runtime/shared/schema/activity.js +22 -0
- package/dist/runtime/shared/schema/adapters/frogger.d.ts +52 -0
- package/dist/runtime/shared/schema/adapters/frogger.js +17 -0
- package/dist/runtime/shared/schema/batch.d.ts +33 -0
- package/dist/runtime/shared/schema/batch.js +9 -0
- package/dist/runtime/shared/schema/error-fingerprint.d.ts +53 -0
- package/dist/runtime/shared/schema/error-fingerprint.js +47 -0
- package/dist/runtime/shared/schema/errors-query.d.ts +136 -0
- package/dist/runtime/shared/schema/errors-query.js +47 -0
- package/dist/runtime/shared/schema/event.d.ts +48 -0
- package/dist/runtime/shared/schema/event.js +41 -0
- package/dist/runtime/shared/schema/frogger-map.d.ts +62 -0
- package/dist/runtime/shared/schema/frogger-map.js +30 -0
- package/dist/runtime/shared/schema/index.d.ts +17 -0
- package/dist/runtime/shared/schema/index.js +17 -0
- package/dist/runtime/shared/schema/journey.d.ts +99 -0
- package/dist/runtime/shared/schema/journey.js +96 -0
- package/dist/runtime/shared/schema/levels.d.ts +37 -0
- package/dist/runtime/shared/schema/levels.js +72 -0
- package/dist/runtime/shared/schema/log-row.d.ts +31 -0
- package/dist/runtime/shared/schema/log-row.js +0 -0
- package/dist/runtime/shared/schema/logs-query.d.ts +91 -0
- package/dist/runtime/shared/schema/logs-query.js +72 -0
- package/dist/runtime/shared/schema/migrations.d.ts +34 -0
- package/dist/runtime/shared/schema/migrations.js +0 -0
- package/dist/runtime/shared/schema/overview.d.ts +78 -0
- package/dist/runtime/shared/schema/overview.js +9 -0
- package/dist/runtime/shared/schema/provisioning.d.ts +230 -0
- package/dist/runtime/shared/schema/provisioning.js +52 -0
- package/dist/runtime/shared/schema/registry.d.ts +115 -0
- package/dist/runtime/shared/schema/registry.js +27 -0
- package/dist/runtime/shared/schema/rollout.d.ts +103 -0
- package/dist/runtime/shared/schema/rollout.js +66 -0
- package/dist/runtime/shared/schema/stats.d.ts +64 -0
- package/dist/runtime/shared/schema/stats.js +15 -0
- package/dist/runtime/shared/schema/tiers.d.ts +5 -0
- package/dist/runtime/shared/schema/tiers.js +9 -0
- package/dist/runtime/shared/types/module-options.d.ts +119 -0
- package/dist/runtime/shared/types/module-options.js +13 -0
- package/dist/runtime/shared/types/storage.d.ts +31 -0
- package/dist/runtime/shared/types/storage.js +0 -0
- package/dist/runtime/shared/utils/format-relative.d.ts +7 -0
- package/dist/runtime/shared/utils/format-relative.js +11 -0
- package/dist/runtime/shared/utils/frogger-snippet.d.ts +19 -0
- package/dist/runtime/shared/utils/frogger-snippet.js +33 -0
- package/dist/runtime/shared/utils/observe-config.d.ts +9 -0
- package/dist/runtime/shared/utils/observe-config.js +17 -0
- package/dist/runtime/shared/utils/period.d.ts +13 -0
- package/dist/runtime/shared/utils/period.js +15 -0
- package/dist/runtime/shared/utils/slug.d.ts +1 -0
- package/dist/runtime/shared/utils/slug.js +5 -0
- package/dist/runtime/shared/utils/uuid.d.ts +187 -0
- package/dist/runtime/shared/utils/uuid.js +345 -0
- package/dist/runtime/types/nuxt-auth-utils-imports.d.ts +25 -0
- package/dist/runtime/types/observe-app-imports.d.ts +20 -0
- package/dist/runtime/types/session.d.ts +17 -0
- package/dist/schema.d.mts +1318 -0
- package/dist/schema.mjs +629 -0
- package/dist/types.d.mts +3 -0
- package/package.json +93 -0
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useRoute, useRuntimeConfig } from "#imports";
|
|
4
|
+
import { useObserveServiceDetail, useObserveServices } from "../../composables/useObserveServices";
|
|
5
|
+
import { useObserveGroups } from "../../composables/useObserveGroups";
|
|
6
|
+
import { useObserveAbility } from "../../composables/useObserveAbility";
|
|
7
|
+
const route = useRoute();
|
|
8
|
+
const id = route.params.id;
|
|
9
|
+
const { prefix } = useRuntimeConfig().public.observe;
|
|
10
|
+
const { data, pending, error, refresh } = useObserveServiceDetail(id);
|
|
11
|
+
const { data: groups } = useObserveGroups();
|
|
12
|
+
const { update, softDelete, restore } = useObserveServices();
|
|
13
|
+
const { can, canForService } = useObserveAbility();
|
|
14
|
+
const canManage = computed(() => {
|
|
15
|
+
const slug = data.value?.slug;
|
|
16
|
+
return slug ? canForService("services.manage", slug) : false;
|
|
17
|
+
});
|
|
18
|
+
async function onSave(patch) {
|
|
19
|
+
await update(id, patch);
|
|
20
|
+
await refresh();
|
|
21
|
+
}
|
|
22
|
+
async function onDelete() {
|
|
23
|
+
await softDelete(id);
|
|
24
|
+
await refresh();
|
|
25
|
+
}
|
|
26
|
+
async function onRestore() {
|
|
27
|
+
await restore(id);
|
|
28
|
+
await refresh();
|
|
29
|
+
}
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<template>
|
|
33
|
+
<div class="space-y-6">
|
|
34
|
+
<UButton
|
|
35
|
+
:to="`${prefix}/settings/services`"
|
|
36
|
+
icon="i-lucide-arrow-left"
|
|
37
|
+
color="neutral"
|
|
38
|
+
variant="ghost"
|
|
39
|
+
size="sm"
|
|
40
|
+
label="Services"
|
|
41
|
+
/>
|
|
42
|
+
|
|
43
|
+
<UAlert
|
|
44
|
+
v-if="error"
|
|
45
|
+
color="error"
|
|
46
|
+
variant="subtle"
|
|
47
|
+
title="Failed to load service"
|
|
48
|
+
:description="error.message"
|
|
49
|
+
/>
|
|
50
|
+
|
|
51
|
+
<div
|
|
52
|
+
v-else-if="pending && !data"
|
|
53
|
+
class="text-sm text-muted"
|
|
54
|
+
>
|
|
55
|
+
Loading…
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<template v-else-if="data">
|
|
59
|
+
<div class="flex items-start justify-between gap-4">
|
|
60
|
+
<div class="space-y-1">
|
|
61
|
+
<div class="flex items-center gap-2">
|
|
62
|
+
<h1 class="text-lg font-semibold">
|
|
63
|
+
{{ data.name }}
|
|
64
|
+
</h1>
|
|
65
|
+
<ObserveServiceTypeBadge :type="data.type" />
|
|
66
|
+
<UBadge
|
|
67
|
+
:color="data.kind === 'browser' ? 'info' : 'neutral'"
|
|
68
|
+
variant="subtle"
|
|
69
|
+
size="sm"
|
|
70
|
+
:label="data.kind"
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
<div class="font-mono text-xs text-muted">
|
|
74
|
+
{{ data.slug }}
|
|
75
|
+
</div>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
78
|
+
<div
|
|
79
|
+
v-if="can('services.create')"
|
|
80
|
+
class="flex gap-2"
|
|
81
|
+
>
|
|
82
|
+
<UButton
|
|
83
|
+
v-if="data.deletedAt"
|
|
84
|
+
icon="i-lucide-undo-2"
|
|
85
|
+
color="primary"
|
|
86
|
+
variant="soft"
|
|
87
|
+
label="Restore"
|
|
88
|
+
@click="onRestore"
|
|
89
|
+
/>
|
|
90
|
+
<UButton
|
|
91
|
+
v-else-if="!data.managedByConfig"
|
|
92
|
+
icon="i-lucide-trash-2"
|
|
93
|
+
color="error"
|
|
94
|
+
variant="soft"
|
|
95
|
+
label="Delete"
|
|
96
|
+
@click="onDelete"
|
|
97
|
+
/>
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
<UAlert
|
|
102
|
+
v-if="data.deletedAt && data.purgeAt"
|
|
103
|
+
color="error"
|
|
104
|
+
variant="subtle"
|
|
105
|
+
icon="i-lucide-clock"
|
|
106
|
+
title="Pending deletion"
|
|
107
|
+
:description="`This service is scheduled for permanent purge. Restore it before then to keep its logs and keys.`"
|
|
108
|
+
/>
|
|
109
|
+
|
|
110
|
+
<div class="grid gap-8 lg:grid-cols-2">
|
|
111
|
+
<div class="space-y-4">
|
|
112
|
+
<h2 class="text-sm font-semibold uppercase tracking-wider text-muted">
|
|
113
|
+
Details
|
|
114
|
+
</h2>
|
|
115
|
+
<ObserveServiceEditForm
|
|
116
|
+
:service="data"
|
|
117
|
+
:groups="groups ?? []"
|
|
118
|
+
:can-manage="canManage"
|
|
119
|
+
@save="onSave"
|
|
120
|
+
/>
|
|
121
|
+
</div>
|
|
122
|
+
|
|
123
|
+
<div class="space-y-8">
|
|
124
|
+
<ObserveApiKeyPanel
|
|
125
|
+
:service-id="data.id"
|
|
126
|
+
:can-manage="canManage"
|
|
127
|
+
/>
|
|
128
|
+
<ObserveAssignmentEditor :service-slug="data.slug" />
|
|
129
|
+
</div>
|
|
130
|
+
</div>
|
|
131
|
+
</template>
|
|
132
|
+
</div>
|
|
133
|
+
</template>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref } from "vue";
|
|
3
|
+
import { useObserveServices } from "../../composables/useObserveServices";
|
|
4
|
+
const { data, pending, error, refresh, create, softDelete, restore } = useObserveServices();
|
|
5
|
+
const formOpen = ref(false);
|
|
6
|
+
const creating = ref(false);
|
|
7
|
+
async function onCreate(input) {
|
|
8
|
+
creating.value = true;
|
|
9
|
+
try {
|
|
10
|
+
await create(input);
|
|
11
|
+
formOpen.value = false;
|
|
12
|
+
await refresh();
|
|
13
|
+
} finally {
|
|
14
|
+
creating.value = false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
async function onDelete(service) {
|
|
18
|
+
await softDelete(service.id);
|
|
19
|
+
await refresh();
|
|
20
|
+
}
|
|
21
|
+
async function onRestore(service) {
|
|
22
|
+
await restore(service.id);
|
|
23
|
+
await refresh();
|
|
24
|
+
}
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template>
|
|
28
|
+
<div class="space-y-4">
|
|
29
|
+
<div class="flex items-center justify-between">
|
|
30
|
+
<p class="text-sm text-muted">
|
|
31
|
+
Registered observables. A soft-deleted service is recoverable for one hour before permanent purge.
|
|
32
|
+
</p>
|
|
33
|
+
<ObserveCan capability="services.create">
|
|
34
|
+
<UButton
|
|
35
|
+
icon="i-lucide-plus"
|
|
36
|
+
label="New service"
|
|
37
|
+
@click="() => {
|
|
38
|
+
formOpen = true;
|
|
39
|
+
}"
|
|
40
|
+
/>
|
|
41
|
+
</ObserveCan>
|
|
42
|
+
</div>
|
|
43
|
+
|
|
44
|
+
<UAlert
|
|
45
|
+
v-if="error"
|
|
46
|
+
color="error"
|
|
47
|
+
variant="subtle"
|
|
48
|
+
title="Failed to load services"
|
|
49
|
+
:description="error.message"
|
|
50
|
+
/>
|
|
51
|
+
|
|
52
|
+
<ObserveSettingsServicesTable
|
|
53
|
+
v-else
|
|
54
|
+
:services="data ?? []"
|
|
55
|
+
:pending="pending"
|
|
56
|
+
@delete="onDelete"
|
|
57
|
+
@restore="onRestore"
|
|
58
|
+
/>
|
|
59
|
+
|
|
60
|
+
<ObserveServiceFormModal
|
|
61
|
+
v-model:open="formOpen"
|
|
62
|
+
:loading="creating"
|
|
63
|
+
@submit="onCreate"
|
|
64
|
+
/>
|
|
65
|
+
</div>
|
|
66
|
+
</template>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { reactive, ref, watch, computed } from "vue";
|
|
3
|
+
import { useRoute, useRuntimeConfig } from "#imports";
|
|
4
|
+
import { ROLES } from "../../../../shared/auth/roles";
|
|
5
|
+
import { useObserveUsers, useObserveUserDetail } from "../../../composables/useObserveUsers";
|
|
6
|
+
import { useObserveServices } from "../../../composables/useObserveServices";
|
|
7
|
+
import { useObserveGroups } from "../../../composables/useObserveGroups";
|
|
8
|
+
const route = useRoute();
|
|
9
|
+
const id = route.params.id;
|
|
10
|
+
const { prefix } = useRuntimeConfig().public.observe;
|
|
11
|
+
const { data, pending, error, refresh, saveAssignments } = useObserveUserDetail(id);
|
|
12
|
+
const { update } = useObserveUsers();
|
|
13
|
+
const { data: services } = useObserveServices();
|
|
14
|
+
const { data: groups } = useObserveGroups();
|
|
15
|
+
const roleItems = ROLES.map((r) => ({ value: r, label: r }));
|
|
16
|
+
const actionError = ref(null);
|
|
17
|
+
const saving = ref(false);
|
|
18
|
+
const form = reactive({ displayName: "", role: "viewer", disabled: false, password: "" });
|
|
19
|
+
watch(data, (u) => {
|
|
20
|
+
if (!u) return;
|
|
21
|
+
form.displayName = u.displayName ?? "";
|
|
22
|
+
form.role = u.role;
|
|
23
|
+
form.disabled = u.disabled;
|
|
24
|
+
form.password = "";
|
|
25
|
+
}, { immediate: true });
|
|
26
|
+
async function onSaveProfile() {
|
|
27
|
+
saving.value = true;
|
|
28
|
+
actionError.value = null;
|
|
29
|
+
try {
|
|
30
|
+
await update(id, {
|
|
31
|
+
displayName: form.displayName.trim() || null,
|
|
32
|
+
role: form.role,
|
|
33
|
+
disabled: form.disabled,
|
|
34
|
+
...form.password ? { password: form.password } : {}
|
|
35
|
+
});
|
|
36
|
+
form.password = "";
|
|
37
|
+
await refresh();
|
|
38
|
+
} catch (e) {
|
|
39
|
+
actionError.value = e?.data?.error === "LAST_ADMIN" ? "Cannot demote or disable the last admin." : e.message;
|
|
40
|
+
} finally {
|
|
41
|
+
saving.value = false;
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
const selectedServiceIds = ref([]);
|
|
45
|
+
const serviceRoles = reactive({});
|
|
46
|
+
const selectedGroupIds = ref([]);
|
|
47
|
+
const groupRoles = reactive({});
|
|
48
|
+
watch(data, (u) => {
|
|
49
|
+
if (!u) return;
|
|
50
|
+
selectedServiceIds.value = u.services.map((s) => s.serviceId);
|
|
51
|
+
for (const s of u.services) serviceRoles[s.serviceId] = s.role;
|
|
52
|
+
selectedGroupIds.value = u.groups.map((g) => g.groupId);
|
|
53
|
+
for (const g of u.groups) groupRoles[g.groupId] = g.role;
|
|
54
|
+
}, { immediate: true });
|
|
55
|
+
const serviceItems = computed(() => (services.value ?? []).map((s) => ({ value: s.id, label: s.name })));
|
|
56
|
+
const groupItems = computed(() => (groups.value ?? []).map((g) => ({ value: g.id, label: g.name })));
|
|
57
|
+
const serviceName = (sid) => services.value?.find((s) => s.id === sid)?.name ?? sid;
|
|
58
|
+
const groupName = (gid) => groups.value?.find((g) => g.id === gid)?.name ?? gid;
|
|
59
|
+
async function onSaveAssignments() {
|
|
60
|
+
saving.value = true;
|
|
61
|
+
actionError.value = null;
|
|
62
|
+
try {
|
|
63
|
+
await saveAssignments({
|
|
64
|
+
services: selectedServiceIds.value.map((sid) => ({ serviceId: sid, role: serviceRoles[sid] ?? "viewer" })),
|
|
65
|
+
groups: selectedGroupIds.value.map((gid) => ({ groupId: gid, role: groupRoles[gid] ?? "viewer" }))
|
|
66
|
+
});
|
|
67
|
+
await refresh();
|
|
68
|
+
} catch (e) {
|
|
69
|
+
actionError.value = e.message;
|
|
70
|
+
} finally {
|
|
71
|
+
saving.value = false;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
</script>
|
|
75
|
+
|
|
76
|
+
<template>
|
|
77
|
+
<div class="space-y-6">
|
|
78
|
+
<UButton
|
|
79
|
+
:to="`${prefix}/settings/users`"
|
|
80
|
+
icon="i-lucide-arrow-left"
|
|
81
|
+
color="neutral"
|
|
82
|
+
variant="ghost"
|
|
83
|
+
size="sm"
|
|
84
|
+
label="Users"
|
|
85
|
+
/>
|
|
86
|
+
|
|
87
|
+
<UAlert
|
|
88
|
+
v-if="error"
|
|
89
|
+
color="error"
|
|
90
|
+
variant="subtle"
|
|
91
|
+
title="Failed to load user"
|
|
92
|
+
:description="error.message"
|
|
93
|
+
/>
|
|
94
|
+
<div
|
|
95
|
+
v-else-if="pending && !data"
|
|
96
|
+
class="text-sm text-muted"
|
|
97
|
+
>
|
|
98
|
+
Loading…
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
<template v-else-if="data">
|
|
102
|
+
<div class="space-y-1">
|
|
103
|
+
<h1 class="text-lg font-semibold">
|
|
104
|
+
{{ data.name }}
|
|
105
|
+
</h1>
|
|
106
|
+
<div class="font-mono text-xs text-muted">
|
|
107
|
+
{{ data.username }} · {{ data.source }}
|
|
108
|
+
</div>
|
|
109
|
+
</div>
|
|
110
|
+
|
|
111
|
+
<UAlert
|
|
112
|
+
v-if="actionError"
|
|
113
|
+
color="error"
|
|
114
|
+
variant="subtle"
|
|
115
|
+
title="Action failed"
|
|
116
|
+
:description="actionError"
|
|
117
|
+
/>
|
|
118
|
+
|
|
119
|
+
<div class="grid gap-8 lg:grid-cols-2">
|
|
120
|
+
<div class="space-y-4">
|
|
121
|
+
<h2 class="text-sm font-semibold uppercase tracking-wider text-muted">
|
|
122
|
+
Profile
|
|
123
|
+
</h2>
|
|
124
|
+
<UFormField
|
|
125
|
+
label="Display name"
|
|
126
|
+
name="displayName"
|
|
127
|
+
>
|
|
128
|
+
<UInput
|
|
129
|
+
v-model="form.displayName"
|
|
130
|
+
:placeholder="data.username"
|
|
131
|
+
/>
|
|
132
|
+
</UFormField>
|
|
133
|
+
<UFormField
|
|
134
|
+
label="Role"
|
|
135
|
+
name="role"
|
|
136
|
+
>
|
|
137
|
+
<USelectMenu
|
|
138
|
+
v-model="form.role"
|
|
139
|
+
:items="roleItems"
|
|
140
|
+
value-key="value"
|
|
141
|
+
:search-input="false"
|
|
142
|
+
/>
|
|
143
|
+
</UFormField>
|
|
144
|
+
<UFormField
|
|
145
|
+
label="Disabled"
|
|
146
|
+
name="disabled"
|
|
147
|
+
hint="A disabled user cannot authenticate."
|
|
148
|
+
>
|
|
149
|
+
<USwitch v-model="form.disabled" />
|
|
150
|
+
</UFormField>
|
|
151
|
+
<UFormField
|
|
152
|
+
label="Reset password"
|
|
153
|
+
name="password"
|
|
154
|
+
hint="At least 8 characters. Leave blank to keep the current password."
|
|
155
|
+
>
|
|
156
|
+
<UInput
|
|
157
|
+
v-model="form.password"
|
|
158
|
+
type="password"
|
|
159
|
+
placeholder="••••••••"
|
|
160
|
+
/>
|
|
161
|
+
</UFormField>
|
|
162
|
+
<UButton
|
|
163
|
+
label="Save profile"
|
|
164
|
+
:loading="saving"
|
|
165
|
+
@click="onSaveProfile"
|
|
166
|
+
/>
|
|
167
|
+
</div>
|
|
168
|
+
|
|
169
|
+
<div class="space-y-4">
|
|
170
|
+
<h2 class="text-sm font-semibold uppercase tracking-wider text-muted">
|
|
171
|
+
Assignments
|
|
172
|
+
</h2>
|
|
173
|
+
<p
|
|
174
|
+
v-if="data.role === 'admin'"
|
|
175
|
+
class="text-sm text-muted"
|
|
176
|
+
>
|
|
177
|
+
Admins have access to every service and group; explicit assignments are ignored.
|
|
178
|
+
</p>
|
|
179
|
+
|
|
180
|
+
<UFormField
|
|
181
|
+
label="Services"
|
|
182
|
+
name="services"
|
|
183
|
+
>
|
|
184
|
+
<USelectMenu
|
|
185
|
+
v-model="selectedServiceIds"
|
|
186
|
+
:items="serviceItems"
|
|
187
|
+
value-key="value"
|
|
188
|
+
multiple
|
|
189
|
+
placeholder="Assign services"
|
|
190
|
+
/>
|
|
191
|
+
</UFormField>
|
|
192
|
+
<div
|
|
193
|
+
v-for="sid in selectedServiceIds"
|
|
194
|
+
:key="sid"
|
|
195
|
+
class="flex items-center gap-2"
|
|
196
|
+
>
|
|
197
|
+
<span class="flex-1 truncate text-sm">{{ serviceName(sid) }}</span>
|
|
198
|
+
<USelectMenu
|
|
199
|
+
v-model="serviceRoles[sid]"
|
|
200
|
+
:items="roleItems"
|
|
201
|
+
value-key="value"
|
|
202
|
+
:search-input="false"
|
|
203
|
+
class="w-32"
|
|
204
|
+
/>
|
|
205
|
+
</div>
|
|
206
|
+
|
|
207
|
+
<UFormField
|
|
208
|
+
label="Groups"
|
|
209
|
+
name="groups"
|
|
210
|
+
>
|
|
211
|
+
<USelectMenu
|
|
212
|
+
v-model="selectedGroupIds"
|
|
213
|
+
:items="groupItems"
|
|
214
|
+
value-key="value"
|
|
215
|
+
multiple
|
|
216
|
+
placeholder="Assign groups"
|
|
217
|
+
/>
|
|
218
|
+
</UFormField>
|
|
219
|
+
<div
|
|
220
|
+
v-for="gid in selectedGroupIds"
|
|
221
|
+
:key="gid"
|
|
222
|
+
class="flex items-center gap-2"
|
|
223
|
+
>
|
|
224
|
+
<span class="flex-1 truncate text-sm">{{ groupName(gid) }}</span>
|
|
225
|
+
<USelectMenu
|
|
226
|
+
v-model="groupRoles[gid]"
|
|
227
|
+
:items="roleItems"
|
|
228
|
+
value-key="value"
|
|
229
|
+
:search-input="false"
|
|
230
|
+
class="w-32"
|
|
231
|
+
/>
|
|
232
|
+
</div>
|
|
233
|
+
|
|
234
|
+
<UButton
|
|
235
|
+
label="Save assignments"
|
|
236
|
+
:loading="saving"
|
|
237
|
+
@click="onSaveAssignments"
|
|
238
|
+
/>
|
|
239
|
+
</div>
|
|
240
|
+
</div>
|
|
241
|
+
</template>
|
|
242
|
+
</div>
|
|
243
|
+
</template>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, computed } from "vue";
|
|
3
|
+
import { useRuntimeConfig } from "#imports";
|
|
4
|
+
import { useObserveUsers } from "../../../composables/useObserveUsers";
|
|
5
|
+
const { prefix } = useRuntimeConfig().public.observe;
|
|
6
|
+
const { data, pending, error, refresh, create, remove } = useObserveUsers();
|
|
7
|
+
const formOpen = ref(false);
|
|
8
|
+
const creating = ref(false);
|
|
9
|
+
const actionError = ref(null);
|
|
10
|
+
async function onCreate(input) {
|
|
11
|
+
creating.value = true;
|
|
12
|
+
actionError.value = null;
|
|
13
|
+
try {
|
|
14
|
+
await create(input);
|
|
15
|
+
formOpen.value = false;
|
|
16
|
+
await refresh();
|
|
17
|
+
} catch (e) {
|
|
18
|
+
actionError.value = e?.data?.message ?? e.message;
|
|
19
|
+
} finally {
|
|
20
|
+
creating.value = false;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
async function onDelete(user) {
|
|
24
|
+
actionError.value = null;
|
|
25
|
+
try {
|
|
26
|
+
await remove(user.id);
|
|
27
|
+
await refresh();
|
|
28
|
+
} catch (e) {
|
|
29
|
+
actionError.value = e?.data?.error === "LAST_ADMIN" ? "Cannot delete the last admin." : e.message;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const roleColor = { admin: "primary", manager: "info", viewer: "neutral" };
|
|
33
|
+
const columns = computed(() => [
|
|
34
|
+
{ id: "name", accessorKey: "name", header: "User" },
|
|
35
|
+
{ id: "role", accessorKey: "role", header: "Role" },
|
|
36
|
+
{ id: "actions", header: "" }
|
|
37
|
+
]);
|
|
38
|
+
</script>
|
|
39
|
+
|
|
40
|
+
<template>
|
|
41
|
+
<div class="space-y-4">
|
|
42
|
+
<div class="flex items-center justify-between">
|
|
43
|
+
<p class="text-sm text-muted">
|
|
44
|
+
Dashboard users, their global role and assigned scope.
|
|
45
|
+
</p>
|
|
46
|
+
<ObserveCan capability="users.manage">
|
|
47
|
+
<UButton
|
|
48
|
+
icon="i-lucide-plus"
|
|
49
|
+
label="Add user"
|
|
50
|
+
@click="() => {
|
|
51
|
+
formOpen = true;
|
|
52
|
+
}"
|
|
53
|
+
/>
|
|
54
|
+
</ObserveCan>
|
|
55
|
+
</div>
|
|
56
|
+
|
|
57
|
+
<UAlert
|
|
58
|
+
v-if="error"
|
|
59
|
+
color="error"
|
|
60
|
+
variant="subtle"
|
|
61
|
+
title="Failed to load users"
|
|
62
|
+
:description="error.message"
|
|
63
|
+
/>
|
|
64
|
+
<UAlert
|
|
65
|
+
v-else-if="actionError"
|
|
66
|
+
color="error"
|
|
67
|
+
variant="subtle"
|
|
68
|
+
title="Action failed"
|
|
69
|
+
:description="actionError"
|
|
70
|
+
/>
|
|
71
|
+
|
|
72
|
+
<UCard
|
|
73
|
+
v-if="!error"
|
|
74
|
+
:ui="{ body: 'p-0 sm:p-0' }"
|
|
75
|
+
>
|
|
76
|
+
<UTable
|
|
77
|
+
:data="data ?? []"
|
|
78
|
+
:columns="columns"
|
|
79
|
+
:loading="pending"
|
|
80
|
+
empty="No users yet."
|
|
81
|
+
>
|
|
82
|
+
<template #name-cell="{ row }">
|
|
83
|
+
<NuxtLink
|
|
84
|
+
:to="`${prefix}/settings/users/${row.original.id}`"
|
|
85
|
+
class="font-medium hover:underline"
|
|
86
|
+
>
|
|
87
|
+
{{ row.original.name }}
|
|
88
|
+
</NuxtLink>
|
|
89
|
+
</template>
|
|
90
|
+
<template #role-cell="{ row }">
|
|
91
|
+
<UBadge
|
|
92
|
+
:color="roleColor[row.original.role] ?? 'neutral'"
|
|
93
|
+
variant="subtle"
|
|
94
|
+
size="sm"
|
|
95
|
+
:label="row.original.role"
|
|
96
|
+
/>
|
|
97
|
+
</template>
|
|
98
|
+
<template #actions-cell="{ row }">
|
|
99
|
+
<ObserveCan capability="users.manage">
|
|
100
|
+
<div class="flex justify-end gap-1">
|
|
101
|
+
<UButton
|
|
102
|
+
:to="`${prefix}/settings/users/${row.original.id}`"
|
|
103
|
+
icon="i-lucide-pencil"
|
|
104
|
+
color="neutral"
|
|
105
|
+
variant="ghost"
|
|
106
|
+
size="xs"
|
|
107
|
+
label="Manage"
|
|
108
|
+
/>
|
|
109
|
+
<UButton
|
|
110
|
+
icon="i-lucide-trash-2"
|
|
111
|
+
color="error"
|
|
112
|
+
variant="ghost"
|
|
113
|
+
size="xs"
|
|
114
|
+
label="Delete"
|
|
115
|
+
@click="onDelete(row.original)"
|
|
116
|
+
/>
|
|
117
|
+
</div>
|
|
118
|
+
</ObserveCan>
|
|
119
|
+
</template>
|
|
120
|
+
</UTable>
|
|
121
|
+
</UCard>
|
|
122
|
+
|
|
123
|
+
<ObserveUserFormModal
|
|
124
|
+
v-model:open="formOpen"
|
|
125
|
+
:loading="creating"
|
|
126
|
+
@submit="onCreate"
|
|
127
|
+
/>
|
|
128
|
+
</div>
|
|
129
|
+
</template>
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
declare const __VLS_export: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
2
|
+
declare const _default: typeof __VLS_export;
|
|
3
|
+
export default _default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { defineObserveOptions } from './shared/utils/observe-config.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { defineObserveOptions } from "./shared/utils/observe-config.js";
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { defineEventHandler, getValidatedQuery, createError, H3Error } from "h3";
|
|
2
|
+
import { activityQuerySchema } from "../../../shared/schema/activity.js";
|
|
3
|
+
import { periodToRange } from "../../../shared/utils/period.js";
|
|
4
|
+
import { requireCapability, getAllowedServiceIds } from "../../utils/authz.js";
|
|
5
|
+
import { resolveEffectiveScope } from "../../utils/scope.js";
|
|
6
|
+
import { getActivity } from "../../utils/activity-query.js";
|
|
7
|
+
export default defineEventHandler(async (event) => {
|
|
8
|
+
const { principal } = await requireCapability(event, "stats.read");
|
|
9
|
+
const { period, service, group, dimension, env, level, q, sort, limit } = await getValidatedQuery(event, activityQuerySchema.parse);
|
|
10
|
+
const allowed = await getAllowedServiceIds(event, principal);
|
|
11
|
+
const effective = await resolveEffectiveScope(event, principal, allowed, { service, group });
|
|
12
|
+
const { from, to, label } = periodToRange(period);
|
|
13
|
+
const base = {
|
|
14
|
+
dimension,
|
|
15
|
+
period: { from, to, label },
|
|
16
|
+
scope: { serviceIds: effective === "*" ? [] : effective, isAll: effective === "*" },
|
|
17
|
+
sort,
|
|
18
|
+
limit
|
|
19
|
+
};
|
|
20
|
+
if (effective !== "*" && effective.length === 0) {
|
|
21
|
+
return { ...base, items: [], total: 0, withKey: 0, degraded: false };
|
|
22
|
+
}
|
|
23
|
+
try {
|
|
24
|
+
const data = await getActivity(effective, from, to, { dimension, env, level, q, sort, limit });
|
|
25
|
+
return { ...base, ...data };
|
|
26
|
+
} catch (e) {
|
|
27
|
+
if (e instanceof H3Error) throw e;
|
|
28
|
+
throw createError({ statusCode: 500, statusMessage: "Activity query failed" });
|
|
29
|
+
}
|
|
30
|
+
});
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { defineEventHandler, readValidatedBody, createError } from "h3";
|
|
2
|
+
import { setUserSession } from "#imports";
|
|
3
|
+
import { loginBodySchema } from "../../../../shared/auth/schema.js";
|
|
4
|
+
import { getAuthProvider } from "../../../auth/provider.js";
|
|
5
|
+
export default defineEventHandler(async (event) => {
|
|
6
|
+
const body = await readValidatedBody(event, loginBodySchema.parse);
|
|
7
|
+
const result = await getAuthProvider().authenticate(body, event);
|
|
8
|
+
if (!result.ok || !result.principal) {
|
|
9
|
+
throw createError({ statusCode: 401, statusMessage: "Invalid credentials" });
|
|
10
|
+
}
|
|
11
|
+
await setUserSession(event, { user: result.principal, loggedInAt: Date.now() });
|
|
12
|
+
return { user: result.principal };
|
|
13
|
+
});
|