Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'content-entity' into ping-feature
- Loading branch information
Showing
14 changed files
with
277 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import React, { useState } from 'react'; | ||
import TabContent from './tab-content'; | ||
import './overview-modal.css'; | ||
import './tabs.css'; | ||
|
||
const Overview = ({ closeOverviewModal }) => { | ||
const [activeTab, setActiveTab] = useState("1"); | ||
const [activeTabMethod, setActiveTabMethod] = useState("http-check"); | ||
|
||
const tabClick = (e) => { | ||
setActiveTab(e.target.dataset.tabIndex); | ||
setActiveTabMethod(e.target.dataset.callbackMethod); | ||
// Set classes. | ||
document.querySelector('.tab-item.active').classList.remove('active'); | ||
e.target.classList.add('active'); | ||
}; | ||
|
||
return ( | ||
<div className="overview-wrapper"> | ||
<div className="header"> | ||
<h2>Site Overview</h2> | ||
<button className="site-tile-btn tertiary" onClick={() => closeOverviewModal()}>Close</button> | ||
</div> | ||
<div className="tabs"> | ||
<ul> | ||
<li | ||
onClick={(e) => tabClick(e)} | ||
data-tab-index="1" | ||
data-callback-method="http-check" | ||
className="tab-item active" | ||
> | ||
Availability | ||
</li> | ||
<li | ||
onClick={(e) => tabClick(e)} | ||
data-tab-index="2" | ||
data-callback-method="status-check" | ||
className="tab-item" | ||
> | ||
Status Report | ||
</li> | ||
<li | ||
onClick={(e) => tabClick(e)} | ||
data-tab-index="3" | ||
data-callback-method="logs-check" | ||
className="tab-item" | ||
> | ||
Recent Logs | ||
</li> | ||
<li | ||
onClick={(e) => tabClick(e)} | ||
data-tab-index="4" | ||
data-callback-method="stats-check" | ||
className="tab-item" | ||
> | ||
Content Statistics | ||
</li> | ||
<li | ||
onClick={(e) => tabClick(e)} | ||
data-tab-index="5" | ||
data-callback-method="update-check" | ||
className="tab-item" | ||
> | ||
Update Information | ||
</li> | ||
</ul> | ||
</div> | ||
<div className="tab-content"> | ||
<TabContent | ||
activeTab={activeTab} | ||
activeTabMethod={activeTabMethod} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default Overview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.site-dash-modal-content.overview-modal-content { | ||
width: 600px | ||
} | ||
|
||
.site-dash-modal-content.overview-modal-content .header { | ||
display: flex; | ||
justify-content: space-between; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import React from 'react'; | ||
|
||
const TabContent = ({ activeTab, activeTabMethod }) => { | ||
// @todo: We call the respective API here to get the details. | ||
const response = `Content from ${activeTabMethod} API, active tab ${activeTab}`; | ||
|
||
return ( | ||
<div> | ||
{response} | ||
</div> | ||
); | ||
}; | ||
|
||
export default TabContent; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.tabs > ul { | ||
display: flex; | ||
flex-wrap: wrap; | ||
list-style: none; | ||
padding: 0 0 20px 0; | ||
margin: 0 0 20px 0; | ||
gap: 4px; | ||
border-bottom: 1px solid #6200EE; | ||
} | ||
|
||
li.tab-item { | ||
padding: 10px; | ||
background: rgba(204, 204, 204, 0.28); | ||
border-radius: 4px; | ||
cursor: pointer; | ||
} | ||
|
||
li.tab-item.active { | ||
background: #6200EE; | ||
color: white; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
name: Site Dashboard | ||
description: A single dashboard allowing you to view/manage multiple sites. | ||
package: Site Dashboard | ||
|
||
type: module | ||
core_version_requirement: ^8.8 || ^9 | ||
|
||
configure: sitedash.dashboard |
Oops, something went wrong.