Changeset 2004 for lmd/trunk/fuentes/admin-center-ltsp.install
- Timestamp:
- Jun 23, 2016, 5:36:37 PM (5 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/css/imageManager.css
r1513 r2004 19 19 clear: both; 20 20 font-size: 1.2em; 21 margin: 3px; 21 22 } 22 23 … … 119 120 width: 100%; 120 121 height: auto; 121 background: #e0f2f1; 122 /*background: #e0f2f1;*/ 123 background: #B3E5FC; 122 124 margin: 5px; 123 125 clear: both; … … 128 130 .llx_ltsp_template_div:hover{ 129 131 cursor: pointer; 130 background: #b2dfdb; 132 /*background: #b2dfdb;*/ 133 background: #03A9F4; 134 131 135 } 132 136 133 137 .llx_ltsp_template_div_selected{ 134 background: #80cbc4; 138 /*background: #80cbc4;*/ 139 background: #0288D1; 140 color: #ffffff; 135 141 } 136 142 … … 160 166 161 167 } 168 169 #llx-ltsp-imagelist{ 170 padding: 20px; 171 } 172 173 #llx-ltsp-createImage-button{ 174 margin: 3px 20px 3px 20px; 175 height: 100px; 176 padding: 5px; 177 /* background-color: #03A9F4;*/ 178 background: radial-gradient(circle, #B3E5FC, #03A9F4); 179 color: #ffffff; 180 float: left; 181 display: block; 182 width: calc(100% - 37px); 183 } 184 185 #llx-ltsp-createImage-button:hover{ 186 cursor: pointer; 187 background-color: #B3E5FC; 188 189 } 190 191 .llx-ltsp-createImage-icon{ 192 width: 86px !important; 193 height: 86px !important; 194 margin: 3px 10px 3px 15px !important; 195 } 196 197 198 #LtspImageManagerContainer{ 199 margin: 10px; 200 height: auto; 201 width: calc(100% - 20px) !important; 202 } 203 204 205 206 #llx-ltsp-assistant-image-templates{ 207 height: 400px; 208 overflow-y: auto; 209 overflow-x: hidden; 210 } -
lmd/trunk/fuentes/admin-center-ltsp.install/lliurex-ltsp/src/images.html
r1872 r2004 1 < div>Images Manager</div>1 <h1 class="topBanner" i18n>LliureX LTSP Image Manager</h1> 2 2 3 <!--div id="LtspImageManagerContainer" class="jumbotron col-lg-12"--> 4 5 <div class="panel panel-default"> 6 <h2>Image List</h2> 7 <div id="LtspImageManagerContainer" class="panel-body"> 8 3 9 <div id="llx-ltsp-imagelist"></div> 4 <div id="llx-ltsp-createImage-button"> 5 <div class="btn btn-primary btn-fab"><i class="material-icons">computer</i></div> 10 <div id="llx-ltsp-createImage-button" class="ltsp-image-name"> 11 <div class="btn btn-primary btn-fab llx-ltsp-createImage-icon"><i class="material-icons">computer</i></div> 12 <span i18n>Create.New.LTSP.Image</span> 6 13 </div> 7 14 … … 116 123 </div> 117 124 </div> 125 126 127 128 </div></div> -
lmd/trunk/fuentes/admin-center-ltsp.install/lliurex-ltsp/src/js/imageManager.js
r1875 r2004 74 74 return retvalue; 75 75 }*/ 76 77 78 ImageManager.prototype.editImageWithCheck=function editImageWithCheck(id){ 79 var self=this; 80 81 var credentials=""; 82 var n4dclass="LmdImageManager"; 83 var n4dmethod="check_image_editing"; 84 var arglist=[]; 85 86 Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function(response){ 87 console.log(response.status+" "+response.response); 88 if ((response.status)&&(response.response)){ 89 90 var text=self._("lmd.imagemanager.image.edit.is.blocked.confirm"); 91 bootbox.confirm(text, function(res){ 92 if (res) { 93 var credentials=[sessionStorage.username , sessionStorage.password]; 94 var n4dclass="LmdImageManager"; 95 var n4dmethod="clean_image_editing"; 96 var arglist=[]; 97 98 Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function(){ 99 self.editImage(id); 100 },0); 101 102 103 }else { 104 return -1; 105 } 106 }); 107 108 109 } else self.editImage(id); 110 111 },0); 112 }; 113 114 115 116 ImageManager.prototype.editImage=function editImage(id){ 117 var self=this; 118 // Stage 1: Prepare Connection 119 var credentials=[sessionStorage.username , sessionStorage.password]; 120 var n4dclass="RemoteWebGui"; 121 var n4dmethod="create_connection"; 122 var arglist=[sessionStorage.username]; 123 var port; 124 var display; 125 126 console.log("1111111111111"); 127 128 Utils.waitwin.ShowModalInfo("Loading Client", "Client session will be shown on a new window. Wait a moment, please.", WAITWIN_LOADING); 129 console.log("222222222222222222"); 130 131 Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function(response){ 132 // Connection is prepared 133 console.log("33333333333333333333"); 134 //if (!(response.status)) alert(response); 135 console.log(response); 136 console.log("4444444444444444444"); 137 port=response.msg.port; 138 display=response.msg.display; 139 140 141 console.log("Port: "+port+" Display: "+display); 142 143 Utils.waitwin.SetStatus("Connection stablished", "If connection does not appear on new window, check browser or access directly to "+sessionStorage.server+":"+port, WAITWIN_WAITING); 144 145 console.log("55555555555555"); 146 147 // Showing new Window before 148 149 /*console.log("Creating new window"); 150 var win=window.open('http://'+sessionStorage.server+':'+port,'','width=1024,height=798,left=20,top=20,toolbar=0,location=0,scrollbars=0,status=0,resizable=0,fullscreen=0,menubar=0'); 151 */ 152 153 // Stage 2: Launch app into Window (wait 5 seconds) 154 console.log("launching app"); 155 var credentials=[sessionStorage.username , sessionStorage.password]; 156 var n4dclass="RemoteWebGui"; 157 var n4dmethod="run_into_connection"; 158 159 160 //var arglist=[["xterm",display]]; // Xterm by command!! 161 var arglist=[]; 162 arglist.push("/usr/share/lmd-scripts/awesome-desktop.sh "+id); 163 arglist.push(display); 164 165 Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function(response){ 166 console.log("Received response from run into connection:"); 167 console.log(response); 168 169 170 console.log("Creating new window"); 171 //var win=window.open('http://'+sessionStorage.server+':'+port,'','width=1024,height=798,left=20,top=20,toolbar=0,location=0,scrollbars=0,status=0,resizable=0,fullscreen=0,menubar=0'); 172 var win=window.open('http://'+sessionStorage.server+':'+port,'','width=1137,height=885,left=20,top=20,toolbar=0,location=0,scrollbars=0,status=0,resizable=0,fullscreen=0,menubar=0'); 173 174 175 // Stage 3: Prepare for closing window 176 var pollTimer = window.setInterval(function() { 177 if (win.closed !== false) { // !== is required for compatibility with Opera 178 console.log("Detected window close"); 179 //Utils.waitwin.RemoveModalInfo(); 180 Utils.waitwin.SetStatus("Closing Connection", "Session Connection will be closed shortly...", WAITWIN_LOADING); 181 window.clearInterval(pollTimer); 182 // New window is closed... cleaning connection 183 var credentials=[sessionStorage.username , sessionStorage.password]; 184 var n4dclass="RemoteWebGui"; 185 var n4dmethod="close_connection"; 186 var arglist=[port]; 187 //arglist.push(port); 188 console.log("Calling close_connection "+port); 189 try{ 190 Utils.n4d(credentials, n4dclass, n4dmethod, arglist, function(response){ 191 console.log("Response for close_connection:" + response); 192 if (response!=-1) { 193 console.log("Closing window..."); 194 console.log("111111111111111111111111111"); 195 Utils.waitwin.RemoveModalInfo(); 196 console.log("22222222222222222222"); 197 message="Connection closed sucessful!"; 198 console.log("33333333333333333333333333333333"); 199 Utils.msg(message, MSG_INFO); 200 console.log("44444444444444444444444444444444"); 201 //var text=self._("lmd.ask.for.regenerate.after.update"); 202 var text=self._("lmd.ask.for.regenerate.after.update"); 203 console.log("555555555555555555555555555555555"); 204 bootbox.confirm(text, function(res){ 205 console.log("6666666666666666666666666666"); 206 // Removing image with targetid 207 if (res) self.regenerateImage(id); 208 }); 209 console.log("677777777777777777777"); 210 211 212 } else { 213 console.log("Closing window with error"); 214 message="Closing window with error"; 215 Utils.msg(message, MSG_ERROR); 216 } 217 218 }); 219 220 221 222 } catch (e){console.log("EXCEPTIONNNNNNNNNNNNNNNN");console.log(e);} 223 } 224 }, 200); 225 226 227 }); 228 229 230 231 232 233 234 }, 0); // 0 is timeout for curl; 0 means sync call... 235 236 237 }; 238 76 239 77 240 //ImageManager.prototype.renderImage=function renderImage(imagefile, callback=null){ … … 146 309 var editImgBt=$(document.createElement("button")).attr("type", "button").addClass("btn btn-xs btn-info ltsp-img-bt btn-raised").attr("title", "Edit"); 147 310 $(editImgBt).html("<i class='material-icons' style='vertical-align:middle;'>cast</i> Edit"); 148 var regenerateImgBt=$(document.createElement("button")).attr("type", "button").addClass("btn btn-info btn-xs ltsp-img-bt ").attr("title", "Regenerate");311 var regenerateImgBt=$(document.createElement("button")).attr("type", "button").addClass("btn btn-info btn-xs ltsp-img-bt btn-raised").attr("title", "Regenerate"); 149 312 $(regenerateImgBt).html("<i class='material-icons' style='vertical-align:middle;'>refresh</i> Regenerate"); 150 var imgOptsBt=$(document.createElement("button")).attr("type", "button").addClass("btn btn-xs btn-info ltsp-img-bt ").attr("title", "Options");313 var imgOptsBt=$(document.createElement("button")).attr("type", "button").addClass("btn btn-xs btn-info ltsp-img-bt btn-raised").attr("title", "Options"); 151 314 $(imgOptsBt).html("<i class='material-icons' style='vertical-align:middle;'>edit</i> Options"); 152 var cloneImgBt=$(document.createElement("button")).attr("type", "button").addClass("btn btn-info btn-xs ltsp-img-bt ").attr("title", "Clone");315 var cloneImgBt=$(document.createElement("button")).attr("type", "button").addClass("btn btn-info btn-xs ltsp-img-bt btn-raised").attr("title", "Clone"); 153 316 $(cloneImgBt).html("<i class='material-icons' style='vertical-align:middle;'>filter</i> Clone"); 154 var listenImgBt=$(document.createElement("button")).attr("type", "button").addClass("btn btn-info btn-xs ltsp-img-bt ").attr("title", "Listen");317 var listenImgBt=$(document.createElement("button")).attr("type", "button").addClass("btn btn-info btn-xs ltsp-img-bt btn-raised").attr("title", "Listen"); 155 318 $(listenImgBt).html("<i class='material-icons' style='vertical-align:middle;'>pageview</i> Listen"); 156 319 $(listenImgBt).attr("taskid", imageContent.taskid); 157 var removeImgBt=$(document.createElement("button")).attr("type", "button").addClass("btn btn-danger btn-xs ltsp-img-bt ").attr("title", "Delete");320 var removeImgBt=$(document.createElement("button")).attr("type", "button").addClass("btn btn-danger btn-xs ltsp-img-bt btn-raised").attr("title", "Delete"); 158 321 $(removeImgBt).html("<i class='material-icons' style='vertical-align:middle;'>clear</i> Delete"); 159 322 … … 167 330 168 331 $(editImgBt).on("click", function(){ 169 alert("Edit "+$(this).attr("target_id"));170 332 self.editImageWithCheck($(this).attr("target_id")); 333 }); 171 334 172 335 $(regenerateImgBt).on("click", function(){ … … 754 917 //self.checkImageList(); 755 918 self.getImageList(); 756 757 }, 5000); 758 //}, 100000); // To modify!!919 920 }, 5000); // Timer 921 //}, 100000); // less invassive for debugging 759 922 } 760 923 }); -
lmd/trunk/fuentes/admin-center-ltsp.install/lliurex-ltsp/src/main.html
r1105 r2004 1 <h1> 2 Thin Client Management 3 </h1> 1 <h1 class="topBanner" i18n>LliureX Thin Client Management</h1> 4 2 5 3 <div id="bttest">Push me!</div>
Note: See TracChangeset
for help on using the changeset viewer.