mirror of
				https://github.com/Theodor-Springmann-Stiftung/hamann-ausgabe-core.git
				synced 2025-10-30 09:45:32 +00:00 
			
		
		
		
	Neuer Stuff
This commit is contained in:
		| @@ -8,7 +8,7 @@ | |||||||
|     <div class="ha-static-right-margin"> |     <div class="ha-static-right-margin"> | ||||||
|         <h1>Mitwirkende</h1> |         <h1>Mitwirkende</h1> | ||||||
|         <h3>Herausgeber</h3> |         <h3>Herausgeber</h3> | ||||||
|         Dr. Janina Reiblod<br> |         Dr. Janina Reibold<br> | ||||||
|         Leonard Keidel |         Leonard Keidel | ||||||
|  |  | ||||||
|         <h3>Philologische Mitarbeit</h3> |         <h3>Philologische Mitarbeit</h3> | ||||||
|   | |||||||
| @@ -69,9 +69,14 @@ public class WebSocketMiddleware : IMiddleware { | |||||||
|         _openSockets!.Add(webSocket); |         _openSockets!.Add(webSocket); | ||||||
|         WebSocketReceiveResult result = await webSocket.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None); |         WebSocketReceiveResult result = await webSocket.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None); | ||||||
|         while (!result.CloseStatus.HasValue) { |         while (!result.CloseStatus.HasValue) { | ||||||
|  |             var msg = Encoding.UTF8.GetString(buffer,0,result.Count); | ||||||
|  |             if (msg.ToLower() == "hello") { | ||||||
|                 var state = _xmlProvider.GetGitState(); |                 var state = _xmlProvider.GetGitState(); | ||||||
|                 await webSocket.SendAsync(_SerializeToBytes(state), WebSocketMessageType.Text, true, CancellationToken.None); |                 await webSocket.SendAsync(_SerializeToBytes(state), WebSocketMessageType.Text, true, CancellationToken.None); | ||||||
|             await webSocket.SendAsync(_SerializeToBytes(new FileState(_xmlService.GetState())), result.MessageType, true, CancellationToken.None); |                 await webSocket.SendAsync(_SerializeToBytes(new FileState(_xmlService.GetState())), WebSocketMessageType.Text, true, CancellationToken.None); | ||||||
|  |             } else if (msg.ToLower() == "ping" ) { | ||||||
|  |                 await webSocket.SendAsync(_SerializeToBytes(new { Ping = true}), WebSocketMessageType.Text, true, CancellationToken.None); | ||||||
|  |             } | ||||||
|             result = await webSocket.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None); |             result = await webSocket.ReceiveAsync(new ArraySegment<byte>(buffer), CancellationToken.None); | ||||||
|         } |         } | ||||||
|         await webSocket.CloseAsync(result.CloseStatus.Value, result.CloseStatusDescription, CancellationToken.None); |         await webSocket.CloseAsync(result.CloseStatus.Value, result.CloseStatusDescription, CancellationToken.None); | ||||||
|   | |||||||
							
								
								
									
										31
									
								
								HaWeb/appsettings.Development.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										31
									
								
								HaWeb/appsettings.Development.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,31 @@ | |||||||
