IP change

This commit is contained in:
barwie2@st.amu.edu.pl 2020-03-08 17:10:03 +01:00
parent 7f5b8d8bc4
commit b0285bf1bd
4 changed files with 18 additions and 50 deletions

View File

@ -12,15 +12,16 @@ wss.on('connection', function connection(ws) {
});
var server = http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type": "text\plain"});
request.setEncoding('utf8');
if (request.method === "POST") {
var body = '';
request.on('data', function (chunk) {
body += chunk;
});
request.on('end', function () {
body = JSON.parse(body);
console.log(body);

View File

@ -2,45 +2,44 @@
<html>
<head>
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/css/materialize.min.css">
<meta charset="UTF-8">
<!-- Compiled and minified CSS -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/1.0.0-beta/css/materialize.min.css">
<meta charset="UTF-8">
<title>Add classes</title>
<title>Weryfikacja kodu zajęć</title>
</head>
<body>
<div class="container">
<div class="container">
<form>
<div>
<h5 class="center">Enter class data</h3>
<br /> Kod zajęć:
<p><h4 class="center">Wprowadź kod synchronizujący</h4></p>
<input type="text" id="classcode" required autofocus/>
</div>
<br />
<button class="btn waves-effect waves-light" type="submit">Akceptuj</button>
</form>
</div>
</div>
<script>
<script>
const electron = require('electron');
const {
ipcRenderer
ipcRenderer
} = electron;
const form = document.querySelector("form");
form.addEventListener("submit", submitForm);
function submitForm(e) {
e.preventDefault();
e.preventDefault();
var classcode = document.querySelector("#classcode").value;
var classcode = document.querySelector("#classcode").value;
ipcRenderer.send("set:classcode", classcode);
ipcRenderer.send("set:classcode", classcode);
}
</script>
</script>
</body>

View File

@ -297,7 +297,7 @@ function printStudent(item) {
});
axios.post('http://127.0.0.1:8889', JSON.stringify({
axios.post('https://150.254.78.197:8889', JSON.stringify({
classes_code: class_code,
student_index: item[2],
student_name: item[0],
@ -336,39 +336,7 @@ ipcMain.on("set:classcode", function (e,classcode) {
})
//Menu template
const mainMenuTemplate = [{
label: "Student",
submenu: [{
label: "Add student",
accelerator: process.platfrom == "darwin" ? "Command+E" : "Ctrl+E",
click() {
createAddWindow();
}
},
{
label: "Quit program",
accelerator: process.platfrom == "darwin" ? "Command+Q" : "Ctrl+Q",
click() {
app.quit();
}
}
]
}, {
label: "Classes",
submenu: [{
label: "Add classes",
click() {
createAddClassesWindow();
}
},
{
label: "Pick classes",
click() {
createSelectClassesWindow();
}
}
]
}];
const mainMenuTemplate = [];
//If mac psuh empty obj to Menu
if (process.platfrom == "darwin") {

View File

@ -46,7 +46,7 @@
<script>
var classes_code_input = $('#classes_code_input').html();
const client = new WebSocket('ws://127.0.0.1:8888', classes_code_input);
const client = new WebSocket('ws://150.254.78.197:8888', classes_code_input);
client.onmessage = function onmessage1(message) {
message = JSON.parse(message.data);