Skip to content

Commit

Permalink
Change LMS Mode switch to only download on activation (not deactivati…
Browse files Browse the repository at this point in the history
…on) and add a link to the local LMS server when LMS Mode is active

Replace text link with button

Re-add config download on LMSMode deactivation

Correct LMS Mode link button styling to be in line with other config page buttons
  • Loading branch information
SteveMicroNova committed Oct 23, 2024
1 parent 79bb74b commit ab5b6d8
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
6 changes: 6 additions & 0 deletions web/src/pages/Settings/Config/Config.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,9 @@
color: general.$text-color;
font-size: 0.75rem;
}

.config-spacing{
@media (min-width: 768px) {
margin-left: 30px !important;
}
}
12 changes: 12 additions & 0 deletions web/src/pages/Settings/Config/ConfigPanels/LMSMode.jsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import "../Config.scss";
import Button from "@mui/material/Button/Button";
import ConfigPanel from './ConfigTemplates/ConfigPanel.jsx';
import { useStatusStore } from "@/App.jsx";
import Switch from '@mui/material/Switch/Switch';
Expand All @@ -20,6 +21,16 @@ export default function LMSMode() {
setLoading(false);
};

function LMSControlLink() {
if(lmsMode){
return (
<Button target="_blank" href={`http://${window.location.hostname}:9000`} className="config-spacing">
LMS Control Panel
</Button>
)
}
}

function LMSModal(){
if(lmsMode){
return(
Expand Down Expand Up @@ -55,6 +66,7 @@ export default function LMSMode() {
onClick={() => {setModalOpen(true);}}
inputProps={{ "aria-label": "controlled" }}
/>
<LMSControlLink/>
</ConfigPanel>

<LMSModal />
Expand Down

0 comments on commit ab5b6d8

Please sign in to comment.