|  | { | ||||||
|  |     "Logging": { | ||||||
|  |       "LogLevel": { | ||||||
|  |         "Default": "Information", | ||||||
|  |         "Microsoft.AspNetCore": "Warning" | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     "FeatureManagement": { | ||||||
|  |       "AdminService":  true, | ||||||
|  |       "LocalPublishService": true, | ||||||
|  |       "SyntaxCheck": true, | ||||||
|  |       "Notifications": true | ||||||
|  |     }, | ||||||
|  |     "AllowedWebSocketConnections": "*", | ||||||
|  |     "AllowedHosts": "*", | ||||||
|  |     "HamannFileStoreLinux": "/var/www/vhosts/development.hamann-ausgabe.de/httpdocs/Hamann/", | ||||||
|  |     "HamannFileStoreWindows": "C:/Users/simon/Downloads/test/", | ||||||
|  |     "BareRepositoryPathLinux": "/var/www/vhosts/development.hamann-ausgabe.de/httpdocs/Bare/", | ||||||
|  |     "BareRepositoryPathWindows": "C:/Users/simon/source/hamann-xml/.git/", | ||||||
|  |     "WorkingTreePathLinux": "/var/www/vhosts/development.hamann-ausgabe.de/httpdocs/Repo/", | ||||||
|  |     "WorkingTreePathWindows": "C:/Users/simon/source/hamann-xml/", | ||||||
|  |     "RepositoryBranch": "testdata", | ||||||
|  |     "RepositoryURL": "https://github.com/Theodor-Springmann-Stiftung/hamann-xml", | ||||||
|  |     "StoredPDFPathWindows": "", | ||||||
|  |     "StoredPDFPathLinux": "", | ||||||
|  |     "FileSizeLimit": 52428800, | ||||||
|  |     "AvailableStartYear": 1700, | ||||||
|  |     "AvailableEndYear": 1800, | ||||||
|  |     "LettersOnPage": 80 | ||||||
|  | } | ||||||
|  |    | ||||||
							
								
								
									
										29
									
								
								HaWeb/appsettings.Staging.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								HaWeb/appsettings.Staging.json
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,29 @@ | |||||||
|  | { | ||||||
|  |     "Logging": { | ||||||
|  |       "LogLevel": { | ||||||
|  |         "Default": "Information", | ||||||
|  |         "Microsoft.AspNetCore": "Warning" | ||||||
|  |       } | ||||||
|  |     }, | ||||||
|  |     "FeatureManagement": { | ||||||
|  |       "AdminService":  true, | ||||||
|  |       "LocalPublishService": true, | ||||||
|  |       "SyntaxCheck": true, | ||||||
|  |       "Notifications": true | ||||||
|  |     }, | ||||||
|  |     "AllowedWebSocketConnections": "*", | ||||||
|  |     "AllowedHosts": "*", | ||||||
|  |     "HamannFileStoreLinux": "/var/www/vhosts/development.hamann-ausgabe.de/httpdocs/Hamann/", | ||||||
|  |     "BareRepositoryPathLinux": "/var/www/vhosts/development.hamann-ausgabe.de/httpdocs/Bare/", | ||||||
|  |     "BareRepositoryPathWindows": "C:/Users/simon/source/hamann-xml/.git/", | ||||||
|  |     "WorkingTreePathLinux": "/var/www/vhosts/development.hamann-ausgabe.de/httpdocs/Repo/", | ||||||
|  |     "RepositoryBranch": "main", | ||||||
|  |     "RepositoryURL": "https://github.com/Theodor-Springmann-Stiftung/hamann-xml", | ||||||
|  |     "StoredPDFPathWindows": "", | ||||||
|  |     "StoredPDFPathLinux": "", | ||||||
|  |     "FileSizeLimit": 52428800, | ||||||
|  |     "AvailableStartYear": 1700, | ||||||
|  |     "AvailableEndYear": 1800, | ||||||
|  |     "LettersOnPage": 80 | ||||||
|  |   } | ||||||
|  |    | ||||||
| @@ -13,13 +13,11 @@ | |||||||
|   }, |   }, | ||||||
|   "AllowedWebSocketConnections": "*", |   "AllowedWebSocketConnections": "*", | ||||||
|   "AllowedHosts": "*", |   "AllowedHosts": "*", | ||||||
|   "HamannFileStoreLinux": "/var/www/vhosts/test.hamann-ausgabe.de/httpdocs/Hamann/", |   "HamannFileStoreLinux": "/var/www/vhosts/hamann-ausgabe.de/httpdocs/Hamann/", | ||||||
|   "HamannFileStoreWindows": "C:/Users/simon/Downloads/test/", |   "BareRepositoryPathLinux": "/var/www/vhosts/hamann-ausgabe.de/httpdocs/Bare/", | ||||||
|   "BareRepositoryPathLinux": "/var/www/vhosts/test.hamann-ausgabe.de/httpdocs/Bare/", |  | ||||||
|   "BareRepositoryPathWindows": "C:/Users/simon/source/hamann-xml/.git/", |   "BareRepositoryPathWindows": "C:/Users/simon/source/hamann-xml/.git/", | ||||||
|   "WorkingTreePathLinux": "/var/www/vhosts/test.hamann-ausgabe.de/httpdocs/Repo/", |   "WorkingTreePathLinux": "/var/www/vhosts/hamann-ausgabe.de/httpdocs/Repo/", | ||||||
|   "WorkingTreePathWindows": "C:/Users/simon/source/hamann-xml/", |   "RepositoryBranch": "Release", | ||||||
|   "RepositoryBranch": "testdata", |  | ||||||
|   "RepositoryURL": "https://github.com/Theodor-Springmann-Stiftung/hamann-xml", |   "RepositoryURL": "https://github.com/Theodor-Springmann-Stiftung/hamann-xml", | ||||||
|   "StoredPDFPathWindows": "", |   "StoredPDFPathWindows": "", | ||||||
|   "StoredPDFPathLinux": "", |   "StoredPDFPathLinux": "", | ||||||
|   | |||||||
							
								
								
									
										2
									
								
								HaWeb/commands.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								HaWeb/commands.txt
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | |||||||
|  | rm .\bin\Release\net6.0\linux-x64\publish\appsettings.json | ||||||
|  | scp -r -i C:\Users\simon\.ssh\id_tss .\bin\Release\net6.0\linux-x64\publish\* admin@astra.tss-hd.de:~/publish/ | ||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -2,6 +2,7 @@ var stateSC = null; | |||||||
| var stateValidation = null; | var stateValidation = null; | ||||||
| var stateReload = null; | var stateReload = null; | ||||||
| var stateCommit = null; | var stateCommit = null; | ||||||
|  | var statePing = false; | ||||||
| var firstMessage = true; | var firstMessage = true; | ||||||
| var commsLog = document.getElementById("commsLog"); | var commsLog = document.getElementById("commsLog"); | ||||||
| var commsNot = document.getElementById("comm-notifications"); | var commsNot = document.getElementById("comm-notifications"); | ||||||
| @@ -9,7 +10,7 @@ var socket; | |||||||
|  |  | ||||||
| var scheme = document.location.protocol === "https:" ? "wss" : "ws"; | var scheme = document.location.protocol === "https:" ? "wss" : "ws"; | ||||||
| var port = document.location.port ? (":" + document.location.port) : ""; | var port = document.location.port ? (":" + document.location.port) : ""; | ||||||
|  | var wsPingInterval; | ||||||
| var connectionUrl = scheme + "://" + document.location.hostname + port + "/WS" ; | var connectionUrl = scheme + "://" + document.location.hostname + port + "/WS" ; | ||||||
|  |  | ||||||
| function htmlEscape(str) { | function htmlEscape(str) { | ||||||
| @@ -25,9 +26,13 @@ function htmlEscape(str) { | |||||||
| socket = new WebSocket(connectionUrl); | socket = new WebSocket(connectionUrl); | ||||||
| socket.onopen = function (event) { | socket.onopen = function (event) { | ||||||
|     socket.send("Hello"); |     socket.send("Hello"); | ||||||
|  |     wsPingInterval = setInterval(() => { | ||||||
|  |         socket.send("Ping"); | ||||||
|  |     }, 4500); | ||||||
|     updateMessage(); |     updateMessage(); | ||||||
| }; | }; | ||||||
| socket.onclose = function (event) { | socket.onclose = function (event) { | ||||||
|  |     clearInterval(wsPingInterval); | ||||||
|     updateMessage(); |     updateMessage(); | ||||||
| }; | }; | ||||||
| socket.onerror = updateMessage; | socket.onerror = updateMessage; | ||||||
| @@ -66,15 +71,18 @@ socket.onmessage = function (event) { | |||||||
|     } else if (msg.reload != null) { |     } else if (msg.reload != null) { | ||||||
|         stateReload = msg.reload; |         stateReload = msg.reload; | ||||||
|         if (msg.reload) { |         if (msg.reload) { | ||||||
|  |             commsLog.innerHTML = 'Seite wird neu geladen.'; | ||||||
|  |             commsNot.classList.add("imp"); | ||||||
|             setTimeout(() =>  { |             setTimeout(() =>  { | ||||||
|                 commsNot.remove(); |                 commsNot.remove(); | ||||||
|                 socket.close(1000, "bye"); |                 socket.close(1000, "bye"); | ||||||
|                 location.reload(); |                 location.reload(); | ||||||
|             }, 1500); |             }, 2000); | ||||||
|              |  | ||||||
|         } |         } | ||||||
|     } else if (msg.SC != null) { |     } else if (msg.SC != null) { | ||||||
|         stateSC = msg.SC; |         stateSC = msg.SC; | ||||||
|  |     } else if (msg.Ping != null) { | ||||||
|  |         statePing = true; | ||||||
|     } else { |     } else { | ||||||
|         commsLog.innerHTML = htmlEscape(event.data); |         commsLog.innerHTML = htmlEscape(event.data); | ||||||
|     } |     } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Simon Martens
					Simon Martens