Skip to content

Commit

Permalink
installer-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
GregorioMonari committed Mar 24, 2023
1 parent 3d127f0 commit eb46816
Show file tree
Hide file tree
Showing 9 changed files with 84 additions and 288 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.DS_Store
/.vscode
/4_UTILS
/5_RELEASES
/5_RELEASES
/6_API_my2sec_executable
11 changes: 9 additions & 2 deletions 1_ActivityWatchProducer/JS/ControlPanel/AwApiUpdateManager.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ class AwApiUpdateManager {
this.log.info("AwApiUpdateManager started!")
}
async stop(){
this.trainingActivitiesConsumer.cachedGraphs=[];
console.log("CLEANED CACHED GRAPHS")
this.trainingActivitiesConsumer.exit();
this.logTimesSub.unsubscribe();
this.log.info("AwApiUpdateManager stopped!")
Expand Down Expand Up @@ -107,6 +109,7 @@ class AwApiUpdateManager {
this.opanel.style.display="none"
this.currentSection=0;
//dovresti anche pulire tutti gli oggetti e cache

}

async on_validation_button_pressed(){
Expand Down Expand Up @@ -150,7 +153,10 @@ class AwApiUpdateManager {
var success=await this.awManager.getCsvNone()
console.log(success)
if(success=="True"){
throw new Error("None events are present in Csv")
document.getElementById("error_status").innerHTML="Error: unclassified events found: please change the input box with 'none' to a valid value, then press update again "
this.change_update_status(2)
//console.log("NONE EVENTS ARE PRESENT IN CSV")
//throw new Error("None events are present in Csv")
}
}else{
console.log("NOTHING TO SHOW, PROCEEDING WITH SENDING EVENTS")
Expand Down Expand Up @@ -326,7 +332,8 @@ class AwApiUpdateManager {
}else{
this.change_update_status(2)
}

this.trainingActivitiesConsumer.cachedGraphs=[]
console.log("CLEANED TRAINING ACTIVITIES CONSUMER CACHED GRAPHS")
}


Expand Down
Binary file not shown.
1 change: 0 additions & 1 deletion 1_ActivityWatchProducer/PY/my2sec/main/apps_selection.csv

This file was deleted.

2 changes: 1 addition & 1 deletion 1_ActivityWatchProducer/PY/my2sec/main/aw_my2sec.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def Start(self):
if self.watcher_running == True:
print("watcher already started")
return "Watcher already started", 400
print("watcher started")
print("Watcher started")
self.watcher_running = True
self.SetDatatime()
self.watcher_thread = Thread(target=self.WatcherThread, args=())
Expand Down
1 change: 0 additions & 1 deletion 1_ActivityWatchProducer/PY/my2sec/main/filekey.key

This file was deleted.

8 changes: 8 additions & 0 deletions 1_ActivityWatchProducer/SECURITY/js/keycloak_client.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ class keycloakClient {
if(this.readyState === XMLHttpRequest.DONE && this.status === 201){
console.log("keycloak-client: auth post completed, status 201")
resolve(req.responseText);
}else{
if(this.status === 409){
console.log("error: user already exists")
document.getElementById("createuser_error_message").innerHTML="Error: user already exists"
throw new Error("Error: user already exists")

//resolve(req.responseText);
}
}
}
}
Expand Down
6 changes: 5 additions & 1 deletion 1_ActivityWatchProducer/SECURITY/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,15 +85,19 @@ async function tryCreateUser(){
//data.lastName="gregcognome"
//data.email="[email protected]"
//data.username="gg"
var success=false;
try{
await my2secCreateUserApp.post_new_user(data,keycloak_loginApp_config.realm)
successbox.innerHTML="User "+createUserForm.create_username.value+" created!"
switch_view()
errorbox.innerHTML=""
success=true;
}catch(e){
console.log(e)
errorbox.innerHTML="Unexpected error occurred"
}
if(!success){
errorbox.innerHTML="Error creating user: already exists"
}


}else{
Expand Down
340 changes: 59 additions & 281 deletions 1_ActivityWatchProducer/log.log

Large diffs are not rendered by default.

0 comments on commit eb46816

Please sign in to comment.