Changeset 129
- Timestamp:
- Jul 20, 2021, 11:08:27 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/ZdechovNET/UIPTVPage.pas
r128 r129 258 258 '<li>lze spárovat až 4 zařízení na jeden účet</li>' + 259 259 '<li>vyzkoušení na měsíc zdarma</li>' + 260 '<li>převzaté vysílání zajišťuje společnost <a href=" www.4net.tv">4NET.TV services s.r.o.</a></li>' +260 '<li>převzaté vysílání zajišťuje společnost <a href="https://www.4net.tv">4NET.TV services s.r.o.</a></li>' + 261 261 '<li>pro provoz služby stačí i nejnižší internetový tarif Internet 20M za 190 Kč/měsíc</li>' + 262 262 '</ul><br/>' + -
trunk/Modules/ZdechovNET/UInternetPage.pas
r128 r129 42 42 43 43 '<table class="WideTable">' + 44 '<tr><th>Označení</th><th>Minimální rychlost</th><th>Běžně dostupná </th><th>Maximální rychlost</th><th>Bonusová rychlost</th><th>Cena</th></tr>' +44 '<tr><th>Označení</th><th>Minimální rychlost</th><th>Běžně dostupná rychlost</th><th>Maximální rychlost</th><th>Bonusová rychlost</th><th>Cena</th></tr>' + 45 45 '<tr><td>Zdarma</td><td align="center">0</td><td align="center"> </td><td align="center">256 kbit/s</td><td align="center"> </td><td align="center">0 Kč</td></tr>' + 46 46 '<tr><td>Internet 20M</td><td align="center">6 Mbit/s</td><td align="center">12 Mbit/s</td><td align="center">20 Mbit/s</td><td align="center">140 Mbit/s</td><td align="center">190 Kč</td></tr>' + -
trunk/Modules/ZdechovNET/UWebCamPage.lfm
r97 r129 3 3 Caption = 'Webové kamery' 4 4 OnProduce = DataModuleProduce 5 Height = 50 6 HorizontalOffset = 259 7 VerticalOffset = 250 8 Width = 50 5 Height = 75 6 HorizontalOffset = 389 7 VerticalOffset = 375 8 Width = 75 9 PPI = 144 9 10 end -
trunk/Modules/ZdechovNET/UWebCamPage.pas
r105 r129 7 7 uses 8 8 Classes, SysUtils, FileUtil, UWebPage, UHTTPServer, UHtmlClasses, USqlDatabase, 9 UModuleUser ;9 UModuleUser, DateUtils; 10 10 11 11 type … … 16 16 procedure DataModuleProduce(HandlerData: THTTPHandlerData); 17 17 private 18 { private declarations }18 function GetVideoArchive(Id: string): string; 19 19 public 20 20 ModuleUser: TModuleUser; … … 63 63 end; 64 64 65 if CameraId >= 0 then IdParam := '& Id=' + IntToStr(CameraId)65 if CameraId >= 0 then IdParam := '&Id=' + IntToStr(CameraId) 66 66 else IdParam := ''; 67 67 Text := Text + '<table style="width: 100%"><tr><td style="width: 20%" valign="top">' + … … 79 79 Database.Query(DbRows, 'SELECT * FROM `Webcam` WHERE `Enabled`=1'); 80 80 for I := 0 to DbRows.Count - 1 do begin 81 Text := Text + '<a href="?Id=' + DbRows[I].Values['Id'] + '& W=' + IntToStr(ImageWidth) +81 Text := Text + '<a href="?Id=' + DbRows[I].Values['Id'] + '&W=' + IntToStr(ImageWidth) + 82 82 '">' + DbRows[I].Values['Name'] + '</a><br/>'; 83 83 end; … … 87 87 88 88 Text := Text + '<br/><strong>Kamery v okolí:</strong><br />' + 89 '<a href="http://www.mestovsetin.cz/vismo/dokumenty2.asp?id_org=18676& id=480245">Vsetínské kamery</a><br />' +90 '<a href="http ://www.huslenky.cz/?page=kamery&I=2">Kamery v Huslenkách</a><br/>' +89 '<a href="http://www.mestovsetin.cz/vismo/dokumenty2.asp?id_org=18676&id=480245">Vsetínské kamery</a><br />' + 90 '<a href="https://www.huslenky.cz/webkamery%2Dhuslenky/ds-1119/archiv=0&p1=1020">Kamery v Huslenkách</a><br/>' + 91 91 '<a href="http://kamery.hovnet.cz/">Kamery v Hovnetu</a><br/>' + 92 92 '</td><td style="width: 80%" valign="top">'; … … 121 121 ImageHeight := Round(ImageWidth * StrToInt(DbRows[0].Values['Height']) / StrToInt(DbRows[0].Values['Width'])); 122 122 123 if FileExists(WebCamImage) then begin 124 DateTimeToString(LastFileDate, 'hh:mm:ss d.m.yyyy', FileDateToDateTime(FileAge(WebCamImage))); 125 Text := Text + '<script language="JavaScript">' + #13#10 + 126 ' var ImageURL= "' + NavigationLink('/' + WebCamImage) + '";' + #13#10 + 127 '' + #13#10 + 128 '// Force an immediate image load' + #13#10 + 129 'var theTimer = setTimeout("reloadImage()", 1);' + #13#10 + 130 '' + #13#10 + 131 'function reloadImage()' + #13#10 + 132 '{' + #13#10 + 133 ' theDate = new Date();' + #13#10 + 134 ' var url = ImageURL;' + #13#10 + 135 ' url += "?dummy=";' + #13#10 + 136 ' url += theDate.getTime().toString(10);' + #13#10 + 137 ' // The above dummy cgi-parameter enforce a bypass of the browser image cache.' + #13#10 + 138 ' // Here we actually load the image' + #13#10 + 139 ' document.theImage.src = document.theImageTemp.src;' + #13#10 + 140 ' document.theImageTemp.src = url;' + #13#10 + 141 '' + #13#10 + 142 ' // Reload the image every defined period' + #13#10 + 143 ' theTimer = setTimeout("reloadImage()", ' + IntToStr(RefreshInterval * 1000) + ');' + #13#10 + 144 '}' + #13#10 + 145 '</script>' + #13#10 + 146 147 '<br /><div align="center">' + DbRows[0].Values['Name'] + '<br/>' + 148 '<img name="theImageTemp" src="' + NavigationLink('/' + WebCamImage) + '" width="0" height="0" alt="Temp image"/>' + 149 '<img name="theImage" src="' + NavigationLink('/' + WebCamImage) + '" width="' + IntToStr(ImageWidth) + 150 '" height="' + IntToStr(ImageHeight) + '" alt="' + 151 DbRows[0].Values['Name'] + '"/><br/>Aktualizace: <span id="lasttime">' + 152 LastFileDate + '</span>, Perioda: ' + 153 IntToStr(RefreshInterval) + ' sekund, Typ: ' + DbRows[0].Values['DeviceType'] + '<br />' + 154 '<br/>' + DbRows[0].Values['Description'] + '</div>'; 155 end else Text := Text + '<br />Obrázek nenalezen.<br /><br />'; 123 if FileExists(WebCamImage) then begin 124 DateTimeToString(LastFileDate, 'hh:mm:ss d.m.yyyy', FileDateToDateTime(FileAge(WebCamImage))); 125 Text := Text + '<script language="JavaScript">' + #13#10 + 126 ' var ImageURL= "' + NavigationLink('/' + WebCamImage) + '";' + #13#10 + 127 '' + #13#10 + 128 '// Force an immediate image load' + #13#10 + 129 'var theTimer = setTimeout("reloadImage()", 1);' + #13#10 + 130 '' + #13#10 + 131 'function reloadImage()' + #13#10 + 132 '{' + #13#10 + 133 ' theDate = new Date();' + #13#10 + 134 ' var url = ImageURL;' + #13#10 + 135 ' url += "?dummy=";' + #13#10 + 136 ' url += theDate.getTime().toString(10);' + #13#10 + 137 ' // The above dummy cgi-parameter enforce a bypass of the browser image cache.' + #13#10 + 138 ' // Here we actually load the image' + #13#10 + 139 ' document.theImage.src = document.theImageTemp.src;' + #13#10 + 140 ' document.theImageTemp.src = url;' + #13#10 + 141 '' + #13#10 + 142 ' // Reload the image every defined period' + #13#10 + 143 ' theTimer = setTimeout("reloadImage()", ' + IntToStr(RefreshInterval * 1000) + ');' + #13#10 + 144 '}' + #13#10 + 145 '</script>' + #13#10 + 146 147 '<br /><div align="center">' + DbRows[0].Values['Name'] + '<br/>' + 148 '<img name="theImageTemp" src="' + NavigationLink('/' + WebCamImage) + '" width="0" height="0" alt="Temp image"/>' + 149 '<img name="theImage" src="' + NavigationLink('/' + WebCamImage) + '" width="' + IntToStr(ImageWidth) + 150 '" height="' + IntToStr(ImageHeight) + '" alt="' + 151 DbRows[0].Values['Name'] + '"/></div>'; 152 end else Text := Text + '<br />Obrázek nenalezen.<br /><br />'; 153 Text := Text + '<br/><div align="center">'; 154 if LastFileDate <> '' then Text := Text + 'Aktualizace: <span id="lasttime">' + 155 LastFileDate + '</span>, '; 156 Text := Text + 'Perioda: ' + IntToStr(RefreshInterval) + ' sekund, Typ: ' + DbRows[0].Values['DeviceType'] + '<br />' + 157 '<br/>' + DbRows[0].Values['Description']; 158 Text := Text + GetVideoArchive(DbRows[0].Values['Id']) + '</div>'; 156 159 end else Text := Text + '<br />Id kamery nenalezeno.<br/><br>'; 157 160 finally … … 164 167 end; 165 168 169 function TWebCamPage.GetVideoArchive(Id: string): string; 170 var 171 I: Integer; 172 Items: TStringList; 173 DateStr: string; 174 VideoPathFormat: string; 175 Date: TDateTime; 176 Video: string; 177 const 178 OneDay = 24 * OneHour; 179 begin 180 Result := ''; 181 VideoPathFormat := 'images/webcam_archive/%s/%s/video.mp4'; 182 Items := TStringList.Create; 183 Date := Now - OneDay; 184 repeat 185 DateStr := FormatDateTime('yyyy-mm-dd', Date); 186 Video := Format(VideoPathFormat, [DateStr, Id]); 187 if FileExists(Video) then begin 188 Items.Add(DateStr + Items.NameValueSeparator + Video); 189 Date := Date - OneDay; 190 Continue; 191 end else Break; 192 until False; 193 194 if Items.Count > 0 then begin 195 Result := '<br/>Video archív: <select name="dates" id="dates">'; 196 for I := 0 to Items.Count - 1 do begin 197 Result := Result + '<option value="' + NavigationLink('/' + Items.ValueFromIndex[I]) + '">' + Items.Names[I] + '</option>'; 198 end; 199 Result := Result + '</select>'; 200 Result := Result + ' <button onclick="var element = document.getElementById(''dates''); window.open(element.value, ''_blank'')">Zobrazit</button>'; 201 end; 202 203 Items.Free; 204 end; 205 166 206 end. 167 207 -
trunk/ZdechovNET.lpi
r123 r129 244 244 <Filename Value="Modules/ZdechovNET/UWebCamPage.pas"/> 245 245 <IsPartOfProject Value="True"/> 246 <HasResources Value="True"/> 246 <ComponentName Value="WebCamPage"/> 247 <HasResources Value="True"/> 248 <ResourceBaseClass Value="DataModule"/> 247 249 </Unit22> 248 250 <Unit23>
Note:
See TracChangeset
for help on using the changeset viewer.