Skip to content
Snippets Groups Projects
Verified Commit 2a276f46 authored by Alexander-Krause's avatar Alexander-Krause
Browse files

wip

parent 4fb290ee
No related branches found
No related tags found
No related merge requests found
......@@ -6,11 +6,11 @@ import { alias } from '@ember/object/computed';
export default Component.extend({
layout,
toggleIsHidden: alias('agent.isHidden'),
toggleIsHidden: alias('agent.isHidden'),
lastDiscoveryTimeAsDate: computed('agent.lastDiscoveryTime', function() {
const lastDiscoveryTime = this.get('agent.lastDiscoveryTime');
return new Date(lastDiscoveryTime).toLocaleString();
})
lastDiscoveryTimeAsDate: computed('agent.lastDiscoveryTime', function() {
const lastDiscoveryTime = this.get('agent.lastDiscoveryTime');
return new Date(lastDiscoveryTime).toLocaleString();
})
});
......@@ -24,11 +24,11 @@ export default Component.extend(AlertifyHandler, {
self.set('showSpinner', false);
self.handleMessageForUser();
})
.catch(() => {
.catch((errorObject) => {
self.get('agent').rollbackAttributes();
// closure action from discovery controller
self.errorHandling(self.get('agent.errorObject'));
self.errorHandling(errorObject);
});
} else {
self.handleMessageForUser();
......
......@@ -254,7 +254,7 @@ export default Component.extend(AlertifyHandler, {
const agentName = nameSelector(ip + ":" + port, agentRecord.get('name'));
const edgeIDAgent = agentName + "_ToexpLogo";
const faultyAgent = agentRecord.get('errorObject');
const faultyAgent = agentRecord.get('errorOccured');
let cssClassAgent = faultyAgent ?
"agent-error" : "agent";
......@@ -307,7 +307,7 @@ export default Component.extend(AlertifyHandler, {
const edgeID = procezzID + "To" + agentName;
const monitoredEnabled = procezzRecord.get('monitoredFlag');
const faultyProcezz = procezzRecord.get('errorObject');
const faultyProcezz = procezzRecord.get('errorOccured');
let cssClassProcezz = "procezz";
let cssClassEdge = "edge";
......
......@@ -6,12 +6,12 @@ import { computed } from '@ember/object';
export default Component.extend({
layout,
toggleStateWebServer: alias('procezz.webserverFlag'),
toggleIsHidden: alias('procezz.isHidden'),
toggleStateWebServer: alias('procezz.webserverFlag'),
toggleIsHidden: alias('procezz.isHidden'),
lastDiscoveryTimeAsDate: computed('procezz.lastDiscoveryTime', function() {
const lastDiscoveryTime = this.get('procezz.lastDiscoveryTime');
return new Date(lastDiscoveryTime).toLocaleString();
})
lastDiscoveryTimeAsDate: computed('procezz.lastDiscoveryTime', function() {
const lastDiscoveryTime = this.get('procezz.lastDiscoveryTime');
return new Date(lastDiscoveryTime).toLocaleString();
})
});
......@@ -31,12 +31,12 @@ export default Component.extend(AlertifyHandler, {
self.set('showSpinner', false);
self.handleMessageForUser(false);
})
.catch(() => {
.catch((errorObject) => {
self.get('procezz').rollbackAttributes();
// closure action from discovery controller
self.errorHandling(self.get('procezz.errorObject'));
self.errorHandling(errorObject);
});
} else {
self.handleMessageForUser(false);
......@@ -61,9 +61,9 @@ export default Component.extend(AlertifyHandler, {
})
.catch((errorObject) => {
self.get('procezz').rollbackAttributes();
// closure action from discovery controller
self.errorHandling(self.get('procezz.errorObject'));
self.errorHandling(errorObject);
});
}
},
......
......@@ -27,9 +27,7 @@ export default Controller.extend(AlertifyHandler, {
setup() {
this.set('renderingService.showTimeline', false);
this.resetState();
//this.fetchprocezzList();
},
......@@ -39,14 +37,24 @@ export default Controller.extend(AlertifyHandler, {
},
// closure action for embedded components
errorHandling(errorObject) {
if(errorObject) {
const errorTitle = errorObject.title;
const errorDetail = errorObject.detail;
errorHandling(errorArray) {
console.log("errorString", errorArray);
if(errorArray) {
let errorTitle = "There was an error.";
let errorDetail = "Error occured, but backend returned an invalid error object.";
let errorObject = errorArray.errors[0];
if(errorObject) {
errorTitle = errorObject.title ? errorObject.title : errorTitle;
errorDetail = errorObject.detail ? errorObject.detail : errorDetail;
}
const alertifyMessage =
`<b><font color="black">${errorTitle}</font></b>
</br></br>
${errorDetail} Your Modification is discarded.`;
this.showAlertifyMessageWithDuration(alertifyMessage, 6);
......
......@@ -6,7 +6,8 @@ export default Model.extend({
name: attr("string"),
lastDiscoveryTime: attr("number"),
errorObject: attr(),
errorMessage: attr("string"),
errorOccured: attr("boolean"),
isHidden: attr("boolean")
......
......@@ -6,8 +6,12 @@
</tr>
</thead>
<tbody>
<tr>
<td><b>Internal ID</b></td>
<td>{{agent.id}}</td>
</tr>
<tr>
<td><b>Agent IP:Port (PID)</b></td>
<td><b>Agent IP:Port</b></td>
<td>{{agent.ip}}:{{agent.port}}</td>
</tr>
<tr>
......@@ -36,5 +40,15 @@
</div>
</td>
</tr>
{{#if agent.errorOccured}}
<tr>
<td><b><font color="red">Error message</font></b></td>
<td>
<div class="well well-sm container-word-wrap" style="margin-bottom: 0px;">
<font color="red">{{agent.errorMessage}}</font>
</div>
</td>
</tr>
{{/if}}
</tbody>
</table>
\ No newline at end of file
......@@ -6,6 +6,10 @@
</tr>
</thead>
<tbody>
<tr>
<td><b>Internal ID</b></td>
<td>{{procezz.id}}</td>
</tr>
<tr>
<td><b>OS Process ID (PID)</b></td>
<td>{{procezz.pid}}</td>
......@@ -36,12 +40,12 @@
</div>
</td>
</tr>
{{#if procezz.errorObject}}
{{#if procezz.errorOccured}}
<tr>
<td><b><font color="red">Error message from agent</font></b></td>
<td><b><font color="red">Error message</font></b></td>
<td>
<div class="well well-sm container-word-wrap" style="margin-bottom: 0px;">
<font color="red">{{procezz.errorObject.title}}: {{procezz.errorObject.detail}}</font>
<font color="red">{{procezz.errorMessage}}</font>
</div>
</td>
</tr>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment