Code Review
/
src
/
app-framework-demo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
update to afb-daemon evolutions
[src/app-framework-demo.git]
/
afm-client
/
app
/
Frontend
/
pages
/
Dashboard
/
DashboardModule.js
diff --git
a/afm-client/app/Frontend/pages/Dashboard/DashboardModule.js
b/afm-client/app/Frontend/pages/Dashboard/DashboardModule.js
index
c075372
..
dff21ed
100644
(file)
--- a/
afm-client/app/Frontend/pages/Dashboard/DashboardModule.js
+++ b/
afm-client/app/Frontend/pages/Dashboard/DashboardModule.js
@@
-15,16
+15,15
@@
angular.module('DashboardModule', ['SubmitButton', 'TokenRefresh', 'AppliButton'
scope.appliIDs =[]; // array to hold applications ID
scope.appliStore={}; // array to hold applications json description
scope.appliIDs =[]; // array to hold applications ID
scope.appliStore={}; // array to hold applications json description
- scope.AppliCB = function (appliID) {
- console.log ("Application Clicked ID=[%s]", appliID);
-
- };
-
+
scope.AppliCB = function(appliID, action, response) {
// Action is done within Widget Controller only update debug UI zone
scope.request = action;
scope.errcode = response.status;
if (response.data) scope.response = response.data;
scope.AppliCB = function(appliID, action, response) {
// Action is done within Widget Controller only update debug UI zone
scope.request = action;
scope.errcode = response.status;
if (response.data) scope.response = response.data;
+
+ // On app was removed let's update runnable list
+ if (action === "uninstall") scope.GetRunnables();
};
scope.GetRunnables = function() {
};
scope.GetRunnables = function() {
@@
-43,24
+42,31
@@
angular.module('DashboardModule', ['SubmitButton', 'TokenRefresh', 'AppliButton'
}
// Check this is a valid response from Binder
}
// Check this is a valid response from Binder
- if (response.data.
request.jtype !== "AJB_reply" && response.data.request.api !== "runnables
") {
+ if (response.data.
jtype != "afb-reply
") {
Notification.error ({message: "Invalid Respond to /opa/afm-main/runnable response.data="+response.data, delay: 5000});
return;
}
// loop on runnable application to prepare for display
var appliIDs=[];
Notification.error ({message: "Invalid Respond to /opa/afm-main/runnable response.data="+response.data, delay: 5000});
return;
}
// loop on runnable application to prepare for display
var appliIDs=[];
- for (var idx=0; idx < response.data.response.length; idx ++) {
- appliIDs[idx] = response.data.response [idx].id;
- scope.appliStore [response.data.response [idx].id] = response.data.response [idx];
+ var runnables = response.data.response.runnables;
+ for (var idx=0; idx < runnables.length; idx ++) {
+ appliIDs[idx] = runnables [idx].id;
+ scope.appliStore [runnables [idx].id] = runnables [idx];
}
scope.appliIDs = appliIDs; // avoid partial update to limit UI refresh
});
};
}
scope.appliIDs = appliIDs; // avoid partial update to limit UI refresh
});
};
- scope.FileUploaded = function (
status
) {
+ scope.FileUploaded = function (
response
) {
console.log ("file Uploaded");
console.log ("file Uploaded");
+ // Cannot display post results as GetRunnable will overload them aynchronously
+ scope.request = "/api/afm-main/install";
+ scope.response = response.headers;
+ scope.errcode = response.status;
+
+ // everything looks OK update app list
scope.GetRunnables();
};
scope.GetRunnables();
};
@@
-72,4
+78,4
@@
angular.module('DashboardModule', ['SubmitButton', 'TokenRefresh', 'AppliButton'
});
console.log ("Dashboard Controller Loaded");
});
console.log ("Dashboard Controller Loaded");
-})();
\ No newline at end of file
+})();