Tools Directory

This directory contains utility pages and calculators that are not listed in the main navigation.

Pages

1. New Site Calculator

URL: /tools/new-site-calculator
Sheet: “New site”
Description: Calculate the business case for TRU Fuel savers at a new site installation.

2. Replacement Plugs Calculator

URL: /tools/replacement-plugs-calculator
Sheet: “Replacement plugs”
Description: Calculate the business case for replacing existing plugs with TRU Fuel savers.

Setup Instructions

Getting the SharePoint Embed URL

  1. Open the Excel file in SharePoint: TRU Fuel saver Business Case Calculator

  2. Click FileShareEmbed

  3. Click Generate HTML

  4. Copy the src URL from the generated iframe code (it will look like):

    https://flexpowerltd.sharepoint.com/sites/flexiblepowersystems/_layouts/15/Doc.aspx?sourcedoc={DOCUMENT_ID}&action=embedview
  5. Replace the EXCEL_URL constant in both calculator files:

    • src/pages/tools/new-site-calculator.astro
    • src/pages/tools/replacement-plugs-calculator.astro

Setting Permissions

Make sure the Excel file has appropriate sharing permissions:

  • For public access: Set to “Anyone with the link can view”
  • For internal only: Restrict to “People in Flexible Power Systems”

Sheet Names

The current sheet names are:

  • New site - for new installations
  • Replacement plugs - for retrofit scenarios

If the sheet names change in the Excel file, update the SHEET_NAME constant in each calculator page.

Layout

These pages use the ToolLayout which:

  • Includes the site header
  • Maximizes the iframe to fill the remaining viewport
  • Removes all padding/margins around the Excel embed
  • Provides a full-screen calculator experience

Adding New Tools

To add a new tool page:

  1. Create a new .astro file in this directory
  2. Import and use ToolLayout and ExcelEmbed components
  3. Specify the appropriate sheet name
  4. The page will automatically be accessible at /tools/your-file-name

Example:

---
import ToolLayout from '../../layouts/ToolLayout.astro';
import ExcelEmbed from '../../components/ExcelEmbed.astro';

const EXCEL_URL = 'your-sharepoint-url';
const SHEET_NAME = 'Your Sheet Name';
---

<ToolLayout 
  title="Your Tool Name"
  description="Tool description"
>
  <ExcelEmbed
    src={EXCEL_URL}
    sheet={SHEET_NAME}
    title="Your Tool Name"
    width="100%"
    height="100%"
  />
</ToolLayout>