File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -34,7 +34,13 @@ export default class ConsoleWidget extends Mixins(UtilsMixin) {
3434 @Prop ({ type: Boolean , default: false })
3535 readonly! : false
3636
37- consoleCommand = ' '
37+ get consoleCommand () {
38+ return this .$store .state .consoleCommand
39+ }
40+
41+ set consoleCommand (val : string ) {
42+ this .$store .commit (' setConsoleCommand' , val )
43+ }
3844
3945 sendCommand (command ? : string ) {
4046 if (command && command .length ) {
Original file line number Diff line number Diff line change @@ -12,15 +12,21 @@ Vue.use(Vuex)
1212
1313export default new Vuex . Store < RootState > ( {
1414 strict : ( process . env . NODE_ENV === 'development' ) ,
15- state : { } ,
15+ state : {
16+ consoleCommand : ''
17+ } ,
1618 modules : {
1719 config,
1820 socket,
1921 files,
2022 devicePower,
2123 version
2224 } ,
23- mutations : { } ,
25+ mutations : {
26+ setConsoleCommand ( state , payload ) {
27+ state . consoleCommand = payload
28+ }
29+ } ,
2430 actions : {
2531 async init ( { dispatch, commit } , payload : Config ) {
2632 // Should init the store, and ensure we've loaded our
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { SocketState } from './socket/types'
44import { VersionState } from './version/types'
55
66export interface RootState {
7+ consoleCommand : string ;
78 config ?: ConfigState ;
89 files ?: FilesState ;
910 socket ?: SocketState ;
You can’t perform that action at this time.
0 commit comments