Zeilenenden vereinheitlichen: LF ueberall ausser im Fremdcode
Bisher entschied jede Arbeitsstation fuer sich, welche Zeilenenden ein Commit bekommt: Git fuer Windows setzt core.autocrlf=input in seiner System-Konfiguration, die NAS setzt nichts. Weil der Bestand ausserdem in sich gemischt war - 34 PHP-Dateien mit LF, 30 mit CRLF -, gab es gar kein richtiges Zeilenende, an das ein Werkzeug sich haette halten koennen. Jede Ergaenzung mit LF in einer CRLF-Datei ergab eine gemischte Datei; helper.php und js/solar/homeMQTT.js waren bereits so entstanden. .gitattributes macht die Zeilenenden zur Eigenschaft des Repositorys. LF, weil dieses Verzeichnis der Web-Ordner der NAS ist und von Linux ausgeliefert wird - und weil Git fuer Windows mit "input" ohnehin schon dorthin zeigt. restricted/WebAuthn bleibt ausgenommen und damit byteweise so, wie die Bibliothek geliefert wurde; darunter liegen 292 Zertifikate. Von den 47 geaenderten Dateien wurde nachgerechnet keine einzige im Inhalt angefasst - der Vergleich HEAD-ohne-CR gegen Index ist ueberall gleich. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
+65
-65
@@ -1,65 +1,65 @@
|
||||
<?php
|
||||
|
||||
require_once("../helper.php");
|
||||
if(!isset($_GET["TO"])){
|
||||
$_GET["TO"] = 12;
|
||||
}
|
||||
$_GET["TO"] = intval($_GET["TO"]);
|
||||
if(!isset($_GET["FROM"])){
|
||||
$_GET["FROM"] = -24;
|
||||
}
|
||||
$_GET["FROM"] = intval($_GET["FROM"]);
|
||||
|
||||
$Query = "SELECT
|
||||
UNIX_TIMESTAMP(CONCAT(date,' ',sunrise)) AS sunrise,
|
||||
UNIX_TIMESTAMP(CONCAT(date,' ',sunset)) AS sunset
|
||||
FROM solarLog.daylight
|
||||
WHERE date BETWEEN DATE_ADD(NOW(),INTERVAL ".($_GET["FROM"]-24)." HOUR) and DATE_ADD(NOW(),INTERVAL ".$_GET["TO"]." HOUR)
|
||||
ORDER BY date";
|
||||
|
||||
$linecolors["Solarleistung"] = "#FFFF00";
|
||||
$linecolors["UG"] = "#FFaa00";
|
||||
$linecolors["OG"] = "#FF4400";
|
||||
$linecolors["Auto UG"] = "#00aaFF";
|
||||
$linecolors["Auto OG"] = "#0044FF";
|
||||
$linecolors["Heizstab"] = "#FF0000";
|
||||
$linecolors["Batterieladung"] = "#00aa00";
|
||||
$linecolors["Einspeisung"] = "#b0b0b0";
|
||||
$linecolors["Ladestand"] = "#00aa00";
|
||||
$linecolors["Vorhersage"] = "#2222FF";
|
||||
|
||||
|
||||
|
||||
if (checkLogin()) {
|
||||
$mysql = new mysqli($mysql_server, $mysql_solarUser, $mysql_solarPass, $mysql_solarDB);
|
||||
$result = mysqli_query($mysql, $Query);
|
||||
if (!$result) {
|
||||
echo "Error:<br>" . mysqli_error($mysql) . "<br />";
|
||||
}
|
||||
//$obj[] = (object)[]; // Cast empty array to object
|
||||
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$ii = 1;
|
||||
$anno = (object)[];
|
||||
if($row["sunrise"] < (time()+$_GET["FROM"]*60*60)){
|
||||
$anno->xMin = (time()+$_GET["FROM"]*60*60)*1000;
|
||||
}else{
|
||||
$anno->xMin = $row["sunrise"]*1000;
|
||||
}
|
||||
if($row["sunset"] > (time()+$_GET["TO"]*60*60)){
|
||||
$anno->xMax = round(time()+$_GET["TO"]*60*60)*1000;
|
||||
}else{
|
||||
$anno->xMax = $row["sunset"]*1000;
|
||||
}
|
||||
$anno->borderWidth = 0;
|
||||
if($row["sunset"] > (time()+$_GET["FROM"]*60*60)){
|
||||
$obj[] = clone $anno;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//header('Content-Type: application/json');
|
||||
echo json_encode($obj);
|
||||
//echo '{"labels":[1761322682000,1761322782000,1761322882000,1761322982000,1761323082000,1761323182000,1761323282000],"datasets":[{"stack": "Stack 0","cubicInterpolationMode":"monotone","fill":"origin","label":"Acquisitions by year","data":[10,20,50,20,10,5,70]},{"fill": "false","stack": "Stack 1","cubicInterpolationMode": "monotone","label": "Acquisitions by year","data": [10,20,50,20,10,5,70]}]}';
|
||||
<?php
|
||||
|
||||
require_once("../helper.php");
|
||||
if(!isset($_GET["TO"])){
|
||||
$_GET["TO"] = 12;
|
||||
}
|
||||
$_GET["TO"] = intval($_GET["TO"]);
|
||||
if(!isset($_GET["FROM"])){
|
||||
$_GET["FROM"] = -24;
|
||||
}
|
||||
$_GET["FROM"] = intval($_GET["FROM"]);
|
||||
|
||||
$Query = "SELECT
|
||||
UNIX_TIMESTAMP(CONCAT(date,' ',sunrise)) AS sunrise,
|
||||
UNIX_TIMESTAMP(CONCAT(date,' ',sunset)) AS sunset
|
||||
FROM solarLog.daylight
|
||||
WHERE date BETWEEN DATE_ADD(NOW(),INTERVAL ".($_GET["FROM"]-24)." HOUR) and DATE_ADD(NOW(),INTERVAL ".$_GET["TO"]." HOUR)
|
||||
ORDER BY date";
|
||||
|
||||
$linecolors["Solarleistung"] = "#FFFF00";
|
||||
$linecolors["UG"] = "#FFaa00";
|
||||
$linecolors["OG"] = "#FF4400";
|
||||
$linecolors["Auto UG"] = "#00aaFF";
|
||||
$linecolors["Auto OG"] = "#0044FF";
|
||||
$linecolors["Heizstab"] = "#FF0000";
|
||||
$linecolors["Batterieladung"] = "#00aa00";
|
||||
$linecolors["Einspeisung"] = "#b0b0b0";
|
||||
$linecolors["Ladestand"] = "#00aa00";
|
||||
$linecolors["Vorhersage"] = "#2222FF";
|
||||
|
||||
|
||||
|
||||
if (checkLogin()) {
|
||||
$mysql = new mysqli($mysql_server, $mysql_solarUser, $mysql_solarPass, $mysql_solarDB);
|
||||
$result = mysqli_query($mysql, $Query);
|
||||
if (!$result) {
|
||||
echo "Error:<br>" . mysqli_error($mysql) . "<br />";
|
||||
}
|
||||
//$obj[] = (object)[]; // Cast empty array to object
|
||||
|
||||
while ($row = $result->fetch_assoc()) {
|
||||
$ii = 1;
|
||||
$anno = (object)[];
|
||||
if($row["sunrise"] < (time()+$_GET["FROM"]*60*60)){
|
||||
$anno->xMin = (time()+$_GET["FROM"]*60*60)*1000;
|
||||
}else{
|
||||
$anno->xMin = $row["sunrise"]*1000;
|
||||
}
|
||||
if($row["sunset"] > (time()+$_GET["TO"]*60*60)){
|
||||
$anno->xMax = round(time()+$_GET["TO"]*60*60)*1000;
|
||||
}else{
|
||||
$anno->xMax = $row["sunset"]*1000;
|
||||
}
|
||||
$anno->borderWidth = 0;
|
||||
if($row["sunset"] > (time()+$_GET["FROM"]*60*60)){
|
||||
$obj[] = clone $anno;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//header('Content-Type: application/json');
|
||||
echo json_encode($obj);
|
||||
//echo '{"labels":[1761322682000,1761322782000,1761322882000,1761322982000,1761323082000,1761323182000,1761323282000],"datasets":[{"stack": "Stack 0","cubicInterpolationMode":"monotone","fill":"origin","label":"Acquisitions by year","data":[10,20,50,20,10,5,70]},{"fill": "false","stack": "Stack 1","cubicInterpolationMode": "monotone","label": "Acquisitions by year","data": [10,20,50,20,10,5,70]}]}';
|
||||
|
||||
Reference in New Issue
Block a user