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
  • Loading branch information
SteveMicroNova committed Oct 14, 2024
1 parent e39500b commit 8d8e23d
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions web/src/pages/Settings/Config/ConfigPanels/LMSMode.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,30 @@ export default function LMSMode() {
setLoading(false);
};

function LMSModeDescription() {
if(lmsMode){
return (
<>
Toggles LMS Mode on or off. LMS is useful for piggy-backing off integrations AmpliPi does not have natively. This will wipe out the current config! As a result, it downloads the current config before proceeding with LMS mode.
<br />
To reach the LMS Control Panel, follow <a target="_blank" className="link" href={`http://${window.location.hostname}:9000`}>this link</a>
</>
)
} else {
return(
<>
Toggles LMS Mode on or off. LMS is useful for piggy-backing off integrations AmpliPi does not have natively. This will wipe out the current config! As a result, it downloads the current config before proceeding with LMS mode.
</>
)
}
}

function LMSModal(){
if(lmsMode){
return(
<ConfigModal
body={"This will reset AmpliPi to factory settings, you will have to either manually reconfigure it or reupload the config that was downloaded when LMS mode was initially toggled."}
onApply={() => {ConfigDownload(); LMSModeHandler();}}
onApply={() => {LMSModeHandler();}}
open={modalOpen}
setOpen={setModalOpen}
/>
Expand All @@ -47,7 +65,7 @@ export default function LMSMode() {
<>
<ConfigPanel
title={"Lyrion Media Server (LMS) Mode"}
subheader={"Toggles LMS Mode on or off. LMS is useful for piggy-backing off integrations AmpliPi does not have natively. This will wipe out the current config! As a result, it downloads the current config before proceeding with LMS mode."}
subheader={<LMSModeDescription />}
loading={loading}
>
<Switch
Expand Down

0 comments on commit 8d8e23d

Please sign in to comment.