Changeset 2671 for lmd/trunk/fuentes/admin-center-ltsp.install
- Timestamp:
- Oct 25, 2016, 12:47:27 PM (4 years ago)
- Location:
- lmd/trunk/fuentes/admin-center-ltsp.install/lliurex-ltsp/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
lmd/trunk/fuentes/admin-center-ltsp.install/lliurex-ltsp/src/i18n/ca-ES@valencia/messages.json
r2670 r2671 72 72 "ltsp_client_default_boot":["Arrancada per defecte"], 73 73 "ltsp_client_default_boot_option":["Opció d'arrancada per defecte"], 74 "llx.ltspclientmanager.client.saved":["S'ha guardat la configuració del client"] 74 "llx.ltspclientmanager.client.saved":["S'ha guardat la configuració del client"], 75 "llx.ltspclientmanager.client.deleted":["S'ha esborrat la configuració per al client"], 76 "ltsp_client_boot_default":["Arrancada per omissió"] 75 77 76 78 -
lmd/trunk/fuentes/admin-center-ltsp.install/lliurex-ltsp/src/i18n/en-US/messages.json
r2670 r2671 72 72 "ltsp_client_default_boot":["Default boot"], 73 73 "ltsp_client_default_boot_option":["Default boot"], 74 "llx.ltspclientmanager.client.saved":["Client options has been saved"] 74 "llx.ltspclientmanager.client.saved":["Client options has been saved"], 75 "llx.ltspclientmanager.client.deleted":["Client configuration has been deleted"], 76 "ltsp_client_boot_default":["Default Booy"] 75 77 76 78 } -
lmd/trunk/fuentes/admin-center-ltsp.install/lliurex-ltsp/src/i18n/es-ES/messages.json
r2670 r2671 72 72 "ltsp_client_default_boot":["Arranque por defecto"], 73 73 "ltsp_client_default_boot_option":["Opción de arranque por defecto"], 74 "llx.ltspclientmanager.client.saved":["Las configuración del cliente se ha guardado"] 74 "llx.ltspclientmanager.client.saved":["Las configuración del cliente se ha guardado"], 75 "llx.ltspclientmanager.client.deleted":["Se borró la configuración para el cliente"], 76 "ltsp_client_boot_default":["Arranque por defecto"] 75 77 } 76 78 } -
lmd/trunk/fuentes/admin-center-ltsp.install/lliurex-ltsp/src/js/ClientManager.js
r2670 r2671 50 50 else type="unconfigured"; 51 51 52 var ret="<div class='ltsp-clienticonContainer col-md-6' id='ltsp_client_"+clientId+"' >";53 ret+="<i class='material-icons ltsp-clienticon noselect md-128 "+type+"' >computer</i>";52 var ret="<div class='ltsp-clienticonContainer col-md-6' id='ltsp_client_"+clientId+"' type='"+type+"'>"; 53 ret+="<i class='material-icons ltsp-clienticon noselect md-128 "+type+"' type='"+type+"'>computer</i>"; 54 54 ret+="<div class='ltsp-clienttext'>"+client.mac+"<br/>"+client.ip+"</div></div>"; 55 55 … … 78 78 79 79 if ($("#ltsp_client_"+clientId).length===0) { 80 console.log($(client)); 81 /*//if ($($(client).children()[0]).hasClass(".configured")) { 82 if ($(client).find("i").css("background","#00bfa5")) { 83 //alert("123"); 84 $("#ltsp-clients").prepend(client); 85 } 86 //else*/ 87 $("#ltsp-clients").append(client); 88 80 81 if ($(client).attr("type")=="configured") $("#ltsp-clients").prepend(client); 82 else $("#ltsp-clients").append(client); 89 83 } 90 84 91 85 if (($(".ltsp-clienticonContainer").length)===arplength) self.drawDisconnectedClients(); 92 86 93 }) 87 }); 94 88 95 89 } … … 121 115 122 116 if ($(clientId).length===0) { 123 var item="<div class='ltsp-clienticonContainer col-md-6' id='"+clientId+"' >";117 var item="<div class='ltsp-clienticonContainer col-md-6' id='"+clientId+"' type='configured'>"; 124 118 item+="<i class='material-icons ltsp-clienticon noselect md-128 disconnected'>computer</i>"; 125 119 item+="<div class='ltsp-clienttext'>"+self.macformatter(mac)+"<br/>Disconnected</div></div>"; … … 138 132 } 139 133 140 LTSPClientManager.prototype.showClientDialog=function showClientDialog(id){ 134 LTSPClientManager.prototype.deleteClientConfig=function showClientDialog(id){ 135 var self=this; 136 var client=id.replace("ltsp_client_",""); 137 138 var credentials=[sessionStorage.username , sessionStorage.password]; 139 var n4dclass="LmdClientManager"; 140 var n4dmethod="deleteClient"; 141 var arglist=[client]; 142 143 // establir la mac (id) en format mac i fer el setClientConfig igual... 144 145 146 Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function(response){ 147 self.regenerateLtsConf(function(){ 148 var mac=self.macformatter(client); 149 var credentials=[sessionStorage.username , sessionStorage.password]; 150 var n4dclass="LlxBootManager"; 151 var n4dmethod="setClientConfig"; 152 var arglist=[mac]; 153 154 Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function(response){ 155 // Remove client config for ui 156 $("#"+id).find("i").removeClass("configured"); 157 $("#"+id).find("i").addClass("unconfigured"); 158 $("#"+id).attr("type","unconfigured"); 159 $("#"+id).find("i").attr("type","unconfigured"); 160 161 if($("#"+id).find("i").hasClass("disconnected")) $("#"+id).remove(); 162 163 message=(self._("llx.ltspclientmanager.client.deleted")); 164 Utils.msg(message, MSG_SUCCESS); 165 },0); 166 167 }); 168 169 170 171 },0); 172 173 174 175 } 176 177 LTSPClientManager.prototype.showClientDialog=function showClientDialog(id, configured){ 141 178 //var client=id.replace("ltsp_client_","")+".json"; 142 179 var client=id.replace("ltsp_client_",""); … … 195 232 196 233 197 // Get boot list 198 199 self.getBootList(function(bootList){ // callback to continue 200 201 content+=Utils.formFactory.createSelect({"id":"ltsp_client_default_boot", 202 "help":self._("ltsp_client_default_boot"), 203 "label":self._("ltsp_client_default_boot"), 204 "default":default_boot, 205 "options":bootList }); 206 207 var dialog=bootbox.dialog({ 208 message: content, 209 title: "Client", 210 buttons:{ 234 235 var ButtonList={ 211 236 "Apply":{ 212 237 label:self._("lmd_client_options_dialog.apply"), … … 246 271 }, 247 272 cancel:{ 248 //label:self._("lmd.cancel"),249 label:"cancel",273 label:self._("lmd.cancel"), 274 //label:"cancel", 250 275 className: "btn-cancel btn-raised" } 251 } 252 253 }); 254 276 }; 277 278 279 280 // Add delete button 281 if (configured=="configured") 282 ButtonList.deleteButton={ 283 label:self._("lmd.delete"), 284 //label:"cancel", 285 className: "btn-danger btn-raised", 286 callback: function (){ 287 self.deleteClientConfig(id); 288 }}; 289 290 291 // Get boot list 292 293 self.getBootList(function(bootList){ // callback to continue 294 295 content+=Utils.formFactory.createSelect({"id":"ltsp_client_default_boot", 296 "help":self._("ltsp_client_default_boot"), 297 "label":self._("ltsp_client_default_boot"), 298 "default":default_boot, 299 "options":bootList }); 300 301 var dialog=bootbox.dialog({ 302 message: content, 303 title: "Client", 304 buttons:ButtonList}); 305 306 307 console.log(dialog); 255 308 256 309 $.material.init(); … … 276 329 277 330 Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function(response){ 331 var id="#ltsp_client_"+(client.mac.replace(/:/g,"")); 332 //alert(id); 333 $(id).find("i").removeClass("unconfigured"); 334 alert($(id).find("i")); 335 $(id).find("i").addClass("configured"); 336 $(id).attr("type","configured"); 337 $(id).find("i").attr("type","configured"); 338 278 339 message=(self._("llx.ltspclientmanager.client.saved")); 279 340 Utils.msg(message, MSG_SUCCESS); … … 291 352 var n4dclass="LmdBootManager"; 292 353 var n4dmethod="setLtsClientsConf"; 293 294 295 Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function(response){ 296 console.log(response); 354 355 var arglist=[]; 356 357 Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function(response){ 358 //console.log(response); 359 //alert(response); 297 360 callback(); 298 361 },0); … … 337 400 event.stopPropagation(); 338 401 var id=$(event.currentTarget).attr("id"); 339 self.showClientDialog(id); 402 var configured=$(event.currentTarget).attr("type"); 403 self.showClientDialog(id,configured); 340 404 }); 341 405 }
Note: See TracChangeset
for help on using the changeset viewer.