From 0b8edb49398c005d196ee923fba16cd1e04d9068 Mon Sep 17 00:00:00 2001 From: C-Anirudh Date: Wed, 10 Apr 2019 06:40:30 +0530 Subject: [PATCH 1/8] implemented set reminder and show reminder feature --- .gitignore | 3 +- service/controllers/messages.go | 34 +++++++++- service/controllers/set_reminder.go | 100 ++++++++++++++++++++++++++++ service/utils/service.go | 1 + view/app-jarvis.js | 76 +++++++++++++++++++++ view/components/main.html | 49 +++++++++++--- 6 files changed, 253 insertions(+), 10 deletions(-) create mode 100644 service/controllers/set_reminder.go diff --git a/.gitignore b/.gitignore index 08a57f9..ac44d2d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ conversations/audio/ tests/audio/ tests/mochawesome-report package-lock.json -service/subprocesses/node_modules/ \ No newline at end of file +service/subprocesses/node_modules/ +service/jarvis.db \ No newline at end of file diff --git a/service/controllers/messages.go b/service/controllers/messages.go index 4a29992..2792056 100644 --- a/service/controllers/messages.go +++ b/service/controllers/messages.go @@ -26,6 +26,12 @@ type messageQueryBody struct { // Link string `json:"link"` // } +type reminderResponse struct { + Status bool `json:"status"` + Message string `json:"message"` + Result []reminder `json:"result"` +} + type jsonResponseQuery struct { Status bool `json:"status"` Message string `json:"message"` @@ -72,7 +78,7 @@ type jsonResponseMeaning struct { } // MessagesController controls messages handling func MessagesController(w http.ResponseWriter, r *http.Request) { - + w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Access-Control-Allow-Headers", "Content-Type") r.ParseForm() @@ -328,6 +334,19 @@ func routes(routeObject response, w http.ResponseWriter) { result := messages.HealthController(med, w) TextToSpeech(result, 0) } + } else if strings.HasPrefix(strings.ToLower(message),"set reminder") { + w.Write([]byte(`{"status": "success", "message": "Enter Reminder details : ", "result": ""}`)) + } else if strings.HasPrefix(strings.ToLower(message),"show reminder") { + result := ShowReminder() + fmt.Println(result) + responseJSON := reminderResponse { + Status: true, + Message: "Here are your reminders : ", + Result: result, + } + jData, _ := json.Marshal(responseJSON) + w.Write(jData) + TextToSpeech("Here are your reminders.", 0) } else { // general conversation speech := messages.GeneralConvHandler(routeObject.message, routeObject.username, w) @@ -338,6 +357,19 @@ func routes(routeObject response, w http.ResponseWriter) { if strings.ToLower(firstPars) == "google" || strings.ToLower(firstPars) == "yahoo" || strings.ToLower(firstPars) == "bing" || strings.ToLower(firstPars) == "youtube" || strings.ToLower(firstPars) == "image" || strings.ToLower(firstPars) == "weather" { w.Write([]byte(`{"status": "success", "message": "Services unavailable at the moment ! Check your Internet Connection and try again.", "result": ""}`)) TextToSpeech("Services unavailable at the moment!", 0) + } else if strings.HasPrefix(strings.ToLower(message),"set reminder") { + w.Write([]byte(`{"status": "success", "message": "Enter Reminder details : ", "result": ""}`)) + } else if strings.HasPrefix(strings.ToLower(message),"show reminder") { + result := ShowReminder() + fmt.Println(result) + responseJSON := reminderResponse { + Status: true, + Message: "Here are your reminders : ", + Result: result, + } + jData, _ := json.Marshal(responseJSON) + w.Write(jData) + TextToSpeech("Here are your reminders.", 0) } else { // general conversation speech := messages.GeneralConvHandler(routeObject.message, routeObject.username, w) diff --git a/service/controllers/set_reminder.go b/service/controllers/set_reminder.go new file mode 100644 index 0000000..9aab083 --- /dev/null +++ b/service/controllers/set_reminder.go @@ -0,0 +1,100 @@ +package controllers + +import ( + "net/http" + "database/sql" + "fmt" + "log" + + _ "github.com/mattn/go-sqlite3" +) + +type reminder struct { + Id int `json:"id"` + Title string `json:"title"` + Description string `json:"description"` + Time string `json:"time"` +} + +// ReminderController controls reminder operations +func ReminderController(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Header().Set("Access-Control-Allow-Headers", "Content-Type") + r.ParseForm() + + request := reminder{ + Title: r.FormValue("title"), + Description: r.FormValue("description"), + Time: r.FormValue("time"), + } + fmt.Println(request) + + addReminder(request, w) + +} + +func addReminder(reminderObject reminder, w http.ResponseWriter) { + + db, err := sql.Open("sqlite3", "./jarvis.db") + checkErr(err) + defer db.Close() + + sqlStmt := `CREATE TABLE IF NOT EXISTS reminder (id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT, description TEXT, time TEXT);` + _, err = db.Exec(sqlStmt) + if err != nil { + log.Printf("%q: %s\n", err, sqlStmt) + return + } + + tx, err := db.Begin() + checkErr(err) + + stmt, err := tx.Prepare("insert into reminder(title, description, time) values(?, ?, ?)") + checkErr(err) + defer stmt.Close() + + _, err = stmt.Exec(reminderObject.Title, reminderObject.Description, reminderObject.Time) + checkErr(err) + tx.Commit() + + w.Write([]byte(`{"status": "success", "message": "Reminder has been set !"}`)) +} + +func ShowReminder() []reminder{ + var result []reminder + + db, err := sql.Open("sqlite3", "./jarvis.db") + checkErr(err) + defer db.Close() + + rows, err := db.Query("select id, title, description, time from reminder") + checkErr(err) + + defer rows.Close() + for rows.Next() { + var id int + var title string + var description string + var time string + err = rows.Scan(&id, &title, &description, &time) + checkErr(err) + + r := reminder { + Id: id, + Title: title, + Description: description, + Time: time, + } + result = append(result, r) + } + err = rows.Err() + checkErr(err) + + return result +} + +func checkErr(err error) { + if err != nil { + log.Fatal(err) + } +} \ No newline at end of file diff --git a/service/utils/service.go b/service/utils/service.go index 584fa12..3a0b7e4 100644 --- a/service/utils/service.go +++ b/service/utils/service.go @@ -9,6 +9,7 @@ import ( func routes() { http.HandleFunc("/", controllers.HomeController) http.HandleFunc("/message", controllers.MessagesController) + http.HandleFunc("/reminder", controllers.ReminderController) } // Server service server for Jarvis diff --git a/view/app-jarvis.js b/view/app-jarvis.js index c5d9b5a..f4d0c49 100644 --- a/view/app-jarvis.js +++ b/view/app-jarvis.js @@ -95,6 +95,7 @@ app.controller('MainController', function($scope,$location,$rootScope,$http) { show: false, length: null }; + console.log(messageObj) console.log(res); setTimeout(() => { $scope.scrollDown(); @@ -138,6 +139,20 @@ app.controller('MainController', function($scope,$location,$rootScope,$http) { messageObj.message = message; $scope.messageStack.push(messageObj); $scope.showLoading = false; + } else if ((status === 'success' || status) && message === 'Enter Reminder details : ') { + messageObj.sender = 'jarvis-bot'; + messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes()); + messageObj.length = message.length; + messageObj.message = message; + $scope.messageStack.push(messageObj); + } else if ((status === 'success' || status) && message === 'Here are your reminders : ') { + messageObj.sender = 'jarvis-bot'; + messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes()); + messageObj.length = message.length; + messageObj.message = message; + messageObj.result = result; + $scope.messageStack.push(messageObj); + console.log(messageObj); } else if (show) { messageObj.sender = 'jarvis-bot'; messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes()); @@ -162,6 +177,67 @@ app.controller('MainController', function($scope,$location,$rootScope,$http) { } }; + $scope.formData = {}; + $scope.setReminder = function() { + $scope.messageStack.pop(); + let reminder_title = $scope.formData.remTitle, + reminder_description = $scope.formData.remDescription, + reminder_time = $scope.formData.remTime, + + reminderObj = { + title: '', + description: '', + time: '' + }, + data = null; + + reminderObj.title = reminder_title; + reminderObj.description = reminder_description; + reminderObj.time = reminder_time; + + console.log(reminderObj); + + data = 'title='+reminderObj.title+'&description='+reminderObj.description+'&time='+reminderObj.time; + + console.log(data); + + $http({ + url:URL+'/reminder', + method:'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data:data + }).then(resp => { + let res = (resp.data), + message = res['message'], + status = res['status'], + messageObj = { + message: '', + sender: '', + time: '', + show: false, + length: null + }; + setTimeout(() => { + $scope.scrollDown(); + }, 100); + if ((status === 'success' || status) && message === 'Reminder has been set !') { + messageObj.sender = 'jarvis-bot'; + messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes()); + messageObj.length = message.length; + messageObj.message = message; + $scope.messageStack.push(messageObj); + } else { + console.error('[JARVIS] error fetching from service.'); + } + }).catch(e => { + throw e; + }); + $scope.formData.remTitle = ''; + $scope.formData.remDescription = ''; + } + $scope.scrollDown = function() { var elem = document.getElementById('stackArea-parent'); elem.scrollTop = elem.scrollHeight; diff --git a/view/components/main.html b/view/components/main.html index b6c40a6..088ad55 100644 --- a/view/components/main.html +++ b/view/components/main.html @@ -101,10 +101,46 @@

{{$index + 1}}. {{objectQuery.head}}

-
+
{{message.message}} - + + + {{message.sender}} + {{message.time}} + + +
+
+
+
+
+ + +
+ +
+ + +
+ + +
+ + +
+ + + +
+
+
+
+
+ {{message.result}} + {{message.sender}} {{message.time}} @@ -114,12 +150,9 @@

{{$index + 1}}. {{objectQuery.head}}


- {{$index + 1}}. {{objectQuery.meaning}}
- Example: {{objectQuery.example}}
-
- {{$parent.$index + 1}}.{{$index+1}}. {{sub.Smean}}
- Example: {{sub.Subexample}}
-
+

{{objectQuery.id}}. {{objectQuery.title}}

+

{{objectQuery.description}}

+

{{objectQuery.time}}

From e7f424666a0471450529a98d8c4b9153e641e301 Mon Sep 17 00:00:00 2001 From: C-Anirudh Date: Wed, 10 Apr 2019 07:07:06 +0530 Subject: [PATCH 2/8] corrected merge conflict error --- view/components/main.html | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/view/components/main.html b/view/components/main.html index 088ad55..fe7d7ab 100644 --- a/view/components/main.html +++ b/view/components/main.html @@ -139,7 +139,7 @@

{{$index + 1}}. {{objectQuery.head}}

- {{message.result}} + {{message.message}} {{message.sender}} @@ -157,6 +157,29 @@

{{objectQuery.id}}. {{objectQuery.title}}

+
+
+ {{message.message}} + + + {{message.sender}} + {{message.time}} + + +
+
+
+
+ {{$index + 1}}. {{objectQuery.meaning}}
+ Example: {{objectQuery.example}}
+
+ {{$parent.$index + 1}}.{{$index+1}}. {{sub.Smean}}
+ Example: {{sub.Subexample}}
+
+
+
+
+
From 659fab74fe8995e7336362a5d12a8c6473ed7234 Mon Sep 17 00:00:00 2001 From: Harkishen Singh Date: Wed, 10 Apr 2019 23:17:24 +0530 Subject: [PATCH 3/8] Update Readme.md --- Readme.md | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Readme.md b/Readme.md index db8ad91..fe0dda7 100644 --- a/Readme.md +++ b/Readme.md @@ -6,13 +6,13 @@ ## Introduction -The project aims to develop a personal-assistant for Linux-based systems. Jarvis draws its inspiration from virtual assistants like Cortana for Windows, and Siri for iOS. It has been designed to provide a user-friendly interface for carrying out a variety of tasks by employing certain well-defined commands. Users can interact with the assistant either through voice commands or using a keyboard input. +The project aims to develop a personal-assistant for Linux-based systems. Jarvis draws its inspiration from virtual assistants like Cortana for Windows, and Siri for iOS. It has been designed to provide a user-friendly interface for carrying out a variety of tasks by employing certain well-defined commands. Users can interact with the assistant either through ***voice commands or using a keyboard input***. To know the steps to install and run the project click [here](https://github.com/Harkishen-Singh/Jarvis-personal-assistant/blob/master/INSTALL.md) ## What Jarvis can do? -As a personal assistant, Jarvis assists the end-user with day-to-day activities like general human conversation, searching queries in google, bing or yahoo, searching for videos, retrieving images, live weather conditions, word meanings, searching for medicine details, health recommendations based on symptoms and reminding the user about the scheduled events and tasks. The user statements/commands are analysed with the help of machine learning to give an optimal solution. +As a personal assistant, Jarvis assists the end-user with day-to-day activities like *general human conversation, searching queries in google, bing or yahoo, searching for videos, retrieving images, live weather conditions, word meanings, searching for medicine details, health recommendations based on symptoms and reminding the user about the scheduled events and tasks*. The user statements/commands are analysed with the help of **machine learning** to give an optimal solution. ## Features @@ -38,6 +38,20 @@ Image “image you want to search” For getting meaning of a word format is,
meaning "word you are searching for" +**Medicine Details**
+Get the complete details of the medicine, including : +1. Indications +2. Contradictions +3. Trade/Brand Names +4. Indications +5. Dosage +6. Process of consumption +7. Warnings and Precautions related to the medicine +8. Storage conditions + +**Medicine Help based on symptoms**
+List your noticed symptoms and get immediate help on the medicines that could be taken. + ## Technology used
**Front-end**
From c02c6af554dbee14637a9c65d30401f5aaddb74a Mon Sep 17 00:00:00 2001 From: C-Anirudh Date: Wed, 10 Apr 2019 06:40:30 +0530 Subject: [PATCH 4/8] implemented set reminder and show reminder feature --- .gitignore | 3 +- service/controllers/messages.go | 34 +++++++++- service/controllers/set_reminder.go | 100 ++++++++++++++++++++++++++++ service/utils/service.go | 1 + view/app-jarvis.js | 76 +++++++++++++++++++++ view/components/main.html | 49 +++++++++++--- 6 files changed, 253 insertions(+), 10 deletions(-) create mode 100644 service/controllers/set_reminder.go diff --git a/.gitignore b/.gitignore index 08a57f9..ac44d2d 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,5 @@ conversations/audio/ tests/audio/ tests/mochawesome-report package-lock.json -service/subprocesses/node_modules/ \ No newline at end of file +service/subprocesses/node_modules/ +service/jarvis.db \ No newline at end of file diff --git a/service/controllers/messages.go b/service/controllers/messages.go index 4a29992..2792056 100644 --- a/service/controllers/messages.go +++ b/service/controllers/messages.go @@ -26,6 +26,12 @@ type messageQueryBody struct { // Link string `json:"link"` // } +type reminderResponse struct { + Status bool `json:"status"` + Message string `json:"message"` + Result []reminder `json:"result"` +} + type jsonResponseQuery struct { Status bool `json:"status"` Message string `json:"message"` @@ -72,7 +78,7 @@ type jsonResponseMeaning struct { } // MessagesController controls messages handling func MessagesController(w http.ResponseWriter, r *http.Request) { - + w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Access-Control-Allow-Headers", "Content-Type") r.ParseForm() @@ -328,6 +334,19 @@ func routes(routeObject response, w http.ResponseWriter) { result := messages.HealthController(med, w) TextToSpeech(result, 0) } + } else if strings.HasPrefix(strings.ToLower(message),"set reminder") { + w.Write([]byte(`{"status": "success", "message": "Enter Reminder details : ", "result": ""}`)) + } else if strings.HasPrefix(strings.ToLower(message),"show reminder") { + result := ShowReminder() + fmt.Println(result) + responseJSON := reminderResponse { + Status: true, + Message: "Here are your reminders : ", + Result: result, + } + jData, _ := json.Marshal(responseJSON) + w.Write(jData) + TextToSpeech("Here are your reminders.", 0) } else { // general conversation speech := messages.GeneralConvHandler(routeObject.message, routeObject.username, w) @@ -338,6 +357,19 @@ func routes(routeObject response, w http.ResponseWriter) { if strings.ToLower(firstPars) == "google" || strings.ToLower(firstPars) == "yahoo" || strings.ToLower(firstPars) == "bing" || strings.ToLower(firstPars) == "youtube" || strings.ToLower(firstPars) == "image" || strings.ToLower(firstPars) == "weather" { w.Write([]byte(`{"status": "success", "message": "Services unavailable at the moment ! Check your Internet Connection and try again.", "result": ""}`)) TextToSpeech("Services unavailable at the moment!", 0) + } else if strings.HasPrefix(strings.ToLower(message),"set reminder") { + w.Write([]byte(`{"status": "success", "message": "Enter Reminder details : ", "result": ""}`)) + } else if strings.HasPrefix(strings.ToLower(message),"show reminder") { + result := ShowReminder() + fmt.Println(result) + responseJSON := reminderResponse { + Status: true, + Message: "Here are your reminders : ", + Result: result, + } + jData, _ := json.Marshal(responseJSON) + w.Write(jData) + TextToSpeech("Here are your reminders.", 0) } else { // general conversation speech := messages.GeneralConvHandler(routeObject.message, routeObject.username, w) diff --git a/service/controllers/set_reminder.go b/service/controllers/set_reminder.go new file mode 100644 index 0000000..9aab083 --- /dev/null +++ b/service/controllers/set_reminder.go @@ -0,0 +1,100 @@ +package controllers + +import ( + "net/http" + "database/sql" + "fmt" + "log" + + _ "github.com/mattn/go-sqlite3" +) + +type reminder struct { + Id int `json:"id"` + Title string `json:"title"` + Description string `json:"description"` + Time string `json:"time"` +} + +// ReminderController controls reminder operations +func ReminderController(w http.ResponseWriter, r *http.Request) { + w.Header().Set("Access-Control-Allow-Origin", "*") + w.Header().Set("Access-Control-Allow-Headers", "Content-Type") + r.ParseForm() + + request := reminder{ + Title: r.FormValue("title"), + Description: r.FormValue("description"), + Time: r.FormValue("time"), + } + fmt.Println(request) + + addReminder(request, w) + +} + +func addReminder(reminderObject reminder, w http.ResponseWriter) { + + db, err := sql.Open("sqlite3", "./jarvis.db") + checkErr(err) + defer db.Close() + + sqlStmt := `CREATE TABLE IF NOT EXISTS reminder (id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT, description TEXT, time TEXT);` + _, err = db.Exec(sqlStmt) + if err != nil { + log.Printf("%q: %s\n", err, sqlStmt) + return + } + + tx, err := db.Begin() + checkErr(err) + + stmt, err := tx.Prepare("insert into reminder(title, description, time) values(?, ?, ?)") + checkErr(err) + defer stmt.Close() + + _, err = stmt.Exec(reminderObject.Title, reminderObject.Description, reminderObject.Time) + checkErr(err) + tx.Commit() + + w.Write([]byte(`{"status": "success", "message": "Reminder has been set !"}`)) +} + +func ShowReminder() []reminder{ + var result []reminder + + db, err := sql.Open("sqlite3", "./jarvis.db") + checkErr(err) + defer db.Close() + + rows, err := db.Query("select id, title, description, time from reminder") + checkErr(err) + + defer rows.Close() + for rows.Next() { + var id int + var title string + var description string + var time string + err = rows.Scan(&id, &title, &description, &time) + checkErr(err) + + r := reminder { + Id: id, + Title: title, + Description: description, + Time: time, + } + result = append(result, r) + } + err = rows.Err() + checkErr(err) + + return result +} + +func checkErr(err error) { + if err != nil { + log.Fatal(err) + } +} \ No newline at end of file diff --git a/service/utils/service.go b/service/utils/service.go index 584fa12..3a0b7e4 100644 --- a/service/utils/service.go +++ b/service/utils/service.go @@ -9,6 +9,7 @@ import ( func routes() { http.HandleFunc("/", controllers.HomeController) http.HandleFunc("/message", controllers.MessagesController) + http.HandleFunc("/reminder", controllers.ReminderController) } // Server service server for Jarvis diff --git a/view/app-jarvis.js b/view/app-jarvis.js index c5d9b5a..f4d0c49 100644 --- a/view/app-jarvis.js +++ b/view/app-jarvis.js @@ -95,6 +95,7 @@ app.controller('MainController', function($scope,$location,$rootScope,$http) { show: false, length: null }; + console.log(messageObj) console.log(res); setTimeout(() => { $scope.scrollDown(); @@ -138,6 +139,20 @@ app.controller('MainController', function($scope,$location,$rootScope,$http) { messageObj.message = message; $scope.messageStack.push(messageObj); $scope.showLoading = false; + } else if ((status === 'success' || status) && message === 'Enter Reminder details : ') { + messageObj.sender = 'jarvis-bot'; + messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes()); + messageObj.length = message.length; + messageObj.message = message; + $scope.messageStack.push(messageObj); + } else if ((status === 'success' || status) && message === 'Here are your reminders : ') { + messageObj.sender = 'jarvis-bot'; + messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes()); + messageObj.length = message.length; + messageObj.message = message; + messageObj.result = result; + $scope.messageStack.push(messageObj); + console.log(messageObj); } else if (show) { messageObj.sender = 'jarvis-bot'; messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes()); @@ -162,6 +177,67 @@ app.controller('MainController', function($scope,$location,$rootScope,$http) { } }; + $scope.formData = {}; + $scope.setReminder = function() { + $scope.messageStack.pop(); + let reminder_title = $scope.formData.remTitle, + reminder_description = $scope.formData.remDescription, + reminder_time = $scope.formData.remTime, + + reminderObj = { + title: '', + description: '', + time: '' + }, + data = null; + + reminderObj.title = reminder_title; + reminderObj.description = reminder_description; + reminderObj.time = reminder_time; + + console.log(reminderObj); + + data = 'title='+reminderObj.title+'&description='+reminderObj.description+'&time='+reminderObj.time; + + console.log(data); + + $http({ + url:URL+'/reminder', + method:'POST', + headers: { + 'Content-Type': 'application/x-www-form-urlencoded' + }, + data:data + }).then(resp => { + let res = (resp.data), + message = res['message'], + status = res['status'], + messageObj = { + message: '', + sender: '', + time: '', + show: false, + length: null + }; + setTimeout(() => { + $scope.scrollDown(); + }, 100); + if ((status === 'success' || status) && message === 'Reminder has been set !') { + messageObj.sender = 'jarvis-bot'; + messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes()); + messageObj.length = message.length; + messageObj.message = message; + $scope.messageStack.push(messageObj); + } else { + console.error('[JARVIS] error fetching from service.'); + } + }).catch(e => { + throw e; + }); + $scope.formData.remTitle = ''; + $scope.formData.remDescription = ''; + } + $scope.scrollDown = function() { var elem = document.getElementById('stackArea-parent'); elem.scrollTop = elem.scrollHeight; diff --git a/view/components/main.html b/view/components/main.html index b6c40a6..088ad55 100644 --- a/view/components/main.html +++ b/view/components/main.html @@ -101,10 +101,46 @@

{{$index + 1}}. {{objectQuery.head}}

-
+
{{message.message}} - + + + {{message.sender}} + {{message.time}} + + +
+
+
+
+
+ + +
+ +
+ + +
+ + +
+ + +
+ + + +
+
+
+
+
+ {{message.result}} + {{message.sender}} {{message.time}} @@ -114,12 +150,9 @@

{{$index + 1}}. {{objectQuery.head}}


- {{$index + 1}}. {{objectQuery.meaning}}
- Example: {{objectQuery.example}}
-
- {{$parent.$index + 1}}.{{$index+1}}. {{sub.Smean}}
- Example: {{sub.Subexample}}
-
+

{{objectQuery.id}}. {{objectQuery.title}}

+

{{objectQuery.description}}

+

{{objectQuery.time}}

From 8cdf819b1ba668661b58a3e209e6e595bd1f2524 Mon Sep 17 00:00:00 2001 From: C-Anirudh Date: Wed, 10 Apr 2019 07:07:06 +0530 Subject: [PATCH 5/8] corrected merge conflict error --- view/components/main.html | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/view/components/main.html b/view/components/main.html index 088ad55..fe7d7ab 100644 --- a/view/components/main.html +++ b/view/components/main.html @@ -139,7 +139,7 @@

{{$index + 1}}. {{objectQuery.head}}

- {{message.result}} + {{message.message}} {{message.sender}} @@ -157,6 +157,29 @@

{{objectQuery.id}}. {{objectQuery.title}}

+
+
+ {{message.message}} + + + {{message.sender}} + {{message.time}} + + +
+
+
+
+ {{$index + 1}}. {{objectQuery.meaning}}
+ Example: {{objectQuery.example}}
+
+ {{$parent.$index + 1}}.{{$index+1}}. {{sub.Smean}}
+ Example: {{sub.Subexample}}
+
+
+
+
+
From 41dbc6a67955f31fc22f21e3bb1a17a46439d077 Mon Sep 17 00:00:00 2001 From: C-Anirudh Date: Thu, 11 Apr 2019 00:17:21 +0530 Subject: [PATCH 6/8] corrected show message error --- view/app-jarvis.js | 13 +++++++------ view/components/main.html | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/view/app-jarvis.js b/view/app-jarvis.js index f4d0c49..482b0b8 100644 --- a/view/app-jarvis.js +++ b/view/app-jarvis.js @@ -132,27 +132,28 @@ app.controller('MainController', function($scope,$location,$rootScope,$http) { messageObj.result = result; $scope.messageStack.push(messageObj); $scope.showLoading = false; - } else if ((status === 'success' || status) && !show) { + } else if ((status === 'success' || status) && message === 'Enter Reminder details : ') { messageObj.sender = 'jarvis-bot'; messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes()); messageObj.length = message.length; messageObj.message = message; $scope.messageStack.push(messageObj); - $scope.showLoading = false; - } else if ((status === 'success' || status) && message === 'Enter Reminder details : ') { + } else if ((status === 'success' || status) && message === 'Here are your reminders : ') { + console.log("In show reminder"); messageObj.sender = 'jarvis-bot'; messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes()); messageObj.length = message.length; messageObj.message = message; + messageObj.result = result; $scope.messageStack.push(messageObj); - } else if ((status === 'success' || status) && message === 'Here are your reminders : ') { + console.log(messageObj); + } else if ((status === 'success' || status) && !show) { messageObj.sender = 'jarvis-bot'; messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes()); messageObj.length = message.length; messageObj.message = message; - messageObj.result = result; $scope.messageStack.push(messageObj); - console.log(messageObj); + $scope.showLoading = false; } else if (show) { messageObj.sender = 'jarvis-bot'; messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes()); diff --git a/view/components/main.html b/view/components/main.html index fe7d7ab..345a9f1 100644 --- a/view/components/main.html +++ b/view/components/main.html @@ -152,7 +152,8 @@

