Toggle navigation
Toggle navigation
This project
Loading...
Sign in
digsig
/
digsig-services
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
Stefan Huber
2017-03-27 11:04:01 +0200
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
fc5918a4e1b745103024359d11de3021d7b9ce21
fc5918a4
1 parent
930e33d6
repository changed
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
dist/services/repository.d.ts
dist/services/repository.js
src/services/repository.ts
dist/services/repository.d.ts
View file @
fc5918a
...
...
@@ -6,8 +6,10 @@ export declare class Repository {
protected
device
:
Device
;
protected
_db
:
any
;
protected
_params
:
any
;
protected
_localWebPort
:
number
;
db
:
any
;
params
:
any
;
readonly
localWebPort
:
number
;
constructor
(
rest
:
Rest
,
device
:
Device
);
findById
(
id
:
string
):
Promise
<
any
>
;
findByIds
(
ids
:
Array
<
string
>
):
Promise
<
Array
<
any
>>
;
...
...
dist/services/repository.js
View file @
fc5918a
...
...
@@ -15,6 +15,7 @@ var Repository = (function () {
function
Repository
(
rest
,
device
)
{
this
.
rest
=
rest
;
this
.
device
=
device
;
this
.
_localWebPort
=
8320
;
}
Object
.
defineProperty
(
Repository
.
prototype
,
"db"
,
{
get
:
function
()
{
...
...
@@ -36,6 +37,13 @@ var Repository = (function () {
enumerable
:
true
,
configurable
:
true
});
Object
.
defineProperty
(
Repository
.
prototype
,
"localWebPort"
,
{
get
:
function
()
{
return
this
.
_localWebPort
;
},
enumerable
:
true
,
configurable
:
true
});
Repository
.
prototype
.
findById
=
function
(
id
)
{
return
this
.
db
.
get
(
id
);
};
...
...
@@ -104,7 +112,7 @@ var Repository = (function () {
_this
.
rest
.
scanEnvironment
(
response
.
local_ips
)
.
then
(
function
(
node
)
{
var
res
=
_this
.
parseUrl
(
response
.
db_url
);
resolve
(
_this
.
prepare
(
res
.
protocol
+
'://'
+
res
.
user
+
':'
+
res
.
pass
+
'@'
+
res
.
domain
+
'/'
+
res
.
orig_db_name
));
resolve
(
_this
.
prepare
(
res
.
protocol
+
'://'
+
res
.
user
+
':'
+
res
.
pass
+
'@'
+
node
.
IP
+
':'
+
_this
.
localWebPort
+
'/'
+
res
.
orig_db_name
));
}).
catch
(
function
()
{
resolve
(
_this
.
prepare
(
response
.
db_url
));
});
...
...
src/services/repository.ts
View file @
fc5918a
...
...
@@ -10,6 +10,7 @@ export class Repository {
protected
_db
:
any
;
protected
_params
:
any
;
protected
_localWebPort
:
number
=
8320
;
get
db
()
{
return
this
.
_db
;
...
...
@@ -27,6 +28,10 @@ export class Repository {
this
.
_params
=
params
;
}
get
localWebPort
()
:
number
{
return
this
.
_localWebPort
;
}
constructor
(
protected
rest
:
Rest
,
protected
device
:
Device
...
...
@@ -99,7 +104,7 @@ export class Repository {
this
.
rest
.
scanEnvironment
(
response
.
local_ips
)
.
then
(
node
=>
{
let
res
=
this
.
parseUrl
(
response
.
db_url
);
resolve
(
this
.
prepare
(
res
.
protocol
+
'://'
+
res
.
user
+
':'
+
res
.
pass
+
'@'
+
res
.
domain
+
'/'
+
res
.
orig_db_name
));
resolve
(
this
.
prepare
(
res
.
protocol
+
'://'
+
res
.
user
+
':'
+
res
.
pass
+
'@'
+
node
.
IP
+
':'
+
this
.
localWebPort
+
'/'
+
res
.
orig_db_name
));
}).
catch
(()
=>
{
resolve
(
this
.
prepare
(
response
.
db_url
));
});
...
...
Please
register
or
login
to post a comment