Compare commits
1 Commits
main
...
renovate/c
Author | SHA1 | Date | |
---|---|---|---|
75986160f8 |
36
package.json
36
package.json
@ -10,29 +10,29 @@
|
||||
"dev": "webpack serve"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@babel/core": "^7.24.7",
|
||||
"@babel/plugin-transform-runtime": "^7.24.7",
|
||||
"@babel/preset-env": "^7.24.7",
|
||||
"@babel/core": "^7.23.2",
|
||||
"@babel/plugin-transform-runtime": "^7.23.2",
|
||||
"@babel/preset-env": "^7.23.2",
|
||||
"babel-loader": "^9.1.3",
|
||||
"css-loader": "^7.1.2",
|
||||
"style-loader": "^4.0.0",
|
||||
"ts-loader": "^9.5.1",
|
||||
"typescript": "^5.4.5",
|
||||
"webpack": "^5.91.0",
|
||||
"css-loader": "^6.8.1",
|
||||
"style-loader": "^3.3.3",
|
||||
"ts-loader": "^9.5.0",
|
||||
"typescript": "^5.2.2",
|
||||
"webpack": "^5.89.0",
|
||||
"webpack-cli": "^5.1.4",
|
||||
"webpack-dev-server": "^5.0.4"
|
||||
"webpack-dev-server": "^4.15.1"
|
||||
},
|
||||
"dependencies": {
|
||||
"@babel/runtime": "^7.24.7",
|
||||
"@fullcalendar/core": "^6.1.14",
|
||||
"@fullcalendar/icalendar": "^6.1.14",
|
||||
"@fullcalendar/resource": "^6.1.14",
|
||||
"@fullcalendar/resource-timegrid": "^6.1.14",
|
||||
"@fullcalendar/resource-timeline": "^6.1.14",
|
||||
"@fullcalendar/timegrid": "^6.1.14",
|
||||
"core-js": "^3.37.1",
|
||||
"@babel/runtime": "^7.23.2",
|
||||
"@fullcalendar/core": "^6.1.9",
|
||||
"@fullcalendar/icalendar": "^6.1.9",
|
||||
"@fullcalendar/resource": "^6.1.9",
|
||||
"@fullcalendar/resource-timegrid": "^6.1.9",
|
||||
"@fullcalendar/resource-timeline": "^6.1.9",
|
||||
"@fullcalendar/timegrid": "^6.1.9",
|
||||
"core-js": "^3.33.2",
|
||||
"ical.js": "^1.5.0",
|
||||
"preact": "^10.22.0",
|
||||
"preact": "^10.18.2",
|
||||
"unique-colors": "^1.0.1"
|
||||
}
|
||||
}
|
||||
|
6233
pnpm-lock.yaml
6233
pnpm-lock.yaml
File diff suppressed because it is too large
Load Diff
6
renovate.json
Normal file
6
renovate.json
Normal file
@ -0,0 +1,6 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": [
|
||||
"config:recommended"
|
||||
]
|
||||
}
|
@ -2,8 +2,8 @@
|
||||
"type": "module",
|
||||
"exports": "./server.js",
|
||||
"dependencies": {
|
||||
"express": "^4.19.2",
|
||||
"puppeteer": "^22.10.0"
|
||||
"express": "^4.18.2",
|
||||
"puppeteer": "^21.5.0"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "npm run dev",
|
||||
@ -12,9 +12,9 @@
|
||||
"serve": "node dist/server.js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/express": "^4.17.21",
|
||||
"@types/node": "^20.14.2",
|
||||
"tsx": "^4.15.1",
|
||||
"typescript": "^5.4.5"
|
||||
"@types/express": "^4.17.20",
|
||||
"@types/node": "^20.8.10",
|
||||
"tsx": "^3.14.0",
|
||||
"typescript": "^5.2.2"
|
||||
}
|
||||
}
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,7 @@ import puppeteer from 'puppeteer';
|
||||
const PORT = process.env.PORT || 1234;
|
||||
|
||||
const app = express();
|
||||
const puppet_browser = await puppeteer.launch({ headless: 'shell' });
|
||||
const puppet_browser = await puppeteer.launch();
|
||||
|
||||
app.get('/ipad.png', async (req, res) => {
|
||||
const puppet_page = await puppet_browser.newPage();
|
||||
|
@ -3,14 +3,59 @@ import iCalendarPlugin from '@fullcalendar/icalendar';
|
||||
import resourceTimeGridPlugin from '@fullcalendar/resource-timegrid';
|
||||
|
||||
import { unique_colors } from 'unique-colors';
|
||||
import _ALL_SHOPS from './shops.json';
|
||||
export const ALL_SHOPS: { [key: string]: Shop } = _ALL_SHOPS;
|
||||
|
||||
interface Shop {
|
||||
calendar?: string;
|
||||
children?: string[];
|
||||
}
|
||||
|
||||
const shops: { [key: string]: Shop } = {
|
||||
Cafe: {
|
||||
calendar: 'ofbkp5ctd1hr7917sknlj9s15g@group.calendar.google.com',
|
||||
},
|
||||
'Conference Room': {}, // same calendar as mezzanine
|
||||
'Classroom / Computer Lab': {
|
||||
calendar: '6mmjp85e4732ru6skf1dda54ls@group.calendar.google.com',
|
||||
children: ['Printer, Canon iPF8400S 44" 8-Color/Pigment'],
|
||||
},
|
||||
'Digital Fabrication and Electronics Lab': {
|
||||
calendar: '1g8atbdschshrg2inf162rcqt4@group.calendar.google.com',
|
||||
children: [
|
||||
'3d printer, Lulzbot Taz 6',
|
||||
'3d printer, Lulzbot Mini',
|
||||
'Laser Cutter, GLS Hybrid',
|
||||
],
|
||||
},
|
||||
'Fiber Arts Studio': {
|
||||
calendar: '7gbndciog37ge0hd8ug33ml70k@group.calendar.google.com',
|
||||
children: ['Mid Arm, Brother DQLT15'],
|
||||
},
|
||||
'Jewelry Studio': {
|
||||
calendar: 'l0dl2jq3vhbi9f4lfmaf5negc0@group.calendar.google.com',
|
||||
},
|
||||
'Metal Shop': {
|
||||
calendar: 'a4p97kiiafatqdr52c3a0cpre0@group.calendar.google.com',
|
||||
children: [
|
||||
'Plasma Cutter, Hypertherm Powermax85',
|
||||
'MIG Welder, Miller 210',
|
||||
],
|
||||
},
|
||||
Mezzanine: {
|
||||
calendar: 'f4ro53uklj2u6pr0se7ucskm6g@group.calendar.google.com',
|
||||
},
|
||||
'Wood Shop': {
|
||||
calendar: '4unv3ia1n9mc9u31n2n5lv8nd8@group.calendar.google.com',
|
||||
children: [
|
||||
'ShopBot, PRSstandard 96-48-8',
|
||||
'Table Saw, SawStop 3HP 10"',
|
||||
'Planer, Powermatic 20"',
|
||||
'Jointer, Powermatic 8"',
|
||||
],
|
||||
},
|
||||
};
|
||||
|
||||
const colors: string[] = unique_colors(Object.keys(shops).length);
|
||||
|
||||
export const common_calendarOptions: CalendarOptions = {
|
||||
schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
|
||||
plugins: [iCalendarPlugin, resourceTimeGridPlugin],
|
||||
@ -37,15 +82,7 @@ export const common_calendarOptions: CalendarOptions = {
|
||||
minute: '2-digit',
|
||||
hour12: false,
|
||||
},
|
||||
};
|
||||
|
||||
export function main(
|
||||
calendarOptions: CalendarOptions,
|
||||
showNewTools: boolean = false,
|
||||
shops: { [key: string]: Shop } = ALL_SHOPS
|
||||
) {
|
||||
const calendarEl = document.getElementById('calendar');
|
||||
calendarOptions.resources = Object.entries(shops).map(([shop_name, shop]) => {
|
||||
resources: Object.entries(shops).map(([shop_name, shop]) => {
|
||||
return {
|
||||
id: shop_name,
|
||||
title: shop_name,
|
||||
@ -59,15 +96,19 @@ export function main(
|
||||
};
|
||||
}),
|
||||
};
|
||||
});
|
||||
const calendar = new Calendar(calendarEl!, calendarOptions);
|
||||
}),
|
||||
};
|
||||
|
||||
const colors: string[] = unique_colors(Object.keys(shops).length);
|
||||
export function main(
|
||||
calendarOptions: CalendarOptions,
|
||||
allTools: boolean = false
|
||||
) {
|
||||
const calendarEl = document.getElementById('calendar');
|
||||
const calendar = new Calendar(calendarEl!, calendarOptions);
|
||||
Object.entries(shops)
|
||||
.filter(([shop_name, shop]) => shop.calendar !== undefined)
|
||||
.forEach(([shop_name, shop], idx) => {
|
||||
calendar.addEventSource({
|
||||
id: shop_name,
|
||||
url: '/calendar/ical/' + shop.calendar + '/public/basic.ics',
|
||||
format: 'ics',
|
||||
color: colors[idx],
|
||||
@ -84,7 +125,7 @@ export function main(
|
||||
// assume any event not for a specific tool is for the shop as a whole
|
||||
eventData.resourceId = shop_name;
|
||||
}
|
||||
if (showNewTools) {
|
||||
if (allTools) {
|
||||
if (!calendar.getResourceById(eventData.resourceId)) {
|
||||
calendar.addResource(
|
||||
{ id: eventData.resourceId, title: eventData.resourceId },
|
||||
@ -92,22 +133,6 @@ export function main(
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Add background event if resource has children
|
||||
let tool_resource = calendar.getResourceById(eventData.resourceId);
|
||||
let children = tool_resource?.getChildren();
|
||||
if (tool_resource && children?.length) {
|
||||
let new_event = {
|
||||
...eventData,
|
||||
resourceIds: [
|
||||
tool_resource.id,
|
||||
...children.map((resource) => resource.id),
|
||||
],
|
||||
display: 'background',
|
||||
};
|
||||
calendar.addEvent(new_event, shop_name);
|
||||
}
|
||||
|
||||
return eventData;
|
||||
},
|
||||
});
|
||||
|
@ -1,48 +0,0 @@
|
||||
{
|
||||
"Cafe": {
|
||||
"calendar": "ofbkp5ctd1hr7917sknlj9s15g@group.calendar.google.com"
|
||||
},
|
||||
"Conference Room": {},
|
||||
"Classroom / Computer Lab": {
|
||||
"calendar": "6mmjp85e4732ru6skf1dda54ls@group.calendar.google.com",
|
||||
"children": ["Printer, Canon iPF8400S 44\" 8-Color/Pigment"]
|
||||
},
|
||||
"Digital Fabrication and Electronics Lab": {
|
||||
"calendar": "1g8atbdschshrg2inf162rcqt4@group.calendar.google.com",
|
||||
"children": [
|
||||
"3d printer, Lulzbot Taz 6",
|
||||
"3d printer, Lulzbot Mini",
|
||||
"Laser Cutter, GLS Hybrid"
|
||||
]
|
||||
},
|
||||
"Fiber Arts Studio": {
|
||||
"calendar": "7gbndciog37ge0hd8ug33ml70k@group.calendar.google.com",
|
||||
"children": ["Mid Arm, Brother DQLT15"]
|
||||
},
|
||||
"Jewelry Studio": {
|
||||
"calendar": "l0dl2jq3vhbi9f4lfmaf5negc0@group.calendar.google.com"
|
||||
},
|
||||
"Metal Shop": {
|
||||
"calendar": "a4p97kiiafatqdr52c3a0cpre0@group.calendar.google.com",
|
||||
"children": [
|
||||
"Plasma Cutter, Hypertherm Powermax85",
|
||||
"MIG Welder, Miller 210"
|
||||
]
|
||||
},
|
||||
"Mezzanine": {
|
||||
"calendar": "f4ro53uklj2u6pr0se7ucskm6g@group.calendar.google.com"
|
||||
},
|
||||
"Wood Shop": {
|
||||
"calendar": "4unv3ia1n9mc9u31n2n5lv8nd8@group.calendar.google.com",
|
||||
"children": [
|
||||
"ShopBot, PRSstandard 96-48-8",
|
||||
"Table Saw, SawStop 3HP 10\"",
|
||||
"Planer, Powermatic 20\"",
|
||||
"Jointer, Powermatic 8\"",
|
||||
"Rikon 70-305 Wood Lathe",
|
||||
"Rikon 70-100 Mini Wood Lathe",
|
||||
"Record CL3 Wood Lathe",
|
||||
"Powermatic 45 Wood Lathe"
|
||||
]
|
||||
}
|
||||
}
|
@ -1,6 +1,6 @@
|
||||
import type { CalendarOptions } from '@fullcalendar/core';
|
||||
|
||||
import { ALL_SHOPS, common_calendarOptions, main } from './common';
|
||||
import { common_calendarOptions, main } from './common';
|
||||
|
||||
import './wall-display.html';
|
||||
import './modal.css';
|
||||
@ -61,19 +61,7 @@ const calendarOptions: CalendarOptions = {
|
||||
},
|
||||
};
|
||||
|
||||
const calendar = main(
|
||||
calendarOptions,
|
||||
!toolFilter,
|
||||
toolFilter
|
||||
? Object.fromEntries(
|
||||
Object.entries(ALL_SHOPS).filter(
|
||||
([shop_name, shop]) =>
|
||||
toolFilter.includes(shop_name) ||
|
||||
shop.children?.some((t) => toolFilter.includes(t))
|
||||
)
|
||||
)
|
||||
: ALL_SHOPS
|
||||
);
|
||||
const calendar = main(calendarOptions, !toolFilter);
|
||||
|
||||
function refresh() {
|
||||
calendar.refetchEvents();
|
||||
|
@ -37,17 +37,15 @@ module.exports = [
|
||||
},
|
||||
devServer: {
|
||||
allowedHosts: 'all',
|
||||
proxy: [
|
||||
{
|
||||
context: ['/calendar'],
|
||||
proxy: {
|
||||
'/calendar': {
|
||||
target: 'https://calendar.google.com',
|
||||
changeOrigin: true,
|
||||
},
|
||||
{
|
||||
context: ['/ipad.png'],
|
||||
'/ipad.png': {
|
||||
target: 'http://localhost:1234',
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
module: {
|
||||
rules: [
|
||||
|
Loading…
Reference in New Issue
Block a user