Openstatus www.openstatus.dev

chore: rss feed button with pw (#1562)

authored by

Maximilian Kaske and committed by
GitHub
4cde653a 1c66a82e

+44 -46
+6 -2
apps/status-page/src/components/status-page/status-updates.tsx
··· 99 99 <CopyInputButton 100 100 className="w-full" 101 101 id="rss" 102 - value={`${baseUrl}/feed/rss`} 102 + value={`${baseUrl}/feed/rss${ 103 + page?.passwordProtected ? `?pw=${page?.password}` : "" 104 + }`} 103 105 /> 104 106 </div> 105 107 <Separator /> ··· 108 110 <CopyInputButton 109 111 className="w-full" 110 112 id="atom" 111 - value={`${baseUrl}/feed/atom`} 113 + value={`${baseUrl}/feed/atom${ 114 + page?.passwordProtected ? `?pw=${page?.password}` : "" 115 + }`} 112 116 /> 113 117 </div> 114 118 </TabsContent>
+38 -44
packages/db/src/schema/shared.ts
··· 114 114 ) 115 115 .default([]); 116 116 117 - export const selectPublicPageSchemaWithRelation = selectPageSchema 118 - .extend({ 119 - monitorGroups: selectMonitorGroupSchema.array().default([]), 120 - // TODO: include status of the monitor 121 - monitors: selectPublicMonitorWithStatusSchema.array(), 122 - trackers: trackersSchema, 123 - lastEvents: z.array( 124 - z.object({ 125 - id: z.number(), 126 - name: z.string(), 127 - from: z.date(), 128 - to: z.date().nullable(), 129 - status: z 130 - .enum(["success", "degraded", "error", "info"]) 131 - .default("success"), 132 - type: z.enum(["maintenance", "incident", "report"]), 133 - }), 134 - ), 135 - openEvents: z.array( 136 - z.object({ 137 - id: z.number(), 138 - name: z.string(), 139 - from: z.date(), 140 - to: z.date().nullable(), 141 - status: z 142 - .enum(["success", "degraded", "error", "info"]) 143 - .default("success"), 144 - type: z.enum(["maintenance", "incident", "report"]), 145 - }), 146 - ), 147 - statusReports: z.array(selectStatusReportPageSchema), 148 - incidents: z.array(selectIncidentSchema), 149 - maintenances: z.array(selectMaintenancePageSchema), 150 - status: z.enum(["success", "degraded", "error", "info"]).default("success"), 151 - workspacePlan: workspacePlanSchema 152 - .nullable() 153 - .default("free") 154 - .transform((val) => val ?? "free"), 155 - }) 156 - .omit({ 157 - // workspaceId: true, 158 - // id: true, 159 - password: true, 160 - }); 117 + export const selectPublicPageSchemaWithRelation = selectPageSchema.extend({ 118 + monitorGroups: selectMonitorGroupSchema.array().default([]), 119 + // TODO: include status of the monitor 120 + monitors: selectPublicMonitorWithStatusSchema.array(), 121 + trackers: trackersSchema, 122 + lastEvents: z.array( 123 + z.object({ 124 + id: z.number(), 125 + name: z.string(), 126 + from: z.date(), 127 + to: z.date().nullable(), 128 + status: z 129 + .enum(["success", "degraded", "error", "info"]) 130 + .default("success"), 131 + type: z.enum(["maintenance", "incident", "report"]), 132 + }), 133 + ), 134 + openEvents: z.array( 135 + z.object({ 136 + id: z.number(), 137 + name: z.string(), 138 + from: z.date(), 139 + to: z.date().nullable(), 140 + status: z 141 + .enum(["success", "degraded", "error", "info"]) 142 + .default("success"), 143 + type: z.enum(["maintenance", "incident", "report"]), 144 + }), 145 + ), 146 + statusReports: z.array(selectStatusReportPageSchema), 147 + incidents: z.array(selectIncidentSchema), 148 + maintenances: z.array(selectMaintenancePageSchema), 149 + status: z.enum(["success", "degraded", "error", "info"]).default("success"), 150 + workspacePlan: workspacePlanSchema 151 + .nullable() 152 + .default("free") 153 + .transform((val) => val ?? "free"), 154 + }); 161 155 162 156 export const selectPublicStatusReportSchemaWithRelation = 163 157 selectStatusReportSchema.extend({