diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 000000000000..a82e737ec844 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,44 @@ +# Git +.git +.gitignore + +# Docker +Dockerfile +docker-compose.yml +.dockerignore + +# Dependencies +node_modules +vendor/ +.bundle + +# Build outputs +dist/ +_site/ +.sass-cache/ +.jekyll-cache/ +.jekyll-metadata + +# Logs +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# OS generated files +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# IDE +.vscode/ +.idea/ +*.swp +*.swo + +# Temporary files +*.tmp +*.temp diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000000..d38fcebc62b9 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,44 @@ +# Use Ruby 3.3.5 as base image +FROM ruby:3.3.5-slim + +# Install system dependencies +RUN apt-get update && apt-get install -y \ + build-essential \ + curl \ + git \ + && rm -rf /var/lib/apt/lists/* + +# Install Node.js 22.10.0 +RUN curl -fsSL https://deb.nodesource.com/setup_22.x | bash - \ + && apt-get install -y nodejs + +# Verify versions +RUN ruby --version && node --version && npm --version + +# Set working directory +WORKDIR /app + +# Copy dependency files first for better caching +COPY Gemfile Gemfile.lock ./ +COPY package.json package-lock.json* ./ + +# Install bundler and Ruby gems +RUN gem install bundler +RUN bundle config set --local path 'vendor/bundle' +RUN bundle install + +# Install Node.js packages +RUN npm install + +# Copy the rest of the application +COPY . . + +# Set up Jekyll source directory +ENV JEKYLL_ENV=development +ENV BUNDLE_PATH=vendor/bundle + +# Expose port 4000 for Jekyll +EXPOSE 4000 + +# Default command - can be overridden in docker-compose +CMD ["npm", "run", "watch"] diff --git a/Gemfile.lock b/Gemfile.lock index c78265925574..c6d32d669bbd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -3,43 +3,20 @@ GEM specs: addressable (2.8.7) public_suffix (>= 2.0.2, < 7.0) - bigdecimal (3.1.8) colorator (1.1.0) concurrent-ruby (1.3.4) em-websocket (0.5.3) eventmachine (>= 0.12.9) http_parser.rb (~> 0) eventmachine (1.2.7) - ffi (1.17.0) - ffi (1.17.0-aarch64-linux-gnu) - ffi (1.17.0-aarch64-linux-musl) - ffi (1.17.0-arm-linux-gnu) - ffi (1.17.0-arm-linux-musl) - ffi (1.17.0-arm64-darwin) - ffi (1.17.0-x86-linux-gnu) - ffi (1.17.0-x86-linux-musl) - ffi (1.17.0-x86_64-darwin) - ffi (1.17.0-x86_64-linux-gnu) - ffi (1.17.0-x86_64-linux-musl) + ffi (1.17.2) forwardable-extended (2.6.0) - google-protobuf (4.28.3) - bigdecimal - rake (>= 13) - google-protobuf (4.28.3-aarch64-linux) - bigdecimal - rake (>= 13) - google-protobuf (4.28.3-arm64-darwin) - bigdecimal - rake (>= 13) - google-protobuf (4.28.3-x86-linux) - bigdecimal - rake (>= 13) - google-protobuf (4.28.3-x86_64-darwin) - bigdecimal - rake (>= 13) - google-protobuf (4.28.3-x86_64-linux) - bigdecimal - rake (>= 13) + google-protobuf (3.25.8) + google-protobuf (3.25.8-aarch64-linux) + google-protobuf (3.25.8-arm64-darwin) + google-protobuf (3.25.8-x86-linux) + google-protobuf (3.25.8-x86_64-darwin) + google-protobuf (3.25.8-x86_64-linux) http_parser.rb (0.8.0) i18n (1.14.6) concurrent-ruby (~> 1.0) @@ -82,82 +59,40 @@ GEM rexml (3.3.9) rouge (4.5.1) safe_yaml (1.0.5) - sass-embedded (1.80.6) - google-protobuf (~> 4.28) - rake (>= 13) - sass-embedded (1.80.6-aarch64-linux-android) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-aarch64-linux-gnu) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-aarch64-linux-musl) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-aarch64-mingw-ucrt) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-arm-linux-androideabi) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-arm-linux-gnueabihf) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-arm-linux-musleabihf) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-arm64-darwin) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-riscv64-linux-android) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-riscv64-linux-gnu) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-riscv64-linux-musl) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86-cygwin) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86-linux-android) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86-linux-gnu) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86-linux-musl) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86-mingw-ucrt) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86_64-cygwin) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86_64-darwin) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86_64-linux-android) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86_64-linux-gnu) - google-protobuf (~> 4.28) - sass-embedded (1.80.6-x86_64-linux-musl) - google-protobuf (~> 4.28) + sass-embedded (1.69.5) + google-protobuf (~> 3.23) + rake (>= 13.0.0) terminal-table (3.0.2) unicode-display_width (>= 1.1.1, < 3) unicode-display_width (2.6.0) webrick (1.9.0) PLATFORMS + aarch64-linux aarch64-linux aarch64-linux-android - aarch64-linux-gnu aarch64-linux-musl aarch64-mingw-ucrt + arm-linux + arm-linux arm-linux-androideabi - arm-linux-gnu - arm-linux-gnueabihf arm-linux-musl arm-linux-musleabihf arm64-darwin + riscv64-linux riscv64-linux-android - riscv64-linux-gnu riscv64-linux-musl ruby x86-cygwin x86-linux + x86-linux x86-linux-android - x86-linux-gnu x86-linux-musl x86-mingw-ucrt x86_64-cygwin x86_64-darwin + x86_64-linux x86_64-linux-android - x86_64-linux-gnu x86_64-linux-musl DEPENDENCIES diff --git a/README.md b/README.md index cc2ff41e9a35..cb6bce982a92 100644 --- a/README.md +++ b/README.md @@ -19,6 +19,23 @@ The site was recently overhauled. Here you can find documentation on how to add ## Running Locally +### Using Docker + +A [`Dockerfile`](./Dockerfile) and [`docker-compose.yml`](./docker-compose.yml) are provided to build and view the website locally using a containerised environment. To build the docker container use + +```sh +docker compose build +``` + +And then run the container with: + +```sh +docker compose up +``` + +The site is viewable at [`http://localhost:4000/`](http://localhost:4000/). + + ### Tools - (`asdf` for runtime version management) diff --git a/content/_includes/head.html b/content/_includes/head.html index 69b813faba63..5376f1ff1fb1 100644 --- a/content/_includes/head.html +++ b/content/_includes/head.html @@ -17,12 +17,12 @@ {% endif %} - - - + + + {% include external/mathjax.html -%} {% include external/font.html %} - + {% if page.react and (site.pages | where: "name" page.name) %} {%- assign react_source = page.name | append: ".js" -%} {% elsif (site.collections | where: "label" page.collection) %} @@ -30,5 +30,5 @@ {% else %} {%- assign react_source = "default.js" -%} {% endif %} - + diff --git a/content/_includes/post-list.html b/content/_includes/post-list.html index 2970d9999a3e..2e6edcf252b5 100644 --- a/content/_includes/post-list.html +++ b/content/_includes/post-list.html @@ -7,7 +7,7 @@ {%- assign date_format = constants.date_format | default: "%b %-d, %Y" -%} {{ post.date | date: date_format }}
diff --git a/content/pages/search.md b/content/pages/search.md index d0bb72ad623a..2d2691ec91c6 100644 --- a/content/pages/search.md +++ b/content/pages/search.md @@ -4,5 +4,5 @@ title: Search Results react: true --- - + {%- include react/root.html id='site-search' -%} diff --git a/content/properties.css.liquid b/content/properties.css.liquid index 6ca655ab6011..dcfa13b0d293 100644 --- a/content/properties.css.liquid +++ b/content/properties.css.liquid @@ -4,6 +4,6 @@ permalink: properties.css @layer components { :root { - --fiqci-banner-image: url({{ '/assets/images/FiQCI-banner.jpg' | absolute_url }}); + --fiqci-banner-image: url({{ '/assets/images/FiQCI-banner.jpg' | relative_url }}); } } diff --git a/content/site.js.liquid b/content/site.js.liquid index 8b718f7ee81e..61128ec35eaf 100644 --- a/content/site.js.liquid +++ b/content/site.js.liquid @@ -8,9 +8,9 @@ permalink: site.js "key": "{{ forloop.index }}", "type": "{{ publication.filters.Type | default: 'Post' }}", "title": "{{ publication.title }}", - "url": "{{ publication.url | absolute_url }}", + "url": "{{ publication.url | relative_url }}", "date": "{{ publication.date | date: '%-d.%-m.%Y' }}", - "teaser": "{{ publication.header.teaser | absolute_url }}", + "teaser": "{{ publication.header.teaser | relative_url }}", "filters": { {%- for category in publication.filters %} "{{ category[0] }}": "{{ category[1] }}" diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 000000000000..2fad6248dfba --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,18 @@ +services: + fiqci-dev: + build: . + ports: + - "4000:4000" + - "35729:35729" + volumes: + # Mount source code but exclude dependencies + - .:/app + - /app/node_modules # prevent host's node_modules from overriding container's node_modules + - /app/vendor # prevent host's vendor directory from overriding container's Ruby gems + environment: + - BUNDLE_PATH=vendor/bundle + - NODE_ENV=development + - JEKYLL_ENV=development + - JEKYLL_HOST=0.0.0.0 + command: npm run watch + working_dir: /app diff --git a/package-lock.json b/package-lock.json index 6b3600e31b78..6fde4a206299 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,13 +8,15 @@ "dependencies": { "@cscfi/csc-ui": "^2.3.0", "@cscfi/csc-ui-react": "^2.3.0", + "date-fns": "^4.1.0", "dompurify": "^3.2.4", - "framer-motion": "^12.23.9", + "framer-motion": "^12.23.22", "front-matter": "^4.0.2", "gray-matter": "^4.0.3", "katex": "^0.16.21", "lunr": "^2.3.9", - "prismjs": "^1.30.0" + "prismjs": "^1.30.0", + "react-calendar": "^6.0.0" }, "devDependencies": { "@babel/core": "^7.26.0", @@ -2263,6 +2265,15 @@ } } }, + "node_modules/@wojtekmaj/date-utils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@wojtekmaj/date-utils/-/date-utils-2.0.2.tgz", + "integrity": "sha512-Do66mSlSNifFFuo3l9gNKfRMSFi26CRuQMsDJuuKO/ekrDWuTTtE4ZQxoFCUOG+NgxnpSeBq/k5TY8ZseEzLpA==", + "license": "MIT", + "funding": { + "url": "https://github.com/wojtekmaj/date-utils?sponsor=1" + } + }, "node_modules/@xtuc/ieee754": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz", @@ -2909,6 +2920,15 @@ "node": ">=6" } }, + "node_modules/clsx": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/clsx/-/clsx-2.1.1.tgz", + "integrity": "sha512-eYm0QWBtUrBWZWG0d386OGAw16Z995PiOVo2B7bjWSbHedGl5e0ZWaq65kOGgUSNesEIDkB9ISbTg/JK9dhCZA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/code-block-writer": { "version": "13.0.3", "resolved": "https://registry.npmjs.org/code-block-writer/-/code-block-writer-13.0.3.tgz", @@ -3114,6 +3134,16 @@ "license": "MIT", "peer": true }, + "node_modules/date-fns": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.1.0.tgz", + "integrity": "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/kossnocorp" + } + }, "node_modules/debug": { "version": "4.3.7", "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", @@ -3643,12 +3673,12 @@ } }, "node_modules/framer-motion": { - "version": "12.23.9", - "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.23.9.tgz", - "integrity": "sha512-TqEHXj8LWfQSKqfdr5Y4mYltYLw96deu6/K9kGDd+ysqRJPNwF9nb5mZcrLmybHbU7gcJ+HQar41U3UTGanbbQ==", + "version": "12.23.22", + "resolved": "https://registry.npmjs.org/framer-motion/-/framer-motion-12.23.22.tgz", + "integrity": "sha512-ZgGvdxXCw55ZYvhoZChTlG6pUuehecgvEAJz0BHoC5pQKW1EC5xf1Mul1ej5+ai+pVY0pylyFfdl45qnM1/GsA==", "license": "MIT", "dependencies": { - "motion-dom": "^12.23.9", + "motion-dom": "^12.23.21", "motion-utils": "^12.23.6", "tslib": "^2.4.0" }, @@ -3730,6 +3760,18 @@ "node": "6.* || 8.* || >= 10.*" } }, + "node_modules/get-user-locale": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-user-locale/-/get-user-locale-3.0.0.tgz", + "integrity": "sha512-iJfHSmdYV39UUBw7Jq6GJzeJxUr4U+S03qdhVuDsR9gCEnfbqLy9gYDJFBJQL1riqolFUKQvx36mEkp2iGgJ3g==", + "license": "MIT", + "dependencies": { + "memoize": "^10.0.0" + }, + "funding": { + "url": "https://github.com/wojtekmaj/get-user-locale?sponsor=1" + } + }, "node_modules/glob": { "version": "10.4.5", "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", @@ -4316,6 +4358,21 @@ "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", "license": "MIT" }, + "node_modules/memoize": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/memoize/-/memoize-10.1.0.tgz", + "integrity": "sha512-MMbFhJzh4Jlg/poq1si90XRlTZRDHVqdlz2mPyGJ6kqMpyHUyVpDd5gpFAvVehW64+RA1eKE9Yt8aSLY7w2Kgg==", + "license": "MIT", + "dependencies": { + "mimic-function": "^5.0.1" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sindresorhus/memoize?sponsor=1" + } + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -4368,6 +4425,18 @@ "node": ">= 0.6" } }, + "node_modules/mimic-function": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/mimic-function/-/mimic-function-5.0.1.tgz", + "integrity": "sha512-VP79XUPxV2CigYP3jWwAUFSku2aKqBH7uTAapFWCBqutsbmDo96KY5o8uh6U+/YSIn5OxJnXp73beVkpqMIGhA==", + "license": "MIT", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/minimatch": { "version": "9.0.5", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", @@ -4409,9 +4478,9 @@ } }, "node_modules/motion-dom": { - "version": "12.23.9", - "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.23.9.tgz", - "integrity": "sha512-6Sv++iWS8XMFCgU1qwKj9l4xuC47Hp4+2jvPfyTXkqDg2tTzSgX6nWKD4kNFXk0k7llO59LZTPuJigza4A2K1A==", + "version": "12.23.21", + "resolved": "https://registry.npmjs.org/motion-dom/-/motion-dom-12.23.21.tgz", + "integrity": "sha512-5xDXx/AbhrfgsQmSE7YESMn4Dpo6x5/DTZ4Iyy4xqDvVHWvFVoV+V2Ri2S/ksx+D40wrZ7gPYiMWshkdoqNgNQ==", "license": "MIT", "dependencies": { "motion-utils": "^12.23.6" @@ -5068,6 +5137,31 @@ "node": ">=0.10.0" } }, + "node_modules/react-calendar": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/react-calendar/-/react-calendar-6.0.0.tgz", + "integrity": "sha512-6wqaki3Us0DNDjZDr0DYIzhSFprNoy4FdPT9Pjy5aD2hJJVjtJwmdMT9VmrTUo949nlk35BOxehThxX62RkuRQ==", + "license": "MIT", + "dependencies": { + "@wojtekmaj/date-utils": "^2.0.2", + "clsx": "^2.0.0", + "get-user-locale": "^3.0.0", + "warning": "^4.0.0" + }, + "funding": { + "url": "https://github.com/wojtekmaj/react-calendar?sponsor=1" + }, + "peerDependencies": { + "@types/react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + } + } + }, "node_modules/react-dom": { "version": "18.3.1", "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-18.3.1.tgz", @@ -6028,6 +6122,15 @@ "uuid": "dist/bin/uuid" } }, + "node_modules/warning": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/warning/-/warning-4.0.3.tgz", + "integrity": "sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==", + "license": "MIT", + "dependencies": { + "loose-envify": "^1.0.0" + } + }, "node_modules/watchpack": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.2.tgz", diff --git a/package.json b/package.json index 4be2da2c4b69..7a67b0a48431 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "tailwindcss": "npx tailwindcss --input=${npm_package_config_tailwindcss_inputDir}/main.css --output=${npm_package_config_webpack_outputDir}/main.css", "webpack": "npx webpack", "jekyll": "bundle exec jekyll", - "jekyll:serve": "npm run-script jekyll -- serve --config ${npm_package_config_jekyll_configFilename},${npm_package_config_jekyll_webpackConfigFilename}", + "jekyll:serve": "npm run-script jekyll -- serve --config ${npm_package_config_jekyll_configFilename},${npm_package_config_jekyll_webpackConfigFilename} --livereload --host ${JEKYLL_HOST:-127.0.0.1}", "jekyll:build": "npm run-script jekyll -- build --config ${npm_package_config_jekyll_configFilename},${npm_package_config_jekyll_webpackConfigFilename}", "clean": "npm run-script jekyll -- clean --config ${npm_package_config_jekyll_configFilename},${npm_package_config_jekyll_webpackConfigFilename} && rm ${npm_package_config_jekyll_webpackConfigFilename}", "watch": "npx concurrently --kill-others --prefix-colors ${npm_package_config_conc_colors} --passthrough-arguments 'npm:tailwindcss -- {1}' 'npm:webpack -- --mode=development {1}' 'npm:jekyll:serve -- --livereload' -- --watch", @@ -52,13 +52,15 @@ "dependencies": { "@cscfi/csc-ui": "^2.3.0", "@cscfi/csc-ui-react": "^2.3.0", + "date-fns": "^4.1.0", "dompurify": "^3.2.4", - "framer-motion": "^12.23.9", + "framer-motion": "^12.23.22", "front-matter": "^4.0.2", "gray-matter": "^4.0.3", "katex": "^0.16.21", "lunr": "^2.3.9", - "prismjs": "^1.30.0" + "prismjs": "^1.30.0", + "react-calendar": "^6.0.0" }, "private": "true" } diff --git a/src/components/Blogs.jsx b/src/components/Blogs.jsx index 5a3ce3b2e6fd..dbf4d4192b45 100644 --- a/src/components/Blogs.jsx +++ b/src/components/Blogs.jsx @@ -82,8 +82,8 @@ const FilterTheme = ({ selectedTheme, handleChangeTheme }) => ( value={selectedTheme} items={[ { name: 'HPC+QC+AI', value: 'HPC+QC+AI' }, - { name: 'Programming', value: 'programming' }, - { name: 'Algorithm', value: 'algorithm' }, + { name: 'Programming', value: 'Programming' }, + { name: 'Algorithm', value: 'Algorithm' }, { name: 'Technical', value: 'Technical' }, ]} placeholder='Choose a theme' diff --git a/src/components/Events.jsx b/src/components/Events.jsx index ea558304243b..af4d261c5c4c 100644 --- a/src/components/Events.jsx +++ b/src/components/Events.jsx @@ -77,9 +77,9 @@ const FilterTheme = ({ selectedTheme, handleChangeTheme }) => ( value={selectedTheme} items={[ { name: 'HPC+QC+AI', value: 'HPC+QC+AI' }, - { name: 'Programming', value: 'programming' }, - { name: 'Webinar/Lecture', value: 'webinar/lecture' }, - { name: 'Course/Workshop', value: 'course/workshop' }, + { name: 'Programming', value: 'Programming' }, + { name: 'Webinar/Lecture', value: 'Webinar/Lecture' }, + { name: 'Course/Workshop', value: 'Course/Workshop' }, ]} placeholder='Choose a theme' onChangeValue={handleChangeTheme} diff --git a/src/components/ServiceStatus.jsx b/src/components/ServiceStatus.jsx index da3270d16b4d..d21af3be8158 100644 --- a/src/components/ServiceStatus.jsx +++ b/src/components/ServiceStatus.jsx @@ -1,9 +1,11 @@ import React, { useState } from 'react' import { useStatus } from '../hooks/useStatus' +import { useBookings } from '../hooks/useBookings.jsx'; import { mdiInformation, mdiClose, mdiAlert } from '@mdi/js'; -import { CCard, CCardTitle, CCardContent, CIcon } from '@cscfi/csc-ui-react'; +import { CCard, CCardTitle, CCardContent, CIcon, CButton } from '@cscfi/csc-ui-react'; import { StatusModal } from './StatusModal/StatusModal'; +import { BookingModal } from './bookingCalendar.jsx'; const StatusCard = (props) => { const isOnline = props.health; @@ -39,6 +41,7 @@ const StatusCard = (props) => { export const ServiceStatus = (props) => { const { status: statusList } = useStatus("https://fiqci-backend.2.rahtiapp.fi/devices/healthcheck"); + const { bookingData: bookingData } = useBookings("https://fiqci-backend.2.rahtiapp.fi/bookings") const qcs = props["quantum-computers"] || []; const devicesWithStatus = (qcs.length === 0 || !Array.isArray(statusList)) @@ -51,7 +54,8 @@ export const ServiceStatus = (props) => { }; }); - const [modalOpen, setModalOpen] = useState(false); + const [bookingModalOpen, setBookingModalOpen] = useState(false) + const [modalOpen, setModalOpen] = useState(false); const [modalProps, setModalProps] = useState({}); const handleCardClick = (qc) => { setModalProps({ ...qc, devicesWithStatus }); @@ -87,11 +91,27 @@ export const ServiceStatus = (props) => { {props.alert?.type ? props.alert?.text : 'Loading...'} -+ VTT devices can at times be reserved. At these times the queue will be paused. + Reservations can be viewed from this calendar. Note that making reservations through FiQCI is not currently possible. +
+Partially Reserved
+Selected Day
+Today
+Booked
+