Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Cesium
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
clients
Cesium-grp
Cesium
Commits
86596274
There was a problem fetching the pipeline summary.
Commit
86596274
authored
7 years ago
by
Benoit Lavenier
Browse files
Options
Downloads
Patches
Plain Diff
fix jshint
parent
6aa336e5
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Pipeline
#
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
www/js/controllers/network-controllers.js
+1
-2
1 addition, 2 deletions
www/js/controllers/network-controllers.js
www/js/platform.js
+3
-4
3 additions, 4 deletions
www/js/platform.js
www/js/services/bma-services.js
+23
-24
23 additions, 24 deletions
www/js/services/bma-services.js
with
27 additions
and
30 deletions
www/js/controllers/network-controllers.js
+
1
−
2
View file @
86596274
...
@@ -296,6 +296,7 @@ function NetworkLookupController($scope, $state, $location, $ionicPopover, $win
...
@@ -296,6 +296,7 @@ function NetworkLookupController($scope, $state, $location, $ionicPopover, $win
};
};
$scope
.
showWs2pPopover
=
function
(
$event
,
peer
)
{
$scope
.
showWs2pPopover
=
function
(
$event
,
peer
)
{
$event
.
stopPropagation
();
return
$translate
(
'
NETWORK.VIEW.PRIVATE_ACCESS
'
)
return
$translate
(
'
NETWORK.VIEW.PRIVATE_ACCESS
'
)
.
then
(
function
(
privateAccessMessage
)
{
.
then
(
function
(
privateAccessMessage
)
{
...
@@ -320,8 +321,6 @@ function NetworkLookupController($scope, $state, $location, $ionicPopover, $win
...
@@ -320,8 +321,6 @@ function NetworkLookupController($scope, $state, $location, $ionicPopover, $win
}
}
});
});
});
});
$event
.
stopPropagation
();
};
};
...
...
This diff is collapsed.
Click to expand it.
www/js/platform.js
+
3
−
4
View file @
86596274
...
@@ -167,7 +167,6 @@ angular.module('cesium.platform', ['ngIdle', 'cesium.config', 'cesium.services']
...
@@ -167,7 +167,6 @@ angular.module('cesium.platform', ['ngIdle', 'cesium.config', 'cesium.services']
if
(
latestRelease
)
{
if
(
latestRelease
)
{
return
csHttp
.
get
(
latestRelease
.
host
,
latestRelease
.
protocol
==
'
https:
'
?
443
:
latestRelease
.
port
,
"
/
"
+
latestRelease
.
pathname
)()
return
csHttp
.
get
(
latestRelease
.
host
,
latestRelease
.
protocol
==
'
https:
'
?
443
:
latestRelease
.
port
,
"
/
"
+
latestRelease
.
pathname
)()
.
then
(
function
(
json
)
{
.
then
(
function
(
json
)
{
//console.debug(json);
if
(
json
&&
json
.
name
&&
json
.
tag_name
&&
json
.
html_url
)
{
if
(
json
&&
json
.
name
&&
json
.
tag_name
&&
json
.
html_url
)
{
return
{
return
{
version
:
json
.
name
,
version
:
json
.
name
,
...
@@ -178,7 +177,7 @@ angular.module('cesium.platform', ['ngIdle', 'cesium.config', 'cesium.services']
...
@@ -178,7 +177,7 @@ angular.module('cesium.platform', ['ngIdle', 'cesium.config', 'cesium.services']
})
})
.
catch
(
function
(
err
)
{
.
catch
(
function
(
err
)
{
// silent (just log it)
// silent (just log it)
console
.
error
(
'
[platform] Failed to get latest version
'
,
err
);
console
.
error
(
'
[platform] Failed to get
Cesium
latest version
'
,
err
);
})
})
;
;
}
}
...
@@ -349,11 +348,11 @@ angular.module('cesium.platform', ['ngIdle', 'cesium.config', 'cesium.services']
...
@@ -349,11 +348,11 @@ angular.module('cesium.platform', ['ngIdle', 'cesium.config', 'cesium.services']
csPlatform
.
version
.
latest
()
csPlatform
.
version
.
latest
()
.
then
(
function
(
release
)
{
.
then
(
function
(
release
)
{
if
(
release
&&
release
.
isNewer
)
{
if
(
release
&&
release
.
isNewer
)
{
console
.
info
(
'
[app] New release detected
:
{0}
'
.
format
(
release
.
version
));
console
.
info
(
'
[app] New release detected
[
{0}
]
'
.
format
(
release
.
version
));
$rootScope
.
newRelease
=
release
;
$rootScope
.
newRelease
=
release
;
}
}
else
{
else
{
console
.
info
(
'
[app]
Already us
e latest release
{0}
'
.
format
(
csConfig
.
version
));
console
.
info
(
'
[app]
Current version [{0}] is th
e latest release
'
.
format
(
csConfig
.
version
));
}
}
});
});
...
...
This diff is collapsed.
Click to expand it.
www/js/services/bma-services.js
+
23
−
24
View file @
86596274
...
@@ -66,6 +66,14 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium.
...
@@ -66,6 +66,14 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium.
that
.
started
=
false
;
that
.
started
=
false
;
that
.
init
=
init
;
that
.
init
=
init
;
// Allow to force SSL connection with port different from 443
that
.
forceUseSsl
=
(
csConfig
.
httpsMode
===
'
true
'
||
csConfig
.
httpsMode
===
true
||
csConfig
.
httpsMode
===
'
force
'
)
||
(
$window
.
location
&&
$window
.
location
.
protocol
===
'
https:
'
)
?
true
:
false
;
if
(
that
.
forceUseSsl
)
{
console
.
debug
(
'
[BMA] Enable SSL (forced by config or detected in URL)
'
);
}
if
(
host
)
{
if
(
host
)
{
init
(
host
,
port
,
useSsl
,
useCache
);
init
(
host
,
port
,
useSsl
,
useCache
);
}
}
...
@@ -76,18 +84,12 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium.
...
@@ -76,18 +84,12 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium.
that
.
alive
=
false
;
that
.
alive
=
false
;
that
.
cache
=
_emptyCache
();
that
.
cache
=
_emptyCache
();
// Allow to force SSL connection with port different from 443
var
forceUseSsl
=
(
csConfig
.
httpsMode
===
'
true
'
||
csConfig
.
httpsMode
===
true
||
csConfig
.
httpsMode
===
'
force
'
)
||
(
$window
.
location
&&
$window
.
location
.
protocol
===
'
https:
'
)
?
true
:
false
;
if
(
forceUseSsl
)
{
console
.
debug
(
'
[BMA] Enable SSL (forced by config or detected in URL)
'
);
}
// Use settings as default, if exists
// Use settings as default, if exists
if
(
csSettings
.
data
&&
csSettings
.
data
.
node
)
{
if
(
csSettings
.
data
&&
csSettings
.
data
.
node
)
{
host
=
host
||
csSettings
.
data
.
node
.
host
;
host
=
host
||
csSettings
.
data
.
node
.
host
;
port
=
port
||
csSettings
.
data
.
node
.
port
;
port
=
port
||
csSettings
.
data
.
node
.
port
;
useSsl
=
angular
.
isDefined
(
useSsl
)
?
useSsl
:
(
port
==
443
||
csSettings
.
data
.
node
.
useSsl
||
forceUseSsl
);
useSsl
=
angular
.
isDefined
(
useSsl
)
?
useSsl
:
(
port
==
443
||
csSettings
.
data
.
node
.
useSsl
||
that
.
forceUseSsl
);
useCache
=
angular
.
isDefined
(
useCache
)
?
useCache
:
true
;
useCache
=
angular
.
isDefined
(
useCache
)
?
useCache
:
true
;
}
}
...
@@ -96,7 +98,7 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium.
...
@@ -96,7 +98,7 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium.
}
}
that
.
host
=
host
;
that
.
host
=
host
;
that
.
port
=
port
||
80
;
that
.
port
=
port
||
80
;
that
.
useSsl
=
angular
.
isDefined
(
useSsl
)
?
useSsl
:
(
that
.
port
==
443
||
forceUseSsl
);
that
.
useSsl
=
angular
.
isDefined
(
useSsl
)
?
useSsl
:
(
that
.
port
==
443
||
that
.
forceUseSsl
);
that
.
useCache
=
angular
.
isDefined
(
useCache
)
?
useCache
:
false
;
that
.
useCache
=
angular
.
isDefined
(
useCache
)
?
useCache
:
false
;
that
.
server
=
csHttp
.
getServer
(
host
,
port
);
that
.
server
=
csHttp
.
getServer
(
host
,
port
);
that
.
url
=
csHttp
.
getUrl
(
host
,
port
,
''
/*path*/
,
useSsl
);
that
.
url
=
csHttp
.
getUrl
(
host
,
port
,
''
/*path*/
,
useSsl
);
...
@@ -822,22 +824,19 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium.
...
@@ -822,22 +824,19 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium.
});
});
};
};
// raw get latest release
// Define get latest release (or fake function is no URL defined)
var
latestRelease
=
csSettings
.
data
.
duniterLatestReleaseUrl
&&
csHttp
.
uri
.
parse
(
csSettings
.
data
.
duniterLatestReleaseUrl
);
var
duniterLatestReleaseUrl
=
csSettings
.
data
.
duniterLatestReleaseUrl
&&
csHttp
.
uri
.
parse
(
csSettings
.
data
.
duniterLatestReleaseUrl
);
if
(
latestRelease
)
{
exports
.
raw
.
getLatestRelease
=
duniterLatestReleaseUrl
?
var
useSsl
=
latestRelease
.
protocol
==
'
https:
'
;
csHttp
.
getWithCache
(
duniterLatestReleaseUrl
.
host
,
exports
.
raw
.
getLatestRelease
=
csHttp
.
getWithCache
(
latestRelease
.
host
,
duniterLatestReleaseUrl
.
port
,
latestRelease
.
port
,
"
/
"
+
duniterLatestReleaseUrl
.
pathname
,
"
/
"
+
latestRelease
.
pathname
,
/*useSsl*/
(
duniterLatestReleaseUrl
.
port
==
443
||
duniterLatestReleaseUrl
.
protocol
==
'
https:
'
||
that
.
forceUseSsl
),
useSsl
,
csHttp
.
cache
.
LONG
csHttp
.
cache
.
LONG
);
)
:
}
// No URL define: use a fake function
else
{
function
()
{
exports
.
raw
.
getLatestRelease
=
function
()
{
return
$q
.
when
();
return
$q
.
when
();
}
};
}
exports
.
version
.
latest
=
function
()
{
exports
.
version
.
latest
=
function
()
{
return
exports
.
raw
.
getLatestRelease
()
return
exports
.
raw
.
getLatestRelease
()
...
@@ -858,9 +857,9 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium.
...
@@ -858,9 +857,9 @@ angular.module('cesium.bma.services', ['ngApi', 'cesium.http.services', 'cesium.
})
})
.
catch
(
function
(
err
)
{
.
catch
(
function
(
err
)
{
// silent (just log it)
// silent (just log it)
console
.
error
(
'
[
platform
] Failed to get latest version
'
,
err
);
console
.
error
(
'
[
BMA
] Failed to get
Duniter
latest version
'
,
err
);
});
});
}
}
;
exports
.
websocket
=
{
exports
.
websocket
=
{
block
:
ws
(
'
/ws/block
'
),
block
:
ws
(
'
/ws/block
'
),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment