2525 <v-layout row wrap >
2626 <!-- Column A -->
2727 <v-col xs12 md6 offset-md3 >
28- <h3 class =" text-xs-left" >Stato </h3 >
29- <v-card >
30- <div class =" cardContent" >
31- <div v-for =" (value, key) in cb.status" :key =" key" >
32- <div v-if =" key != 'log'" >
33- {{ key }}: <code >{{ value }}</code >
34- </div >
35- </div >
36- <br >
37- </div >
38- </v-card >
39- <br >
40- <h3 class =" text-xs-left" > {{ $t('message.settings_actions') }} </h3 >
4128 <v-card >
29+ <v-card-title >
30+ {{ $t('message.settings_actions') }}
31+ </v-card-title >
32+ <v-card-text >
4233 <div class =" d-flex justify-space-around align-center" >
4334 <v-btn color =" info" @click =" dialog_shutdown=true" >
4435 <v-icon icon =" mdi-power" ></v-icon > {{ $t('message.settings_actions_halt') }}
4536 </v-btn >
4637 <v-btn color =" info" @click =" dialog_reboot=true" >
38+ <v-icon icon =" mdi-restart" ></v-icon > {{ $t('message.settings_actions_reboot') }}
39+ </v-btn >
40+ <v-btn color =" info" @click =" dialog_restart=true" >
4741 <v-icon icon =" mdi-restart" ></v-icon > {{ $t('message.settings_actions_restart') }}
4842 </v-btn >
4943 <v-btn color =" warning" @click =" dialog_restore=true" >
7367 </v-card-actions >
7468 </v-card >
7569 </v-dialog >
70+ <v-dialog v-model =" dialog_restart" width =" 500" >
71+ <v-card >
72+ <v-card-title class =" headline grey lighten-2" primary-title >
73+ <h3 >CoderBot - {{ $t('message.settings_actions_restart_title') }}</h3 >
74+ </v-card-title >
75+ <v-card-text >
76+ {{ $t('message.settings_actions_restart_text_1') }}
77+ </v-card-text >
78+ <v-divider ></v-divider >
79+ <v-card-actions >
80+ <v-spacer ></v-spacer >
81+ <v-btn color =" primary" @click =" dialog_restart=false" >
82+ {{ $t('message.cancel') }}
83+ </v-btn >
84+ <v-btn color =" error" @click =" reboot" >
85+ <b >{{ $t('message.settings_actions_restart') }}</b >
86+ </v-btn >
87+ </v-card-actions >
88+ </v-card >
89+ </v-dialog >
7690 <v-dialog v-model =" dialog_reboot" width =" 500" >
7791 <v-card >
7892 <v-card-title class =" headline grey lighten-2" primary-title >
134148 </v-card >
135149 </v-dialog >
136150 </div >
151+ </v-card-text >
137152 </v-card >
138153 <br >
139154 <v-card >
140155 <v-card-title >
141- < h3 class = " text-xs-left " > {{ $t('message.settings_admin_password_title') }}</ h3 >
156+ {{ $t('message.settings_admin_password_title') }}
142157 </v-card-title >
143- < div class = " cardContent " >
158+ < v-card-text >
144159 <v-text-field v-model =" settings.adminPassword"
145160 v-bind:label =" $t('message.settings_admin_password')"
146161 @input =" v$.settings.motorMode.$touch"
147162 />
163+ </v-card-text >
164+ </v-card >
165+ <v-card >
166+ <v-card-title >
167+ {{ $t('message.settings_general_info') }}
168+ </v-card-title >
169+ <div class =" cardContent" >
170+ <v-expansion-panels >
171+ <v-expansion-panel
172+ :title =" $t('message.settings_status')"
173+ >
174+ <v-expansion-panel-text >
175+ <div v-for =" (value, key) in cb.status" :key =" key" >
176+ <div v-if =" key != 'log'" >
177+ {{ key }}: <code >{{ value }}</code >
178+ </div >
179+ </div >
180+ </v-expansion-panel-text >
181+ </v-expansion-panel >
182+ <v-expansion-panel
183+ :title =" $t('message.settings_info')"
184+ >
185+ <v-expansion-panel-text >
186+ <div v-for =" (value, key) in cb.info" :key =" key" >
187+ <div v-if =" key != 'log'" >
188+ {{ key }}: <code >{{ value }}</code >
189+ </div >
190+ </div >
191+ </v-expansion-panel-text >
192+ </v-expansion-panel >
193+ </v-expansion-panels >
148194 </div >
149195 </v-card >
150196 </v-col >
@@ -790,19 +836,14 @@ export default {
790836 mounted () {
791837 this .pollWifiStatus ()
792838 setInterval (() => { this .pollWifiStatus (); }, 1000 );
793- this .getInfoAndStatus ();
794- this .prepopulate ();
795- this .settings .packagesInstalled = this .$store .getters .musicPackages ;
796- this .settings .cnnModels = this .$store .getters .cnnModels ;
797- this .cb .info = this .$store .getters .info ;
798- this .cb .status = this .$store .getters .status ;
799- this .adminPassword_dialog = this .settings .adminPassword != null && this .settings .adminPassword != ' ' ;
839+ setTimeout (() => {this .prepopulate ()}, 1000 );
800840 this .$wifi_connect .networks ().then ((result ) => {
801841 this .networks = result .data .ssids ;
802842 });
803843 this .$coderbot .listPrograms ()
804844 .then ((response ) => {
805- this .programList = response .data ;
845+ this .programList = [{name: " " , code: " " , dom_code: " " , default: false }];
846+ this .programList = this .programList .concat (response .data );
806847 });
807848 },
808849 beforeRouteLeave (to , from , next ) {
@@ -936,10 +977,6 @@ export default {
936977 this .snackbar = true ;
937978 });
938979 },
939- getInfoAndStatus () {
940- // Get bot info and status
941- return this .$coderbot .getInfoAndStatus ();
942- },
943980 deletePkg (pkgNameID ) {
944981 this .$coderbot .deleteMusicPackage (pkgNameID).then (() => {
945982 console .log (' Pacchetto rimosso' );
@@ -949,6 +986,9 @@ export default {
949986 },
950987 prepopulate () {
951988 this .settings = this .$store .getters .settings ;
989+ this .cb .status = this .$store .getters .status ;
990+ this .cb .info = this .$store .getters .info ;
991+ this .adminPassword_dialog = this .settings .adminPassword != null && this .settings .adminPassword != ' ' ;
952992 },
953993 save () {
954994 if (this .v$ .$invalid ) {
@@ -972,7 +1012,6 @@ export default {
9721012 this .v$ .settings .$reset ();
9731013 console .log (' set dirty false' );
9741014 });
975- console .log (" wifi dirty state: " , this .v$ .settings .wifiMode .$dirty || this .v$ .settings .wifiSSID .$dirty || this .v$ .settings .wifiPsw .$dirty );
9761015 if (this .v$ .settings .wifiMode .$dirty || this .v$ .settings .wifiSSID .$dirty || this .v$ .settings .wifiPsw .$dirty ) {
9771016 if (this .settings .wifiMode == " client" ) {
9781017 const network = this .networks .find (item => { return item .ssid == this .settings .wifiSSID });
@@ -1048,6 +1087,7 @@ export default {
10481087 files: null ,
10491088 dialog_shutdown: false ,
10501089 dialog_reboot: false ,
1090+ dialog_restart: false ,
10511091 dialog_restore: false ,
10521092 dialog_reset: false ,
10531093 lastCommit: ' N/A' ,
@@ -1100,11 +1140,11 @@ export default {
11001140 startupProgram: null ,
11011141 progLevel: null ,
11021142 adminPassword: null ,
1143+ packagesInstalled: [],
11031144 },
11041145 cb: {
1105- logs: {
1106- log: []
1107- }
1146+ info: {},
1147+ status: {},
11081148 },
11091149 drawer: null ,
11101150 tab: null ,
0 commit comments