Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
yotta
/
pictogram
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
60
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
3ab2912f
authored
Jan 14, 2018
by
Arturo Montejo Ráez
Browse files
Options
_('Browse Files')
Download
Email Patches
Plain Diff
adding notifications on connection issues, again
parent
d0028bec
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
13 deletions
sails/src/assets/scripts/modules/student/controllers/student.js
sails/src/assets/scripts/modules/student/controllers/student.js
View file @
3ab2912f
...
@@ -45,7 +45,7 @@ dashboardControllers.controller('StudentCtrl', function StudentCtrl(
...
@@ -45,7 +45,7 @@ dashboardControllers.controller('StudentCtrl', function StudentCtrl(
// from the abstract parent (it has no url)
// from the abstract parent (it has no url)
$scope
.
studentData
.
id
=
$state
.
$current
.
locals
.
globals
.
$stateParams
.
idStudent
;
$scope
.
studentData
.
id
=
$state
.
$current
.
locals
.
globals
.
$stateParams
.
idStudent
;
//
//
--------------------------------------------------------------------------
// WebSockets communication
// WebSockets communication
//
//
io
.
socket
.
on
(
'update_peers'
,
function
(
data
)
{
io
.
socket
.
on
(
'update_peers'
,
function
(
data
)
{
...
@@ -56,12 +56,6 @@ dashboardControllers.controller('StudentCtrl', function StudentCtrl(
...
@@ -56,12 +56,6 @@ dashboardControllers.controller('StudentCtrl', function StudentCtrl(
}
}
});
});
io
.
socket
.
on
(
'disconnect'
,
function
()
{
$scope
.
studentData
.
pcb_count
=
0
;
$scope
.
studentData
.
pdb_count
=
0
;
ngToast
.
alert
(
$translate
.
instant
(
'no_subscribed'
));
});
io
.
socket
.
on
(
'disconnect'
,
function
()
{
io
.
socket
.
on
(
'disconnect'
,
function
()
{
$scope
.
studentData
.
pcb_count
=
0
;
$scope
.
studentData
.
pcb_count
=
0
;
$scope
.
studentData
.
pdb_count
=
0
;
$scope
.
studentData
.
pdb_count
=
0
;
...
@@ -80,15 +74,19 @@ dashboardControllers.controller('StudentCtrl', function StudentCtrl(
...
@@ -80,15 +74,19 @@ dashboardControllers.controller('StudentCtrl', function StudentCtrl(
token
:
$window
.
sessionStorage
.
token
token
:
$window
.
sessionStorage
.
token
},
},
function
(
data
)
{
function
(
data
)
{
if
(
data
.
room
.
search
(
'student'
)
!=
-
1
)
{
if
(
data
.
room
.
search
(
'student'
)
!=
-
1
)
{
$scope
.
studentData
.
pcb_count
=
data
.
pcb_count
;
$scope
.
studentData
.
pcb_count
=
data
.
pcb_count
;
$scope
.
studentData
.
pdb_count
=
data
.
pdb_count
;
$scope
.
studentData
.
pdb_count
=
data
.
pdb_count
;
$scope
.
$apply
();
$scope
.
$apply
();
ngToast
.
warning
(
$translate
.
instant
(
'subscribed'
));
ngToast
.
warning
(
$translate
.
instant
(
'subscribed'
));
}
}
});
});
});
});
// --------------------------------------------------------------------------
// Scope functions
//
$scope
.
updateLicenseExpiration
=
function
()
{
$scope
.
updateLicenseExpiration
=
function
()
{
if
(
!
$scope
.
studentData
.
license
){
if
(
!
$scope
.
studentData
.
license
){
$scope
.
studentData
.
license_expired
=
true
;
$scope
.
studentData
.
license_expired
=
true
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment