Skip to content
This repository was archived by the owner on Apr 8, 2025. It is now read-only.

Commit ca5a574

Browse files
committed
Updated documentation and release.js
1 parent 48f08d7 commit ca5a574

File tree

16 files changed

+737
-260
lines changed

16 files changed

+737
-260
lines changed

client/src/views/dash/CastSandbox/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function Sandbox() {
4949
setDevices(response.data.devices);
5050
setLoading(false);
5151
} catch (e) {
52-
message.error(e.message)
52+
message.error(e.response.data.error)
5353
}
5454
}
5555

client/src/views/dash/Configuration/GoogleDevices/index.js

Lines changed: 0 additions & 58 deletions
This file was deleted.

client/src/views/dash/Configuration/Users/index.js

Lines changed: 0 additions & 58 deletions
This file was deleted.

client/src/views/dash/Configuration/index.js

Lines changed: 35 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ import {Input, InputNumber, Switch, message, TimePicker, Button, Icon, Select} f
44
import {post} from '~/helpers/api';
55
import * as Styles from './styles';
66
import LoadingAnimation from "~/components/LoadingAnimation";
7-
import GoogleDevices from "./GoogleDevices";
8-
import Users from "./Users";
97
import moment from 'moment';
108
import Text from "antd/es/typography/Text";
119

@@ -20,6 +18,8 @@ function Configuration({history}){
2018
const [quietHours, setQuietHours] = useState();
2119
const [loading, setLoading] = useState(true);
2220
const [devices, setDevices] = useState([]);
21+
const [casting, setCasting] = useState();
22+
const [defaultCast, setDefaultCast] = useState();
2323
const [forceReboot, setForceReboot] = useState(false);
2424

2525
useEffect(() => {
@@ -33,14 +33,28 @@ function Configuration({history}){
3333
port,
3434
quietHours,
3535
devices,
36-
"conversation.lang": language
36+
"conversation.lang": language,
37+
castEnabled: casting
3738
};
3839
await post(obj, 'updateConfig');
39-
if(forceReboot) {
40-
message.success("Assistant Relay restarting");
41-
await post({}, 'restart');
42-
message.success(`Restart Successful - Visit http://${window.location.hostname}:${port} to continue`)
40+
if(casting && !defaultCast) {
41+
message.info("Please Wait - Installing Cast Dependencies");
42+
await post({}, 'installCast');
43+
message.success("Casting Enabled");
44+
return rebootServer();
4345
}
46+
if(forceReboot) rebootServer();
47+
} catch (e) {
48+
console.log(e.response);
49+
message.error(e.response.data.message);
50+
}
51+
}
52+
53+
async function rebootServer() {
54+
try {
55+
message.success("Assistant Relay restarting");
56+
await post({}, 'restart');
57+
message.success(`Restart Successful - Visit http://${window.location.hostname}:${port} to continue`)
4458
} catch (e) {
4559
message.error(e.message);
4660
}
@@ -54,6 +68,8 @@ function Configuration({history}){
5468
setQuietHours(data.quietHours);
5569
setDevices(data.devices);
5670
setLanguage(data.language);
71+
setCasting(data.castEnabled);
72+
setDefaultCast(data.castEnabled);
5773
setInitGet(false);
5874
setLoading(false);
5975
} catch (e) {
@@ -96,8 +112,6 @@ function Configuration({history}){
96112
return null;
97113
}
98114

99-
100-
101115
return (
102116
<Styles.Container>
103117
<Styles.Form>
@@ -106,10 +120,7 @@ function Configuration({history}){
106120
<Switch checkedChildren="On"
107121
unCheckedChildren="Off"
108122
defaultChecked={startupSound}
109-
onChange={(e) => {
110-
console.log(e)
111-
setStartupSound(e)
112-
} } />
123+
onChange={(e) => {setStartupSound(e)} } />
113124
</Styles.Switch>
114125

115126
<Text>Port Number:</Text>
@@ -147,14 +158,20 @@ function Configuration({history}){
147158
<Option value="pt-BR">Portuguese (Brazil)</Option>
148159
</Select>
149160

161+
<Text>Casting Enabled:</Text>
162+
<Styles.Switch>
163+
<Switch checkedChildren="On"
164+
unCheckedChildren="Off"
165+
checked={casting}
166+
onChange={(e) => {
167+
setCasting(e);
168+
setForceReboot(true);
169+
}} />
170+
</Styles.Switch>
171+
150172
<div></div>
151173
<Button type="primary" onClick={() => updateConfig()}>Save</Button>
152174

153-
{/*<Text>Users:</Text>*/}
154-
{/*<Users />*/}
155-
156-
{/*<Text>Google Devices:</Text>*/}
157-
{/*<GoogleDevices devices={devices} setDevices={(e) => setDevices(e)}/>*/}
158175
</Styles.Form>
159176
</Styles.Container>)
160177
}

docs/788d3f90.4e19ab3f.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)