Code Review
/
src
/
app-framework-demo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
|
inline
| side by side (parent:
c8a7784
)
Update to LoginClient Plugin
author
Fulup Ar Foll
<fulup@iot.bzh>
Wed, 25 May 2016 22:06:57 +0000
(
00:06
+0200)
committer
Fulup Ar Foll
<fulup@iot.bzh>
Wed, 25 May 2016 22:06:57 +0000
(
00:06
+0200)
afb-client/app/Frontend/pages/Home/Home.html
patch
|
blob
|
history
afb-client/app/Frontend/pages/Home/HomeModule.js
patch
|
blob
|
history
afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js
patch
|
blob
|
history
diff --git
a/afb-client/app/Frontend/pages/Home/Home.html
b/afb-client/app/Frontend/pages/Home/Home.html
index
df20ee2
..
509bd6f
100644
(file)
--- a/
afb-client/app/Frontend/pages/Home/Home.html
+++ b/
afb-client/app/Frontend/pages/Home/Home.html
@@
-16,10
+16,10
@@
animationIn: slideInRight
<div class="button-box box-content ">
<div class="button-box box-content ">
- <submit-button class="session-button {{ctrl.class.
create}}" icon="fi-unlock" label="Open" clicked="ctrl.OpenSession
" ></submit-button>
+ <submit-button class="session-button {{ctrl.class.
login}}" icon="fi-unlock" label="Login" clicked="ctrl.LoginClient
" ></submit-button>
<submit-button class="session-button {{ctrl.class.check}}" icon="fi-checkbox" label="Check" clicked="ctrl.CheckSession" ></submit-button>
<submit-button class="session-button {{ctrl.class.refresh}}" icon="fi-arrows-compress" label="Refresh" clicked="ctrl.RefreshSession" ></submit-button>
<submit-button class="session-button {{ctrl.class.check}}" icon="fi-checkbox" label="Check" clicked="ctrl.CheckSession" ></submit-button>
<submit-button class="session-button {{ctrl.class.refresh}}" icon="fi-arrows-compress" label="Refresh" clicked="ctrl.RefreshSession" ></submit-button>
- <submit-button class="session-button {{ctrl.class.
reset}}" icon="fi-lock" label="Close" clicked="ctrl.ResetSession
" ></submit-button>
+ <submit-button class="session-button {{ctrl.class.
logout}}" icon="fi-lock" label="Logout" clicked="ctrl.LogoutClient
" ></submit-button>
</div>
<div class="message-box box-content vertical grid-frame">
</div>
<div class="message-box box-content vertical grid-frame">
diff --git
a/afb-client/app/Frontend/pages/Home/HomeModule.js
b/afb-client/app/Frontend/pages/Home/HomeModule.js
index
b082ee0
..
1743654
100644
(file)
--- a/
afb-client/app/Frontend/pages/Home/HomeModule.js
+++ b/
afb-client/app/Frontend/pages/Home/HomeModule.js
@@
-30,8
+30,8
@@
angular.module('HomeModule', ['SubmitButton', 'TokenRefresh','ModalNotification'
}
switch (jresp.request.reqid) {
}
switch (jresp.request.reqid) {
- case '
create
':
- case '
rese
t':
+ case '
login
':
+ case '
logou
t':
scope.class={};
break;
scope.class={};
break;
@@
-58,29
+58,29
@@
angular.module('HomeModule', ['SubmitButton', 'TokenRefresh','ModalNotification'
console.log ("FX: "+ JSON.stringify(response));
};
console.log ("FX: "+ JSON.stringify(response));
};
- scope.
OpenSession
= function() {
- console.log ("
OpenSession
");
- AppCall.get ("
token", "create
", {/*query*/}, scope.OnResponse, scope.InvalidApiCall);
+ scope.
LoginClient
= function() {
+ console.log ("
LoginClient
");
+ AppCall.get ("
auth", "login
", {/*query*/}, scope.OnResponse, scope.InvalidApiCall);
};
scope.CheckSession = function() {
};
scope.CheckSession = function() {
- console.log ("C
lose
Session");
- AppCall.get ("
token
", "check", {/*query*/}, scope.OnResponse, scope.InvalidApiCall);
+ console.log ("C
heck
Session");
+ AppCall.get ("
auth
", "check", {/*query*/}, scope.OnResponse, scope.InvalidApiCall);
};
scope.RefreshSession = function() {
console.log ("RefreshSession");
};
scope.RefreshSession = function() {
console.log ("RefreshSession");
- AppCall.get ("
token
", "refresh", {/*query*/}, scope.OnResponse, scope.InvalidApiCall);
+ AppCall.get ("
auth
", "refresh", {/*query*/}, scope.OnResponse, scope.InvalidApiCall);
};
};
- scope.
ResetSession
= function() {
- console.log ("
ResetSession
");
- AppCall.get ("
token", "rese
t", {/*query*/}, scope.OnResponse, scope.InvalidApiCall);
+ scope.
LogoutClient
= function() {
+ console.log ("
LogoutClient
");
+ AppCall.get ("
auth", "logou
t", {/*query*/}, scope.OnResponse, scope.InvalidApiCall);
};
scope.Initialised = function () {
};
scope.Initialised = function () {
- scope.class = {
create
: "success"};
+ scope.class = {
login
: "success"};
}
});
}
});
diff --git
a/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js
b/afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js
index
4dff4c9
..
3e5e8d6
100644
(file)
--- a/
afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js
+++ b/
afb-client/app/Frontend/widgets/Notifications/TokenRefreshSvc.js
@@
-86,7
+86,7
@@
angular.module('TokenRefresh', ['AppConfig', 'ModalNotification'])
// Check Binder status
scope.getping = function() {
// Check Binder status
scope.getping = function() {
- AppCall.get (
"token"
, "ping", {/*query*/},function(jresp, errcode) {
+ AppCall.get (
scope.plugin
, "ping", {/*query*/},function(jresp, errcode) {
if (errcode !== 200 || jresp.request.status !== "success") {
Notification.warning ({message: jresp.request.info, delay: 5000});
scope.offline();
if (errcode !== 200 || jresp.request.status !== "success") {
Notification.warning ({message: jresp.request.info, delay: 5000});
scope.offline();
@@
-100,7
+100,7
@@
angular.module('TokenRefresh', ['AppConfig', 'ModalNotification'])
// Check Binder status
scope.refresh = function() {
// Check Binder status
scope.refresh = function() {
- AppCall.get (
"token"
, "refresh", {/*query*/}, function(jresp, errcode) {
+ AppCall.get (
scope.plugin
, "refresh", {/*query*/}, function(jresp, errcode) {
scope.onsuccess (jresp, errcode);
scope.onsuccess (jresp, errcode);
@@
-111,7
+111,7
@@
angular.module('TokenRefresh', ['AppConfig', 'ModalNotification'])
// Initial connection
scope.loggin = function() {
// Initial connection
scope.loggin = function() {
- AppCall.get (
"token", "create
", {token: AppConfig.session.initial}, function(jresp, errcode) {
+ AppCall.get (
scope.plugin, "login
", {token: AppConfig.session.initial}, function(jresp, errcode) {
if (!scope.onsuccess (jresp, errcode)) return;
if (!scope.onsuccess (jresp, errcode)) return;
@@
-124,6
+124,7
@@
angular.module('TokenRefresh', ['AppConfig', 'ModalNotification'])
// Parse Widget Parameters
// Parse Widget Parameters
+ scope.plugin = attrs.plugin || "auth";
scope.icon = attrs.icon || "fi-lightbulb";
scope.hostname = $location.host();
scope.httpdport = $location.port();
scope.icon = attrs.icon || "fi-lightbulb";
scope.hostname = $location.host();
scope.httpdport = $location.port();