@@ -371,6 +371,13 @@ func CreateAllCustomColumnsOverrides() []*dashboardv1alpha1.CustomColumnsOverrid
371371 createCustomColumnWithJsonPath ("Name" , ".metadata.name" , "TenantNamespace" , "" , "/openapi-ui/{2}/{reqsJsonPath[0]['.metadata.name']['-']}/factory/marketplace" ),
372372 createTimestampColumn ("Created" , ".metadata.creationTimestamp" ),
373373 }),
374+
375+ // Stock namespace backups cozystack io v1alpha1 plans
376+ createCustomColumnsOverride ("stock-namespace-/backups.cozystack.io/v1alpha1/plans" , []any {
377+ createCustomColumnWithJsonPath ("Name" , ".metadata.name" , "Plan" , "" , "/openapi-ui/{2}/{reqsJsonPath[0]['.metadata.namespace']['-']}/factory/plan-details/{reqsJsonPath[0]['.metadata.name']['-']}" ),
378+ createApplicationRefColumn ("Application" ),
379+ createTimestampColumn ("Created" , ".metadata.creationTimestamp" ),
380+ }),
374381 }
375382}
376383
@@ -1433,6 +1440,122 @@ func CreateAllFactories() []*dashboardv1alpha1.Factory {
14331440 }
14341441 workloadmonitorSpec := createFactorySpec ("workloadmonitor-details" , []any {"workloadmonitor-sidebar" }, []any {"/api/clusters/{2}/k8s/apis/cozystack.io/v1alpha1/namespaces/{3}/workloadmonitors/{6}" }, workloadmonitorHeader , workloadmonitorTabs )
14351442
1443+ // Plan details factory using unified approach
1444+ planConfig := UnifiedResourceConfig {
1445+ Name : "plan-details" ,
1446+ ResourceType : "factory" ,
1447+ Kind : "Plan" ,
1448+ Plural : "plans" ,
1449+ Title : "plan" ,
1450+ }
1451+ planTabs := []any {
1452+ map [string ]any {
1453+ "key" : "details" ,
1454+ "label" : "Details" ,
1455+ "children" : []any {
1456+ contentCard ("details-card" , map [string ]any {
1457+ "marginBottom" : "24px" ,
1458+ }, []any {
1459+ antdText ("details-title" , true , "Plan details" , map [string ]any {
1460+ "fontSize" : 20 ,
1461+ "marginBottom" : "12px" ,
1462+ }),
1463+ spacer ("details-spacer" , 16 ),
1464+ antdRow ("details-grid" , []any {48 , 12 }, []any {
1465+ antdCol ("col-left" , 12 , []any {
1466+ antdFlexVertical ("col-left-stack" , 24 , []any {
1467+ antdFlexVertical ("meta-name-block" , 4 , []any {
1468+ antdText ("meta-name-label" , true , "Name" , nil ),
1469+ parsedText ("meta-name-value" , "{reqsJsonPath[0]['.metadata.name']['-']}" , nil ),
1470+ }),
1471+ antdFlexVertical ("meta-namespace-block" , 8 , []any {
1472+ antdText ("meta-namespace-label" , true , "Namespace" , nil ),
1473+ antdFlex ("header-row" , 6 , []any {
1474+ map [string ]any {
1475+ "type" : "antdText" ,
1476+ "data" : map [string ]any {
1477+ "id" : "header-badge" ,
1478+ "text" : "NS" ,
1479+ "title" : "namespace" ,
1480+ "style" : map [string ]any {
1481+ "backgroundColor" : "#a25792ff" ,
1482+ "borderRadius" : "20px" ,
1483+ "color" : "#fff" ,
1484+ "display" : "inline-block" ,
1485+ "fontFamily" : "RedHatDisplay, Overpass, overpass, helvetica, arial, sans-serif" ,
1486+ "fontSize" : "15px" ,
1487+ "fontWeight" : 400 ,
1488+ "lineHeight" : "24px" ,
1489+ "minWidth" : 24 ,
1490+ "padding" : "0 9px" ,
1491+ "textAlign" : "center" ,
1492+ "whiteSpace" : "nowrap" ,
1493+ },
1494+ },
1495+ },
1496+ map [string ]any {
1497+ "type" : "antdLink" ,
1498+ "data" : map [string ]any {
1499+ "id" : "namespace-link" ,
1500+ "text" : "{reqsJsonPath[0]['.metadata.namespace']['-']}" ,
1501+ "href" : "/openapi-ui/{2}/{reqsJsonPath[0]['.metadata.namespace']['-']}/factory/marketplace" ,
1502+ },
1503+ },
1504+ }),
1505+ }),
1506+ antdFlexVertical ("meta-created-block" , 4 , []any {
1507+ antdText ("time-label" , true , "Created" , nil ),
1508+ antdFlex ("time-block" , 6 , []any {
1509+ map [string ]any {
1510+ "type" : "antdText" ,
1511+ "data" : map [string ]any {
1512+ "id" : "time-icon" ,
1513+ "text" : "🌐" ,
1514+ },
1515+ },
1516+ map [string ]any {
1517+ "type" : "parsedText" ,
1518+ "data" : map [string ]any {
1519+ "formatter" : "timestamp" ,
1520+ "id" : "time-value" ,
1521+ "text" : "{reqsJsonPath[0]['.metadata.creationTimestamp']['-']}" ,
1522+ },
1523+ },
1524+ }),
1525+ }),
1526+ }),
1527+ }),
1528+ antdCol ("col-right" , 12 , []any {
1529+ antdFlexVertical ("col-right-stack" , 24 , []any {
1530+ antdFlexVertical ("spec-application-ref-block" , 4 , []any {
1531+ antdText ("application-ref-label" , true , "Application" , nil ),
1532+ parsedText ("application-ref-value" , "{reqsJsonPath[0]['.spec.applicationRef.kind']['-']}.{reqsJsonPath[0]['.spec.applicationRef.apiGroup']['-']}/{reqsJsonPath[0]['.spec.applicationRef.name']['-']}" , nil ),
1533+ }),
1534+ antdFlexVertical ("spec-storage-ref-block" , 4 , []any {
1535+ antdText ("storage-ref-label" , true , "Storage" , nil ),
1536+ parsedText ("storage-ref-value" , "{reqsJsonPath[0]['.spec.storageRef.kind']['-']}.{reqsJsonPath[0]['.spec.storageRef.apiGroup']['-']}/{reqsJsonPath[0]['.spec.storageRef.name']['-']}" , nil ),
1537+ }),
1538+ antdFlexVertical ("spec-strategy-ref-block" , 4 , []any {
1539+ antdText ("strategy-ref-label" , true , "Strategy" , nil ),
1540+ parsedText ("strategy-ref-value" , "{reqsJsonPath[0]['.spec.strategyRef.kind']['-']}.{reqsJsonPath[0]['.spec.strategyRef.apiGroup']['-']}/{reqsJsonPath[0]['.spec.strategyRef.name']['-']}" , nil ),
1541+ }),
1542+ antdFlexVertical ("spec-schedule-type-block" , 4 , []any {
1543+ antdText ("schedule-type-label" , true , "Schedule Type" , nil ),
1544+ parsedText ("schedule-type-value" , "{reqsJsonPath[0]['.spec.schedule.type']['-']}" , nil ),
1545+ }),
1546+ antdFlexVertical ("spec-schedule-cron-block" , 4 , []any {
1547+ antdText ("schedule-cron-label" , true , "Schedule Cron" , nil ),
1548+ parsedText ("schedule-cron-value" , "{reqsJsonPath[0]['.spec.schedule.cron']['-']}" , nil ),
1549+ }),
1550+ }),
1551+ }),
1552+ }),
1553+ }),
1554+ },
1555+ },
1556+ }
1557+ planSpec := createUnifiedFactory (planConfig , planTabs , []any {"/api/clusters/{2}/k8s/apis/backups.cozystack.io/v1alpha1/namespaces/{3}/plans/{6}" })
1558+
14361559 return []* dashboardv1alpha1.Factory {
14371560 createFactory ("marketplace" , marketplaceSpec ),
14381561 createFactory ("namespace-details" , namespaceSpec ),
@@ -1442,6 +1565,7 @@ func CreateAllFactories() []*dashboardv1alpha1.Factory {
14421565 createFactory ("kube-service-details" , serviceSpec ),
14431566 createFactory ("kube-ingress-details" , ingressSpec ),
14441567 createFactory ("workloadmonitor-details" , workloadmonitorSpec ),
1568+ createFactory ("plan-details" , planSpec ),
14451569 }
14461570}
14471571
0 commit comments