@@ -51,10 +51,10 @@ import Generic from "./Generic.vue";
5151
5252export default {
5353 name: " Unifi" ,
54- mixins: [service],
5554 components: {
5655 Generic,
5756 },
57+ mixins: [service],
5858 props: {
5959 item: Object ,
6060 },
@@ -108,15 +108,17 @@ export default {
108108 // Parse auth field in format "username:password"
109109 const [username , password ] = this .item .auth .split (" :" );
110110 if (! username || ! password) {
111- throw new Error (" Authentication format should be 'username:password'" );
111+ throw new Error (
112+ " Authentication format should be 'username:password'" ,
113+ );
112114 }
113115
114116 const credentials = {
115117 username: username,
116118 password: password,
117119 };
118120
119- const response = await this .fetch (this .loginEndpoint , {
121+ await this .fetch (this .loginEndpoint , {
120122 method: " POST" ,
121123 headers: {
122124 " Content-Type" : " application/json" ,
@@ -141,7 +143,9 @@ export default {
141143 }
142144
143145 // Fetch devices data only
144- const devicesData = await this .fetch (` ${ this .prefix } /api/s/${ this .site } /stat/device` );
146+ const devicesData = await this .fetch (
147+ ` ${ this .prefix } /api/s/${ this .site } /stat/device` ,
148+ );
145149
146150 // Count access points (devices with type 'uap')
147151 this .accessPoints =
@@ -153,9 +157,10 @@ export default {
153157
154158 // For clients, we can use the total connected clients from devices that report client counts
155159 // or set to null if we don't have this data from devices endpoint
156- this .clients = devicesData .data ? .reduce ((total , device ) => {
157- return total + (device .num_sta || 0 );
158- }, 0 ) || null ;
160+ this .clients =
161+ devicesData .data ? .reduce ((total , device ) => {
162+ return total + (device .num_sta || 0 );
163+ }, 0 ) || null ;
159164
160165 this .serverError = false ;
161166 } catch (e) {
@@ -201,4 +206,4 @@ export default {
201206 border- radius: 7px ;
202207 }
203208}
204- < / style>
209+ < / style>
0 commit comments