{{$index + 1}}. {{objectQuery.head}}

{{objectQuery.id}}. {{objectQuery.title}}

{{objectQuery.description}}

-

{{objectQuery.time}}

+
+

Due: {{objectQuery.time}}

From 82c4fbc48b201c738573c6ab3036a3e92e895e7b Mon Sep 17 00:00:00 2001 From: C-Anirudh Date: Wed, 10 Apr 2019 23:22:18 +0530 Subject: [PATCH 7/8] modified travis file --- .travis.yml | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1a276f5..8df5135 100644 --- a/.travis.yml +++ b/.travis.yml @@ -36,7 +36,13 @@ before-install: - . $HOME/.nvm/nvm.sh - nvm install stable - nvm use stable - - go get -u -v -d ./... + - go get -u github.com/Harkishen-Singh/Jarvis-personal-assistant/service/controllers + - go get -u github.com/Harkishen-Singh/Jarvis-personal-assistant/service/utils + - go get -u github.com/hegedustibor/htgo-tts + - go get -u github.com/mattn/go-sqlite3 + - go get -u github.com/op/go-logging + - go get -u github.com/Harkishen-Singh/Jarvis-personal-assistant/service/messages + - go get -u github.com/Harkishen-Singh/Jarvis-personal-assistant/service/messages - cd tests/ - cd npm install @@ -51,4 +57,3 @@ script: - cd tests/ - npm install - xvfb-run -s "-screen 0 1920x1080x16" -a mocha test.js - From 6b8516312da11b698b50eef105cfe2fd6078a2ae Mon Sep 17 00:00:00 2001 From: C-Anirudh Date: Thu, 11 Apr 2019 00:17:21 +0530 Subject: [PATCH 8/8] corrected show message error --- view/app-jarvis.js | 13 +++++++------ view/components/main.html | 3 ++- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/view/app-jarvis.js b/view/app-jarvis.js index f4d0c49..482b0b8 100644 --- a/view/app-jarvis.js +++ b/view/app-jarvis.js @@ -132,27 +132,28 @@ app.controller('MainController', function($scope,$location,$rootScope,$http) { messageObj.result = result; $scope.messageStack.push(messageObj); $scope.showLoading = false; - } else if ((status === 'success' || status) && !show) { + } else if ((status === 'success' || status) && message === 'Enter Reminder details : ') { messageObj.sender = 'jarvis-bot'; messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes()); messageObj.length = message.length; messageObj.message = message; $scope.messageStack.push(messageObj); - $scope.showLoading = false; - } else if ((status === 'success' || status) && message === 'Enter Reminder details : ') { + } else if ((status === 'success' || status) && message === 'Here are your reminders : ') { + console.log("In show reminder"); messageObj.sender = 'jarvis-bot'; messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes()); messageObj.length = message.length; messageObj.message = message; + messageObj.result = result; $scope.messageStack.push(messageObj); - } else if ((status === 'success' || status) && message === 'Here are your reminders : ') { + console.log(messageObj); + } else if ((status === 'success' || status) && !show) { messageObj.sender = 'jarvis-bot'; messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes()); messageObj.length = message.length; messageObj.message = message; - messageObj.result = result; $scope.messageStack.push(messageObj); - console.log(messageObj); + $scope.showLoading = false; } else if (show) { messageObj.sender = 'jarvis-bot'; messageObj.time = String(new Date().getHours() + ':' + new Date().getMinutes()); diff --git a/view/components/main.html b/view/components/main.html index fe7d7ab..345a9f1 100644 --- a/view/components/main.html +++ b/view/components/main.html @@ -152,7 +152,8 @@

{{$index + 1}}. {{objectQuery.head}}

{{objectQuery.id}}. {{objectQuery.title}}

{{objectQuery.description}}

-

{{objectQuery.time}}

+
+

Due: {{objectQuery.time}}