Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/add measuring monitoring tool links #331

Merged
merged 4 commits into from
May 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fabric-portal",
"version": "1.6.4",
"version": "1.6.5",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.32",
Expand Down
57 changes: 57 additions & 0 deletions src/components/Resource/ToolLinks.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import InfrastructureMetrics from '../../imgs/toolLinks/InfrastructureMetrics.png';
import PublicMetrics from '../../imgs/toolLinks/PublicMetrics.png';
import OpticalData from '../../imgs/toolLinks/OpticalData.png';
import Parser from 'html-react-parser';

const ToolLinks = ()=> {
const toolsData = [
{
"title": "Public Metrics",
"image": PublicMetrics,
"content": "This site contains basic metrics concerning FABRIC network. These metrics are available to anyone. Anyone is allowed anonymous access to Grafana.",
"link": "https://public-metrics.fabric-testbed.net/grafana/"
},
{
"title": "Infrastructure Metrics",
"image": InfrastructureMetrics,
"content": "This site contains enhanced metrics concerning FABRIC site usage and availability. These metrics are available to any FABRIC user. Logon is available as an anonymous Grafana user to anyone with a FABRIC account.",
"link": "https://infrastructure-metrics.fabric-testbed.net/grafana/"
},
{
"title": "Optical Data",
"image": OpticalData,
"content": "This is a space where ESnet shares public Grafana dashboards of targeted data sets. It complements the data found at the <a href='https://my.es.net/'target='_blank' rel='noreferrer'>my.es.net portal</a>. The data comes primarily from ESnet's Stardust system and provides a flexible way to show interesting views of the data.",
"link": "https://public.stardust.es.net/dashboards/f/fdhq1z6q5smwwb/?orgId=2"
}
]
return (
<div className="mt-3">
{
toolsData.map((tool, index) =>
<div className="tool-link-block px-3 mb-5">
<h3 className="text-primary">
{tool.title}
</h3>
<div className="row mt-3" key={`tool-link-${index}`}>
<div className="col-12 col-md-6">
<img src={tool.image} alt={`tool-link-${tool.title}`}/>
</div>
<div className="col-12 col-md-6 d-flex flex-column">
<p>{Parser(tool.content)}</p>
<a href={tool.link} target="_blank" rel="noreferrer">
<button
className="btn btn-sm btn-outline-primary mt-2"
>
<i className="fa fa-sign-in mr-2"></i> Open Tool
</button>
</a>
</div>
</div>
</div>
)
}
</div>
)
}

export default ToolLinks;
Binary file added src/imgs/toolLinks/InfrastructureMetrics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/imgs/toolLinks/OpticalData.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/imgs/toolLinks/PublicMetrics.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/pages/ProjectForm.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import checkGlobalRoles from "../utils/checkGlobalRoles";
import SpinnerFullPage from "../components/common/SpinnerFullPage";
import Slices from "../components/Experiment/Slices";
import moment from 'moment';
import utcToLocalTimeParser from "../utils/utcToLocalTimeParser.js";
import {
getProjectById,
getProjectTags,
Expand Down Expand Up @@ -665,7 +666,7 @@ class ProjectForm extends Form {
>
<div>
<i className="fa fa-exclamation-triangle mr-2"></i>
This project is going to expire in a month.
This project is going to expire in a month on {utcToLocalTimeParser(data.expired)}.
{
canUpdate ? <span>Please submit a ticket to renew the project.</span> :
<span>Please contact your project owner to request project renewal.</span>
Expand Down
85 changes: 47 additions & 38 deletions src/pages/Resources.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import DetailTable from "../components/Resource/DetailTable";
import Pagination from "../components/common/Pagination";
import SearchBox from "../components/common/SearchBox";
import SummaryTable from "../components/Resource/SummaryTable";
import ToolLinks from "../components/Resource/ToolLinks.jsx";
import withRouter from "../components/common/withRouter.jsx";
import Tabs from "../components/common/Tabs";
import { sitesNameMapping } from "../data/sites";
import sitesParser from "../services/parser/sitesParser";
import { getResources } from "../services/resourceService.js";
Expand Down Expand Up @@ -137,46 +139,53 @@ class Resources extends Component {
return (
<div className="container">
<h1>Resources</h1>
<div className="row my-2">
<TestbedTable sum={this.getResourcesSum(this.state.resources)} />
</div>
<div className="row my-2">
<div className="col-9">
<Topomap
onChange={this.handleActiveDetailChange}
siteColorMapping={this.state.siteColorMapping}
/>
<Tabs activeTab={"Testbed Resources"}>
<div label="Testbed Resources">
<div className="row my-2 px-3">
<TestbedTable sum={this.getResourcesSum(this.state.resources)} />
</div>
<div className="row my-2 px-3">
<div className="col-9">
<Topomap
onChange={this.handleActiveDetailChange}
siteColorMapping={this.state.siteColorMapping}
/>
</div>
<div className="col-3">
<DetailTable
name={activeDetailName}
resource={this.getResourceByName(this.state.resources, sitesNameMapping.shortNameToAcronym[activeDetailName])}
parent="resources"
/>
</div>
</div>
<div className="row my-2 px-3">
<div className="col-12">
<SearchBox
value={searchQuery}
placeholder={"Search Resources by Site Name..."}
onChange={this.handleSearch}
className="my-0"
/>
<p>Showing resource availability of <b>{totalCount}</b> sites.</p>
<SummaryTable
resources={data}
sortColumn={sortColumn}
onSort={this.handleSort}
/>
<Pagination
itemsCount={totalCount}
pageSize={pageSize}
currentPage={currentPage}
onPageChange={this.handlePageChange}
/>
</div>
</div>
</div>
<div className="col-3">
<DetailTable
name={activeDetailName}
resource={this.getResourceByName(this.state.resources, sitesNameMapping.shortNameToAcronym[activeDetailName])}
parent="resources"
/>
<div label="Measuring and Monitoring Tools">
<ToolLinks />
</div>
</div>
<div className="row my-2">
<div className="col-12">
<SearchBox
value={searchQuery}
placeholder={"Search Resources by Site Name..."}
onChange={this.handleSearch}
className="my-0"
/>
<p>Showing resource availability of <b>{totalCount}</b> sites.</p>
<SummaryTable
resources={data}
sortColumn={sortColumn}
onSort={this.handleSort}
/>
<Pagination
itemsCount={totalCount}
pageSize={pageSize}
currentPage={currentPage}
onPageChange={this.handlePageChange}
/>
</div>
</div>
</Tabs>
</div>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/services/portalData.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.6.4",
"version": "1.6.5",
"defaultFacility": "FABRIC",
"facilityOptions": ["FABRIC"],
"keyLimit": 10,
Expand Down
9 changes: 9 additions & 0 deletions src/styles/App.scss
Original file line number Diff line number Diff line change
Expand Up @@ -1165,4 +1165,13 @@ ul,

.resource-detail-table td {
padding: 0.5rem 0.75rem !important;
}

.tool-link-block img {
width: 100%;
border-radius: 2%;
}

.tool-link-block p {
line-height: 200%;
}
Loading