summaryrefslogtreecommitdiff
path: root/WebInterface/NodeJSServer
diff options
context:
space:
mode:
authorDennis Kobert <d-kobert@web.de>2018-09-28 15:27:00 +0200
committerDennis Kobert <d-kobert@web.de>2018-09-28 15:27:00 +0200
commit9aa97350b7144181c075aec5d44b818a74f2b7e8 (patch)
tree3a418053f5a753bb986d7cfed30e84ce88e2b87d /WebInterface/NodeJSServer
parent322e469730f86718bca94f87c9675af66c6c8540 (diff)
added client side group authentification
Diffstat (limited to 'WebInterface/NodeJSServer')
-rw-r--r--WebInterface/NodeJSServer/NodeJSServer.njsproj84
-rw-r--r--WebInterface/NodeJSServer/dist/chat.js12
-rw-r--r--WebInterface/NodeJSServer/dist/index.html11
3 files changed, 102 insertions, 5 deletions
diff --git a/WebInterface/NodeJSServer/NodeJSServer.njsproj b/WebInterface/NodeJSServer/NodeJSServer.njsproj
new file mode 100644
index 0000000..6181774
--- /dev/null
+++ b/WebInterface/NodeJSServer/NodeJSServer.njsproj
@@ -0,0 +1,84 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <PropertyGroup>
+ <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+ <SchemaVersion>2.0</SchemaVersion>
+ <ProjectGuid>{687040f4-1ffd-41aa-b4ca-e132a3d1fb15}</ProjectGuid>
+ <ProjectHome>.</ProjectHome>
+ <ProjectView>ShowAllFiles</ProjectView>
+ <StartupFile>webpack.config.js</StartupFile>
+ <WorkingDirectory>.</WorkingDirectory>
+ <OutputPath>.</OutputPath>
+ <ProjectTypeGuids>{3AF33F2E-1136-4D97-BBB7-1795711AC8B8};{349c5851-65df-11da-9384-00065b846f21};{9092AA53-FB77-4645-B42D-1CCCA6BD08BD}</ProjectTypeGuids>
+ <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
+ <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)' == 'Debug'" />
+ <PropertyGroup Condition="'$(Configuration)' == 'Release'" />
+ <ItemGroup>
+ <Content Include="package-lock.json" />
+ <Content Include="package.json" />
+ <Content Include="webpack.config.js" />
+ <Content Include="dist\404.html" />
+ <Content Include="dist\index.html" />
+ <Content Include="dist\index.css" />
+ <Content Include="dist\chat.js" />
+ <Content Include="dist\index.js" />
+ <Content Include="src\index.js" />
+ <Content Include="dist\ressources\Logo768.png" />
+ <Content Include="dist\ressources\menu.png" />
+ <Content Include="dist\ressources\menu_close.png" />
+ <Content Include="src\modules\ui\backdrop.js" />
+ </ItemGroup>
+ <ItemGroup>
+ <Folder Include="dist" />
+ <Folder Include="dist\ressources" />
+ <Folder Include="src" />
+ <Folder Include="src\modules" />
+ <Folder Include="src\modules\ui" />
+ <Folder Include="src\style" />
+ <Folder Include="src\style\partials" />
+ </ItemGroup>
+ <Import Project="$(MSBuildToolsPath)\Microsoft.Common.targets" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
+ <!--Do not delete the following Import Project. While this appears to do nothing it is a marker for setting TypeScript properties before our import that depends on them.-->
+ <Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)\TypeScript\Microsoft.TypeScript.targets" Condition="False" />
+ <Import Project="$(VSToolsPath)\Node.js Tools\Microsoft.NodejsTools.targets" />
+ <ProjectExtensions>
+ <VisualStudio>
+ <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
+ <WebProjectProperties>
+ <UseIIS>False</UseIIS>
+ <AutoAssignPort>True</AutoAssignPort>
+ <DevelopmentServerPort>0</DevelopmentServerPort>
+ <DevelopmentServerVPath>/</DevelopmentServerVPath>
+ <IISUrl>http://localhost:48022/</IISUrl>
+ <NTLMAuthentication>False</NTLMAuthentication>
+ <UseCustomServer>True</UseCustomServer>
+ <CustomServerUrl>http://localhost:1337</CustomServerUrl>
+ <SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
+ </WebProjectProperties>
+ </FlavorProperties>
+ <FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}" User="">
+ <WebProjectProperties>
+ <StartPageUrl>
+ </StartPageUrl>
+ <StartAction>CurrentPage</StartAction>
+ <AspNetDebugging>True</AspNetDebugging>
+ <SilverlightDebugging>False</SilverlightDebugging>
+ <NativeDebugging>False</NativeDebugging>
+ <SQLDebugging>False</SQLDebugging>
+ <ExternalProgram>
+ </ExternalProgram>
+ <StartExternalURL>
+ </StartExternalURL>
+ <StartCmdLineArguments>
+ </StartCmdLineArguments>
+ <StartWorkingDirectory>
+ </StartWorkingDirectory>
+ <EnableENC>False</EnableENC>
+ <AlwaysStartWebServerOnDebug>False</AlwaysStartWebServerOnDebug>
+ </WebProjectProperties>
+ </FlavorProperties>
+ </VisualStudio>
+ </ProjectExtensions>
+</Project> \ No newline at end of file
diff --git a/WebInterface/NodeJSServer/dist/chat.js b/WebInterface/NodeJSServer/dist/chat.js
index 6832cc2..1be6fbc 100644
--- a/WebInterface/NodeJSServer/dist/chat.js
+++ b/WebInterface/NodeJSServer/dist/chat.js
@@ -14,10 +14,20 @@ connection.start().catch(function (err) {
return console.error(err.toString());
});
+document.getElementById("loginButton").addEventListener("click", function (event) {
+ var group = document.getElementById("userInput").value;
+ var password = document.getElementById("messageInput").value;
+ connection.invoke("Login", group, password).catch(function (err) {
+ return console.error(err.toString());
+ });
+ event.preventDefault();
+});
+
document.getElementById("sendButton").addEventListener("click", function (event) {
var user = document.getElementById("userInput").value;
var message = document.getElementById("messageInput").value;
- connection.invoke("SendMessage", user, message).catch(function (err) {
+ var group = "TheCrew";
+ connection.invoke("SendMessage",group, user, message).catch(function (err) {
return console.error(err.toString());
});
event.preventDefault();
diff --git a/WebInterface/NodeJSServer/dist/index.html b/WebInterface/NodeJSServer/dist/index.html
index 4264b39..d54470c 100644
--- a/WebInterface/NodeJSServer/dist/index.html
+++ b/WebInterface/NodeJSServer/dist/index.html
@@ -1,4 +1,4 @@
-<!doctype html>
+<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
@@ -42,9 +42,12 @@
</ul>
<input type="text" id="user-input">
<input type="text" id="message-input">
- <button id="send-button">
- Senden
- </button>
+ <button id="send-button">
+ Senden
+ </button>
+ <button id="login-button">
+ Login
+ </button>
</div>
<!-- <div class="server-entries">
<p>Server 1</p>