Compare commits

..

12 commits

Author SHA1 Message Date
e963826d8d web: Refactor frontend utilities and eliminate duplicate code
All checks were successful
continuous-integration/drone/push Build is passing
Extract shared test utilities (getStatusColor, getStatusKey, formatDuration)
into web/src/lib/utils/test.ts and extend datetime.ts with formatTestDate and
formatRelative (with full i18n support). Remove 4 sets of duplicate functions
across the tests/* pages, fix $app/stores → $app/state in plugins/[pid], and
fix inline type import in results/[rid].

Create PluginOptionsGroups.svelte shared component for read-only option group
rendering, used by both web and web-admin plugin detail pages. Update
web-admin/src/routes/plugins/[pname]/+page.svelte to use i18n translations
throughout, replacing all hardcoded English strings.

Add i18n keys: tests.relative.{in,ago,just-now,in-less-than-a-minute} and
plugins.tests.back-button to en.json and fr.json.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11 20:38:25 +07:00
11a65fa2ac Wire option merging for scheduled test executions
Fetch user/domain/service-level plugin options via GetTestPluginOptions
and merge them with schedule-specific options (schedule opts take priority)
before running a test. Previously tests only used schedule.Options.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11 20:38:25 +07:00
8b13477d11 Add limit/offset pagination to ListTestSchedules endpoint
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11 20:38:25 +07:00
2d20c4f4de Add panic recovery in plugin execution goroutine
Wrap plugin.RunTest() call with defer/recover so a panicking plugin sends
an error to errorChan instead of silently killing the worker goroutine.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11 20:38:25 +07:00
384ba0c18f Implement cleanup stubs for test result retention
- Add DeleteTestResultsBefore/DeleteCompletedExecutionsBefore to storage interface and KV implementation
- Implement CleanupOldResults() using configured ResultRetentionDays (default 90 days)
- Implement DeleteCompletedExecutions() removing records older than given duration
- Wire both into testScheduler.cleanup() so daily cleanup actually prunes data

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-02-11 20:38:25 +07:00
c19cf16480 Add admin API and frontend for scheduler management 2026-02-11 20:38:25 +07:00
bcb3e3ccc5 web: Add frontend for domain tests browsing and execution
Add test API client, data models, Svelte store, and pages to list
available tests per domain, view results, and trigger test runs via a
dedicated modal. Also refactor plugins page to use a shared store.
2026-02-11 20:38:25 +07:00
554db48dd9 web: Replace page data flags with route ID checks for history/logs pages 2026-02-11 20:38:25 +07:00
d844cd44ac Implement tests scheduler 2026-02-11 20:38:25 +07:00
33b11c96ed Implement backend model for test results and schedule 2026-02-11 20:38:25 +07:00
33fc1fe171 Add plugin interface: api routes and frontend to manage user plugins 2026-02-11 20:38:25 +07:00
4fd2efe5fe Add test plugin routes to API + refactor plugins controller 2026-02-11 20:38:25 +07:00

View file

@ -74,6 +74,37 @@ func (uc *TestPluginController) TestPluginOptionHandler(c *gin.Context) {
c.Next()
}
// ListTestPlugins retrieves all available test plugins.
//
// @Summary List test plugins (admin)
// @Schemes
// @Description Retrieves a list of all available test plugins with their version information.
// @Tags plugins
// @Accept json
// @Produce json
// @Success 200 {object} map[string]happydns.PluginVersionInfo "Map of plugin name to version info"
// @Failure 500 {object} happydns.ErrorResponse "Internal server error"
// @Router /plugins/tests [get]
func (uc *TestPluginController) ListTestPlugins(c *gin.Context) {
uc.BaseTestPluginController.ListTestPlugins(c)
}
// GetTestPluginStatus retrieves the status and available options for a test plugin.
//
// @Summary Get test plugin status (admin)
// @Schemes
// @Description Retrieves the status and available configuration options for a specific test plugin.
// @Tags plugins
// @Accept json
// @Produce json
// @Param pname path string true "Plugin name"
// @Success 200 {object} happydns.PluginStatus "Plugin status with available options"
// @Failure 404 {object} happydns.ErrorResponse "Plugin not found"
// @Router /plugins/tests/{pname} [get]
func (uc *TestPluginController) GetTestPluginStatus(c *gin.Context) {
uc.BaseTestPluginController.GetTestPluginStatus(c)
}
// GetTestPluginOptions retrieves all admin-level options for a test plugin.
//
// @Summary Get test plugin options (admin)