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
-
Open the Excel file in SharePoint: TRU Fuel saver Business Case Calculator
-
Click File → Share → Embed
-
Click Generate HTML
-
Copy the
srcURL from the generated iframe code (it will look like):https://flexpowerltd.sharepoint.com/sites/flexiblepowersystems/_layouts/15/Doc.aspx?sourcedoc={DOCUMENT_ID}&action=embedview -
Replace the
EXCEL_URLconstant in both calculator files:src/pages/tools/new-site-calculator.astrosrc/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 installationsReplacement 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:
- Create a new
.astrofile in this directory - Import and use
ToolLayoutandExcelEmbedcomponents - Specify the appropriate sheet name
- 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>