feat: every dashboard has its own wallpaper
The wallpaper and how much it is darkened move from the user to the dashboard. Migration 0007 copies what each user had to all their dashboards. Settings open for the dashboard you came from (/settings?d=<id>): its wallpaper is shown, a switch reaches the others, and "Back to dashboard" returns to it.
This commit is contained in:
+9
-5
@@ -86,6 +86,10 @@ export const dashboard = pgTable(
|
||||
.notNull()
|
||||
.references(() => user.id, { onDelete: "cascade" }),
|
||||
name: text("name").notNull(),
|
||||
// null = bundled default wallpaper
|
||||
wallpaperUrl: text("wallpaper_url"),
|
||||
// percent of black over the wallpaper, see DEFAULT_WALLPAPER_DIM
|
||||
wallpaperDim: integer("wallpaper_dim").notNull().default(40),
|
||||
createdAt: timestamp("created_at").notNull().defaultNow(),
|
||||
},
|
||||
(t) => [index("dashboard_user_id_idx").on(t.userId)]
|
||||
@@ -151,10 +155,6 @@ export const settings = pgTable("settings", {
|
||||
})
|
||||
.notNull()
|
||||
.default("duckduckgo"),
|
||||
// null = bundled default wallpaper
|
||||
wallpaperUrl: text("wallpaper_url"),
|
||||
// percent of black over the wallpaper, see DEFAULT_WALLPAPER_DIM
|
||||
wallpaperDim: integer("wallpaper_dim").notNull().default(40),
|
||||
// the big clock, see src/lib/clock.ts
|
||||
clockFont: text("clock_font", {
|
||||
enum: ["serif", "sans", "light", "rounded", "slab"],
|
||||
@@ -181,9 +181,13 @@ export const icon = pgTable(
|
||||
(t) => [index("icon_user_id_idx").on(t.userId)]
|
||||
)
|
||||
|
||||
/** The wallpaper that was uploaded for a dashboard, served from /api/wallpaper. */
|
||||
export const wallpaper = pgTable("wallpaper", {
|
||||
userId: text("user_id")
|
||||
dashboardId: uuid("dashboard_id")
|
||||
.primaryKey()
|
||||
.references(() => dashboard.id, { onDelete: "cascade" }),
|
||||
userId: text("user_id")
|
||||
.notNull()
|
||||
.references(() => user.id, { onDelete: "cascade" }),
|
||||
mime: text("mime").notNull(),
|
||||
data: bytea("data").notNull(),
|
||||
|
||||
Reference in New Issue
Block a user