Compare commits

...

4 commits

Author SHA1 Message Date
ecb06e812d Update branch with upstream changes
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2021-07-17 00:53:49 +02:00
c306acc97a Remove unused things
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2021-07-17 00:52:50 +02:00
8d7b5daa48 Merge pull request 'Logger works' (#160) from feature/logger-web into main
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #160
2021-07-16 21:39:21 +00:00
6ee3d16f74 Logger works
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2021-07-16 23:06:38 +02:00

View file

@ -1,23 +1,48 @@
import React, { useState, useEffect } from "react";
import React from "react";
import "../../App.css";
import Footer from "../../Footer";
import { logout, useAuth } from "../../auth/AuthProvider";
import InputField from "../InputField";
import SubmitField from "../SubmitField";
import { Logger } from "@behametrics/logger-web";
export default function BehaviorNormal() {
const [username, setUsername] = useState("");
const [password, setPassword] = useState("");
let username = "";
const setUsername = (tmp_username) => {
username = tmp_username;
};
const [isLoggedIn] = useAuth();
let password = "";
const setPassword = (tmp_password) => {
password = tmp_password;
};
let logger = new Logger({
//inputs: ["cursor", "wheel", "keyboard", "touch"],
inputs: ["keyboard"],
logToConsole: true,
});
logger.init();
const handleOff = () => {
logger.stop();
console.log("Logger ausgeschaltet");
};
const handleOn = () => {
logger.start();
console.log("start logging ");
};
const handlePasswordChange = (e) => {
console.log("handlePasswordChange");
setPassword(e.target.value);
};
const handleUsernameChange = (e) => {
console.log("handleUsernamechange");
setUsername(e.target.value);
};
const handlePasswordChange = (e) => {
setPassword(e.target.value);
};
const handleOnCopyEvent = (e) => {
e.preventDefault();
@ -42,7 +67,6 @@ export default function BehaviorNormal() {
body: JSON.stringify(opts),
}).then((response) => {
console.log(response.status);
console.log(isLoggedIn);
if (response.status === 401) {
response.json().then((resp) => {
console.log("nicht so wirklich gut");
@ -56,27 +80,11 @@ export default function BehaviorNormal() {
});
};
let logger = new Logger({
//inputs: ["cursor", "wheel", "keyboard", "touch"],
inputs: ["keyboard"],
logToConsole: true,
});
const handleOff = () => {
logger.stop();
logout();
console.log("Logger ausgeschaltet");
};
useEffect(() => {
logger.init().then(() => logger.start());
console.log("start logging");
}, []);
return (
<>
<div className="sitePage">
<h1>Studie</h1>
<button onClick={handleOn}>LOGGER StaRTEN</button>
<p>
Nachfolgend werden Sie einige Schritte durchlaufen, um ihre
Nutzerinteraktion messen zu können. Verwenden Sie hierbei jeweils