File: 0002-paths.patch

package info (click to toggle)
openzwave-controlpanel 1.6~git20200306.4b8a39d-2
  • links: PTS, VCS
  • area: non-free
  • in suites: forky
  • size: 536 kB
  • sloc: cpp: 6,407; javascript: 1,415; makefile: 101; sh: 59
file content (42 lines) | stat: -rw-r--r-- 2,003 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
From: Dara Adib <daradib@ocf.berkeley.edu>
Date: Wed, 21 Dec 2016 17:32:19 -0500
From: Nicolas Mora <babelouest@debian.org>
Date: Thu, 09 Jan 2025 11:13:50 -0500
Subject: paths

Hard-code Debian paths:
 - OpenZWave config in /etc/openzwave
 - static web files in /usr/share/openzwave-controlpanel
---
 ozwcp.cpp     | 2 +-
 webserver.cpp | 8 ++++----
 2 files changed, 5 insertions(+), 5 deletions(-)

--- a/webserver.cpp
+++ b/webserver.cpp
@@ -1261,15 +1261,21 @@
 	{
 		if (strcmp(url, "/") == 0 ||
 			strcmp(url, "/index.html") == 0)
-			ret = web_send_file(conn, "cp.html", MHD_HTTP_OK, false);
+			ret = web_send_file(conn, "/usr/share/openzwave-controlpanel/cp.html", MHD_HTTP_OK, false);
 #if 0
 		else if (strcmp(url, "/scenes.html") == 0)
-			ret = web_send_file(conn, "scenes.html", MHD_HTTP_OK, false);
+			ret = web_send_file(conn, "/usr/share/openzwave-controlpanel/scenes.html", MHD_HTTP_OK, false);
 #endif
 		else if (strcmp(url, "/cp.js") == 0)
-			ret = web_send_file(conn, "cp.js", MHD_HTTP_OK, false);
+			ret = web_send_file(conn, "/usr/share/openzwave-controlpanel/cp.js", MHD_HTTP_OK, false);
 		else if (strcmp(url, "/favicon.png") == 0)
-			ret = web_send_file(conn, "openzwavetinyicon.png", MHD_HTTP_OK, false);
+			ret = web_send_file(conn, "/usr/share/openzwave-controlpanel/openzwavetinyicon.png", MHD_HTTP_OK, false);
+		else if (strcmp(url, "/css/bootstrap.min.css") == 0)
+			ret = web_send_file(conn, "/usr/share/javascript/bootstrap5/css/bootstrap.min.css", MHD_HTTP_OK, false);
+		else if (strcmp(url, "/js/jquery.min.js") == 0)
+			ret = web_send_file(conn, "/usr/share/javascript/jquery/jquery.min.js", MHD_HTTP_OK, false);
+		else if (strcmp(url, "/js/bootstrap.min.js") == 0)
+			ret = web_send_file(conn, "/usr/share/javascript/bootstrap5/js/bootstrap.min.js", MHD_HTTP_OK, false);
 		else if (strcmp(url, "/poll.xml") == 0 && (devname != NULL || usb))
 			ret = SendPollResponse(conn);
 		else if (strcmp(url, "/devices.xml") == 0 && (devname != NULL || usb))