Skip to content
Next
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
Minds Frontend
Project
Project
Details
Activity
Releases
Dependency List
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
820
Issues
820
List
Boards
Labels
Service Desk
Milestones
Merge Requests
47
Merge Requests
47
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
List
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Minds
Minds Frontend
Compare Revisions
70032bcaaf7c2ff0a00cf69c2825b9d6aa4cb23b...0248724ec9d5a2e6dff360b4893edf156b4152dd
Source
0248724ec9d5a2e6dff360b4893edf156b4152dd
Select Git revision
...
Target
70032bcaaf7c2ff0a00cf69c2825b9d6aa4cb23b
Select Git revision
Compare
Commits (2)
[Sprint/GiddyGiraffe] (fix): analytics
· e8067fd0
Marcelo Rivera
authored
6 hours ago
e8067fd0
Merge branch 'fix/giddy-giraffe-analytics' into 'master'
· 0248724e
Mark Harding
authored
6 hours ago
[Sprint/GiddyGiraffe] (fix): analytics See merge request
!407
0248724e
Hide whitespace changes
Inline
Side-by-side
Showing
47 changed files
with
1148 additions
and
249 deletions
+1148
-249
analytics.module.ts
src/app/modules/analytics/analytics.module.ts
+4
-0
active-users.component.html
...components/cards/active-users/active-users.component.html
+14
-7
active-users.component.ts
...s/components/cards/active-users/active-users.component.ts
+33
-17
engagement.component.html
...ics/components/cards/engagement/engagement.component.html
+83
-7
engagement.component.ts
...ytics/components/cards/engagement/engagement.component.ts
+99
-2
boosts.component.html
...cs/components/cards/offchain-boosts/boosts.component.html
+166
-14
boosts.component.ts
...tics/components/cards/offchain-boosts/boosts.component.ts
+201
-1
offchain-plus.component.html
...mponents/cards/offchain-plus/offchain-plus.component.html
+8
-4
offchain-plus.component.ts
...components/cards/offchain-plus/offchain-plus.component.ts
+9
-18
wire.component.html
...lytics/components/cards/offchain-wire/wire.component.html
+10
-5
wire.component.ts
...nalytics/components/cards/offchain-wire/wire.component.ts
+10
-23
boosts.component.html
...ics/components/cards/onchain-boosts/boosts.component.html
+12
-5
boosts.component.ts
...ytics/components/cards/onchain-boosts/boosts.component.ts
+8
-8
onchain-plus.component.html
...components/cards/onchain-plus/onchain-plus.component.html
+8
-3
onchain-plus.component.ts
...s/components/cards/onchain-plus/onchain-plus.component.ts
+9
-18
wire.component.html
...alytics/components/cards/onchain-wire/wire.component.html
+12
-6
wire.component.ts
...analytics/components/cards/onchain-wire/wire.component.ts
+10
-23
pageviews.component.html
...ytics/components/cards/pageviews/pageviews.component.html
+22
-0
pageviews.component.ts
...alytics/components/cards/pageviews/pageviews.component.ts
+39
-0
rewards.component.html
...analytics/components/cards/rewards/rewards.component.html
+21
-2
rewards.component.ts
...s/analytics/components/cards/rewards/rewards.component.ts
+40
-1
sales.component.html
...alytics/components/cards/token-sales/sales.component.html
+24
-8
sales.component.ts
...analytics/components/cards/token-sales/sales.component.ts
+16
-11
segments.component.html
...cs/components/cards/user-segments/segments.component.html
+23
-14
segments.component.ts
...tics/components/cards/user-segments/segments.component.ts
+3
-1
withdraw.component.html
...alytics/components/cards/withdraw/withdraw.component.html
+9
-3
withdraw.component.ts
...analytics/components/cards/withdraw/withdraw.component.ts
+8
-8
active-users.component.ts
.../components/charts/active-users/active-users.component.ts
+7
-3
channel-boosts.component.ts
...tics/components/charts/boosts/channel-boosts.component.ts
+8
-2
offchain-boosts.component.ts
...ics/components/charts/boosts/offchain-boosts.component.ts
+8
-2
onchain-boosts.component.ts
...tics/components/charts/boosts/onchain-boosts.component.ts
+8
-2
comments.component.ts
...nalytics/components/charts/comments/comments.component.ts
+9
-5
interactions.component.ts
.../components/charts/interactions/interactions.component.ts
+6
-2
pageviews.component.ts
...lytics/components/charts/pageviews/pageviews.component.ts
+101
-0
offchain-plus.component.ts
...alytics/components/charts/plus/offchain-plus.component.ts
+8
-3
onchain-plus.component.ts
...nalytics/components/charts/plus/onchain-plus.component.ts
+9
-3
posts.component.ts
...ules/analytics/components/charts/posts/posts.component.ts
+7
-2
reminds.component.ts
.../analytics/components/charts/reminds/reminds.component.ts
+7
-2
rewards.component.ts
.../analytics/components/charts/rewards/rewards.component.ts
+8
-2
sales.component.ts
...nalytics/components/charts/token-sales/sales.component.ts
+8
-2
segments.component.ts
...ics/components/charts/user-segments/segments.component.ts
+8
-2
votes.component.ts
...ules/analytics/components/charts/votes/votes.component.ts
+8
-2
offchain-wire.component.ts
...alytics/components/charts/wire/offchain-wire.component.ts
+8
-2
onchain-wire.component.ts
...nalytics/components/charts/wire/onchain-wire.component.ts
+8
-2
withdraw.component.ts
...nalytics/components/charts/withdraw/withdraw.component.ts
+8
-2
network-activity.component.ts
...ages/admin/network-activity/network-activity.component.ts
+1
-0
util.ts
src/app/modules/analytics/util.ts
+12
-0
No files found.
src/app/modules/analytics/analytics.module.ts
View file @
0248724e
...
...
@@ -47,6 +47,8 @@ import { RewardsChartComponent } from "./components/charts/rewards/rewards.compo
import
{
RewardsCardComponent
}
from
"
./components/cards/rewards/rewards.component
"
;
import
{
ActiveUsersChartComponent
}
from
"
./components/charts/active-users/active-users.component
"
;
import
{
Graph
}
from
"
./graph.component
"
;
import
{
PageviewsCardComponent
}
from
"
./components/cards/pageviews/pageviews.component
"
;
import
{
PageviewsChartComponent
}
from
"
./components/charts/pageviews/pageviews.component
"
;
PlotlyModule
.
plotlyjs
=
PlotlyJS
;
...
...
@@ -130,6 +132,8 @@ const routes: Routes = [
UserSegmentsChartComponent
,
UserSegmentsCardComponent
,
EngagementCardComponent
,
PageviewsChartComponent
,
PageviewsCardComponent
,
Graph
,
],
providers
:
[],
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/active-users/active-users.component.html
View file @
0248724e
...
...
@@ -6,36 +6,36 @@
<ng-container
*
ngIf=
"card.selectedOption=='hourly'"
>
<div
class=
"m-analytics__average"
>
<h6>
AVG H
AU (Unique)
</h6>
<h6>
AVG H
ourly Unique Visits
</h6>
<h5>
{{hauUnique | number : '1.0-0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
AVG H
AU (Logged In)
</h6>
<h6>
AVG H
ourly Active Users
</h6>
<h5>
{{hauLoggedIn | number : '1.0-0'}}
</h5>
</div>
</ng-container>
<ng-container
*
ngIf=
"card.selectedOption=='daily'"
>
<div
class=
"m-analytics__average"
>
<h6>
AVG D
AU (Unique)
</h6>
<h6>
AVG D
aily Unique Visits
</h6>
<h5>
{{dauUnique | number : '1.0-0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
AVG D
AU (Logged In)
</h6>
<h6>
AVG D
aily Active Users
</h6>
<h5>
{{dauLoggedIn | number : '1.0-0'}}
</h5>
</div>
</ng-container>
<ng-container
*
ngIf=
"card.selectedOption=='monthly'"
>
<div
class=
"m-analytics__average"
>
<h6>
AVG M
AU (Unique)
</h6>
<h6>
AVG M
onthly Unique Vists
</h6>
<h5>
{{mauUnique | number : '1.0-0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
AVG M
AU (Logged In)
</h6>
<h6>
AVG M
onthly Active Users
</h6>
<h5>
{{mauLoggedIn | number : '1.0-0'}}
</h5>
</div>
...
...
@@ -46,7 +46,14 @@
</ng-container>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currents"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__activeusers
[
timespan
]="
card
.
selectedOption
"
></m-analyticscharts
__activeusers
>
<m-analyticscharts
__activeusers
[
timespan
]="
card
.
selectedOption
"
(
loaded
)="
currents =
$event"
></m-analyticscharts
__activeusers
>
</div>
</m-analytics
__card
>
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/active-users/active-users.component.ts
View file @
0248724e
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
Component
,
OnInit
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
AnalyticsCardComponent
}
from
"
../card/card.component
"
;
import
{
Subscription
}
from
"
rxjs
"
;
@
Component
({
selector
:
'
m-analyticsactiveusers__card
'
,
...
...
@@ -7,6 +9,10 @@ import { Client } from "../../../../../services/api/client";
})
export
class
ActiveUsersCardComponent
implements
OnInit
{
@
ViewChild
(
'
card
'
,
{
static
:
true
})
card
:
AnalyticsCardComponent
;
subscription
:
Subscription
;
hauUnique
:
number
=
0
;
hauLoggedIn
:
number
=
0
;
mauUnique
:
number
=
0
;
...
...
@@ -14,37 +20,47 @@ export class ActiveUsersCardComponent implements OnInit {
dauUnique
:
number
=
0
;
dauLoggedIn
:
number
=
0
;
total
:
number
=
0
;
currents
:
{
name
:
string
,
value
:
number
}[];
constructor
(
private
client
:
Client
)
{
}
constructor
(
private
client
:
Client
)
{
}
ngOnInit
()
{
this
.
getAvgData
();
this
.
subscription
=
this
.
card
.
selectedOptionChange
.
subscribe
(()
=>
{
this
.
getAvgData
();
});
}
private
async
getAvgData
()
{
try
{
let
avgs
:
Array
<
any
>
=
await
Promise
.
all
([
this
.
client
.
get
(
'
api/v2/analytics/avgpageviews
'
,
{
key
:
'
mau_unique
'
}),
this
.
client
.
get
(
'
api/v2/analytics/avgpageviews
'
,
{
key
:
'
mau_loggedin
'
}),
this
.
client
.
get
(
'
api/v2/analytics/avgpageviews
'
,
{
key
:
'
dau_loggedin
'
}),
this
.
client
.
get
(
'
api/v2/analytics/avgpageviews
'
,
{
key
:
'
dau_unique
'
}),
this
.
client
.
get
(
'
api/v2/analytics/avgpageviews
'
,
{
key
:
'
hau_unique
'
}),
this
.
client
.
get
(
'
api/v2/analytics/avgpageviews
'
,
{
key
:
'
hau_loggedin
'
}),
this
.
client
.
get
(
'
api/v2/analytics/activeusers
'
,
{
key
:
'
avg
'
,
timespan
:
'
hourly
'
,
}),
this
.
client
.
get
(
'
api/v2/analytics/activeusers
'
,
{
key
:
'
avg
'
,
timespan
:
'
daily
'
,
}),
this
.
client
.
get
(
'
api/v2/analytics/activeusers
'
,
{
key
:
'
avg
'
,
timespan
:
'
monthly
'
,
}),
this
.
client
.
get
(
'
api/v2/analytics/avgpageviews
'
,
{
key
:
'
total_pageviews
'
})
]);
this
.
mauUnique
=
avgs
[
0
].
data
;
this
.
mauLoggedIn
=
avgs
[
1
].
data
;
this
.
dauLoggedIn
=
avgs
[
2
].
data
;
this
.
dauUnique
=
avgs
[
3
].
data
;
this
.
hauUnique
=
avgs
[
0
].
data
.
uniqueHAU
;
this
.
hauLoggedIn
=
avgs
[
0
].
data
.
loggedInHAU
;
this
.
hauUnique
=
avgs
[
4
].
data
;
this
.
dauUnique
=
avgs
[
1
].
data
.
uniqueDAU
;
this
.
dauLoggedIn
=
avgs
[
1
].
data
.
loggedInDAU
;
this
.
hauLoggedIn
=
avgs
[
5
].
data
;
this
.
mauUnique
=
avgs
[
2
].
data
.
uniqueMAU
;
this
.
mauLoggedIn
=
avgs
[
2
].
data
.
loggedInMAU
;
this
.
total
=
avgs
[
6
].
data
;
this
.
total
=
avgs
[
3
].
data
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/engagement/engagement.component.html
View file @
0248724e
...
...
@@ -3,8 +3,27 @@
[
options
]="['
hourly
',
'
daily
',
'
monthly
']"
#
posts
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Avg Posts
</h6>
<h5>
{{avgPosts | number : '1.0-0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg Posting Users
</h6>
<h5>
{{avgPostingUsers | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currentPosts"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__posts
[
timespan
]="
posts
.
selectedOption
"
></m-analyticscharts
__posts
>
<m-analyticscharts
__posts
[
timespan
]="
posts
.
selectedOption
"
(
loaded
)="
currentPosts =
$event"
></m-analyticscharts
__posts
>
</div>
</m-analytics
__card
>
...
...
@@ -13,8 +32,27 @@
[
options
]="['
hourly
',
'
daily
',
'
monthly
']"
#
comments
>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__comments
[
timespan
]="
comments
.
selectedOption
"
></m-analyticscharts
__comments
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Avg Comments
</h6>
<h5>
{{avgComments | number : '1.0-0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg Commenting Users
</h6>
<h5>
{{avgCommentingUsers | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currentComments"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__comments
[
timespan
]="
comments
.
selectedOption
"
(
loaded
)="
currentComments =
$event"
></m-analyticscharts
__comments
>
</div>
</m-analytics
__card
>
...
...
@@ -23,8 +61,27 @@
[
options
]="['
hourly
',
'
daily
',
'
monthly
']"
#
votes
>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__votes
[
timespan
]="
votes
.
selectedOption
"
></m-analyticscharts
__votes
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Avg Votes
</h6>
<h5>
{{avgVotes | number : '1.0-0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg Voting Users
</h6>
<h5>
{{avgVotingUsers | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currentVotes"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__votes
[
timespan
]="
votes
.
selectedOption
"
(
loaded
)="
currentVotes =
$event"
></m-analyticscharts
__votes
>
</div>
</m-analytics
__card
>
...
...
@@ -33,7 +90,26 @@
[
options
]="['
hourly
',
'
daily
',
'
monthly
']"
#
reminds
>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__reminds
[
timespan
]="
reminds
.
selectedOption
"
></m-analyticscharts
__reminds
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Avg Reminds
</h6>
<h5>
{{avgReminds | number : '1.0-0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg Reminding Users
</h6>
<h5>
{{avgRemindingUsers | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currentReminds"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__reminds
[
timespan
]="
reminds
.
selectedOption
"
(
loaded
)="
currentReminds =
$event"
></m-analyticscharts
__reminds
>
</div>
</m-analytics
__card
>
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/engagement/engagement.component.ts
View file @
0248724e
import
{
Component
,
OnInit
}
from
'
@angular/core
'
;
import
{
Component
,
OnInit
,
ViewChild
}
from
'
@angular/core
'
;
import
{
AnalyticsCardComponent
}
from
"
../card/card.component
"
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
@
Component
({
selector
:
'
m-analyticsengagement__card
'
,
...
...
@@ -6,9 +8,104 @@ import { Component, OnInit } from '@angular/core';
})
export
class
EngagementCardComponent
implements
OnInit
{
constructor
()
{
@
ViewChild
(
'
posts
'
,
{
static
:
true
})
posts
:
AnalyticsCardComponent
;
@
ViewChild
(
'
comments
'
,
{
static
:
true
})
comments
:
AnalyticsCardComponent
;
@
ViewChild
(
'
votes
'
,
{
static
:
true
})
votes
:
AnalyticsCardComponent
;
@
ViewChild
(
'
reminds
'
,
{
static
:
true
})
reminds
:
AnalyticsCardComponent
;
avgPosts
:
number
=
0
;
avgPostingUsers
:
number
=
0
;
currentPosts
:
{
name
:
string
,
value
:
number
}[];
avgComments
:
number
=
0
;
avgCommentingUsers
:
number
=
0
;
currentComments
:
{
name
:
string
,
value
:
number
}[];
avgVotes
:
number
=
0
;
avgVotingUsers
:
number
=
0
;
currentVotes
:
{
name
:
string
,
value
:
number
}[];
avgReminds
:
number
=
0
;
avgRemindingUsers
:
number
=
0
;
currentReminds
:
{
name
:
string
,
value
:
number
}[];
constructor
(
private
client
:
Client
)
{
}
ngOnInit
()
{
this
.
getAvgPosts
();
this
.
getAvgComments
();
this
.
getAvgVotes
();
this
.
getAvgReminds
();
this
.
posts
.
selectedOptionChange
.
subscribe
(()
=>
{
this
.
getAvgPosts
();
});
this
.
comments
.
selectedOptionChange
.
subscribe
(()
=>
{
this
.
getAvgComments
();
});
this
.
votes
.
selectedOptionChange
.
subscribe
(()
=>
{
this
.
getAvgVotes
();
});
this
.
reminds
.
selectedOptionChange
.
subscribe
(()
=>
{
this
.
getAvgReminds
();
});
}
private
async
getAvgPosts
()
{
try
{
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/posts
'
,
{
key
:
'
avg
'
,
timespan
:
this
.
posts
.
selectedOption
,
});
this
.
avgPosts
=
response
.
data
.
posts
;
this
.
avgPostingUsers
=
response
.
data
.
postingUsers
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
}
private
async
getAvgComments
()
{
try
{
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/comments
'
,
{
key
:
'
avg
'
,
timespan
:
this
.
comments
.
selectedOption
,
});
this
.
avgComments
=
response
.
data
.
comments
;
this
.
avgCommentingUsers
=
response
.
data
.
commentingUsers
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
}
private
async
getAvgVotes
()
{
try
{
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/votes
'
,
{
key
:
'
avg
'
,
timespan
:
this
.
votes
.
selectedOption
,
});
this
.
avgVotes
=
response
.
data
.
votes
;
this
.
avgVotingUsers
=
response
.
data
.
votingUsers
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
}
private
async
getAvgReminds
()
{
try
{
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/reminds
'
,
{
key
:
'
avg
'
,
timespan
:
this
.
reminds
.
selectedOption
,
});
this
.
avgReminds
=
response
.
data
.
reminds
;
this
.
avgRemindingUsers
=
response
.
data
.
remindingUsers
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
}
}
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/offchain-boosts/boosts.component.html
View file @
0248724e
...
...
@@ -3,8 +3,27 @@
[
options
]="['
daily
',
'
monthly
']"
#
completed
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Avg Newsfeed
</h6>
<h5>
{{avgNewsfeedCompleted | number : '1.0-0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg Content
</h6>
<h5>
{{avgContentCompleted | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currentCompleted"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__offchainboosts
[
analytics
]="'
completed
'"
[
timespan
]="
completed
.
selectedOption
"
></m-analyticscharts
__offchainboosts
>
<m-analyticscharts
__offchainboosts
[
analytics
]="'
completed
'"
[
timespan
]="
completed
.
selectedOption
"
(
loaded
)="
currentCompleted =
$event"
></m-analyticscharts
__offchainboosts
>
</div>
</m-analytics
__card
>
...
...
@@ -13,8 +32,27 @@
[
options
]="['
daily
',
'
monthly
']"
#
notcompleted
>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__offchainboosts
[
analytics
]="'
not_completed
'"
[
timespan
]="
notcompleted
.
selectedOption
"
></m-analyticscharts
__offchainboosts
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Avg Newsfeed
</h6>
<h5>
{{avgNewsfeedNotCompleted | number : '1.0-0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg Content
</h6>
<h5>
{{avgContentNotCompleted | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currentNotCompleted"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__offchainboosts
[
analytics
]="'
not_completed
'"
[
timespan
]="
notcompleted
.
selectedOption
"
(
loaded
)="
currentNotCompleted =
$event"
></m-analyticscharts
__offchainboosts
>
</div>
</m-analytics
__card
>
...
...
@@ -23,8 +61,27 @@
[
options
]="['
daily
',
'
monthly
']"
#
revoked
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Avg Newsfeed
</h6>
<h5>
{{avgNewsfeedRevoked | number : '1.0-0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg Content
</h6>
<h5>
{{avgContentRevoked | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currentRevoked"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__offchainboosts
[
analytics
]="'
revoked
'"
[
timespan
]="
revoked
.
selectedOption
"
></m-analyticscharts
__offchainboosts
>
<m-analyticscharts
__offchainboosts
[
analytics
]="'
revoked
'"
[
timespan
]="
revoked
.
selectedOption
"
(
loaded
)="
currentRevoked =
$event"
></m-analyticscharts
__offchainboosts
>
</div>
</m-analytics
__card
>
...
...
@@ -33,8 +90,27 @@
[
options
]="['
daily
',
'
monthly
']"
#
rejected
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Avg Newsfeed
</h6>
<h5>
{{avgNewsfeedRejected | number : '1.0-0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg Content
</h6>
<h5>
{{avgContentRejected | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currentRejected"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__offchainboosts
[
analytics
]="'
rejected
'"
[
timespan
]="
rejected
.
selectedOption
"
></m-analyticscharts
__offchainboosts
>
<m-analyticscharts
__offchainboosts
[
analytics
]="'
rejected
'"
[
timespan
]="
rejected
.
selectedOption
"
(
loaded
)="
currentRejected =
$event"
></m-analyticscharts
__offchainboosts
>
</div>
</m-analytics
__card
>
...
...
@@ -42,19 +118,58 @@
[
title
]="'
Offchain
Boosts:
Users
(
Completed
)'"
[
options
]="['
daily
',
'
monthly
']"
#
userscompleted
>
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Avg Newsfeed
</h6>
<h5>
{{avgNewsfeedUsersCompleted | number : '1.0-0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg Content
</h6>
<h5>
{{avgContentUsersCompleted | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currentUsersCompleted"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__offchainboosts
[
analytics
]="'
users_who_completed
'"
[
timespan
]="
userscompleted
.
selectedOption
"
></m-analyticscharts
__offchainboosts
>
<m-analyticscharts
__offchainboosts
[
analytics
]="'
users_who_completed
'"
[
timespan
]="
userscompleted
.
selectedOption
"
(
loaded
)="
currentUsersCompleted =
$event"
></m-analyticscharts
__offchainboosts
>
</div>
</m-analytics
__card
>
<m-analytics
__card
[
title
]="'
Offchain
Boosts:
Users
(
Pending
)'"
[
options
]="['
daily
',
'
monthly
']"
[
options
]="['
daily
']"
[
defaultOption
]="'
daily
'"
#
userspending
>
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Avg Newsfeed
</h6>
<h5>
{{avgNewsfeedUsersAwaitingCompletion | number : '1.0-0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg Content
</h6>
<h5>
{{avgContentUsersAwaitingCompletion | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currentUsersAwaitingCompletion"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__offchainboosts
[
analytics
]="'
users_waiting_for_completion
'"
[
timespan
]="
userspending
.
selectedOption
"
></m-analyticscharts
__offchainboosts
>
<m-analyticscharts
__offchainboosts
[
analytics
]="'
users_waiting_for_completion
'"
[
timespan
]="
userspending
.
selectedOption
"
(
loaded
)="
currentUsersAwaitingCompletion =
$event"
></m-analyticscharts
__offchainboosts
>
</div>
</m-analytics
__card
>
...
...
@@ -62,9 +177,28 @@
[
title
]="'
Offchain
Boosts:
Reclaimed
Tokens
'"
[
options
]="['
daily
',
'
monthly
']"
#
reclaimedtokens
>
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Avg Newsfeed
</h6>
<h5>
{{avgNewsfeedReclaimed | number : '1.0-0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg Content
</h6>
<h5>
{{avgContentReclaimed | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currentReclaimed"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__offchainboosts
[
analytics
]="'
reclaimed_tokens
'"
[
timespan
]="
reclaimedtokens
.
selectedOption
"
></m-analyticscharts
__offchainboosts
>
<m-analyticscharts
__offchainboosts
[
analytics
]="'
reclaimed_tokens
'"
[
timespan
]="
reclaimedtokens
.
selectedOption
"
(
loaded
)="
currentReclaimed =
$event"
></m-analyticscharts
__offchainboosts
>
</div>
</m-analytics
__card
>
...
...
@@ -72,8 +206,26 @@
[
title
]="'
Offchain
Boosts:
Impressions
Served
'"
[
options
]="['
daily
',
'
monthly
']"
#
impressions
>
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Avg Newsfeed
</h6>
<h5>
{{avgNewsfeedImpressions | number : '1.0-0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg Content
</h6>
<h5>
{{avgContentImpressions | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currentImpressions"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__offchainboosts
[
analytics
]="'
impressions_served
'"
[
timespan
]="
impressions
.
selectedOption
"
></m-analyticscharts
__offchainboosts
>
<m-analyticscharts
__offchainboosts
[
analytics
]="'
impressions_served
'"
[
timespan
]="
impressions
.
selectedOption
"
(
loaded
)="
currentImpressions =
$event"
></m-analyticscharts
__offchainboosts
>
</div>
</m-analytics
__card
>
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/offchain-boosts/boosts.component.ts
View file @
0248724e
import
{
Component
}
from
'
@angular/core
'
;
import
{
Component
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
AnalyticsCardComponent
}
from
"
../card/card.component
"
;
@
Component
({
selector
:
'
m-analyticsoffchainboosts__card
'
,
...
...
@@ -6,5 +8,203 @@ import { Component } from '@angular/core';
})
export
class
OffChainBoostsCardComponent
{
@
ViewChild
(
'
completed
'
,
{
static
:
true
})
completed
:
AnalyticsCardComponent
;
@
ViewChild
(
'
notcompleted
'
,
{
static
:
true
})
notcompleted
:
AnalyticsCardComponent
;
@
ViewChild
(
'
revoked
'
,
{
static
:
true
})
revoked
:
AnalyticsCardComponent
;
@
ViewChild
(
'
rejected
'
,
{
static
:
true
})
rejected
:
AnalyticsCardComponent
;
@
ViewChild
(
'
userscompleted
'
,
{
static
:
true
})
userscompleted
:
AnalyticsCardComponent
;
@
ViewChild
(
'
userspending
'
,
{
static
:
true
})
userspending
:
AnalyticsCardComponent
;
@
ViewChild
(
'
reclaimedtokens
'
,
{
static
:
true
})
reclaimedtokens
:
AnalyticsCardComponent
;
@
ViewChild
(
'
impressions
'
,
{
static
:
true
})
impressions
:
AnalyticsCardComponent
;
avgNewsfeedCompleted
:
number
=
0
;
avgContentCompleted
:
number
=
0
;
avgNewsfeedNotCompleted
:
number
=
0
;
avgContentNotCompleted
:
number
=
0
;
avgNewsfeedRevoked
:
number
=
0
;
avgContentRevoked
:
number
=
0
;
avgNewsfeedRejected
:
number
=
0
;
avgContentRejected
:
number
=
0
;
avgNewsfeedUsersCompleted
:
number
=
0
;
avgContentUsersCompleted
:
number
=
0
;
avgNewsfeedUsersAwaitingCompletion
:
number
=
0
;
avgContentUsersAwaitingCompletion
:
number
=
0
;
avgNewsfeedReclaimed
:
number
=
0
;
avgContentReclaimed
:
number
=
0
;
avgNewsfeedImpressions
:
number
=
0
;
avgContentImpressions
:
number
=
0
;
currentCompleted
:
{
name
:
string
,
value
:
number
}[];
currentNotCompleted
:
{
name
:
string
,
value
:
number
}[];
currentRevoked
:
{
name
:
string
,
value
:
number
}[];
currentRejected
:
{
name
:
string
,
value
:
number
}[];
currentUsersCompleted
:
{
name
:
string
,
value
:
number
}[];
currentUsersAwaitingCompletion
:
{
name
:
string
,
value
:
number
}[];
currentReclaimed
:
{
name
:
string
,
value
:
number
}[];
currentImpressions
:
{
name
:
string
,
value
:
number
}[];
constructor
(
private
client
:
Client
)
{
}
ngOnInit
()
{
this
.
getAvgCompleted
();
this
.
getAvgNotCompleted
();
this
.
getAvgRevoked
();
this
.
getAvgRejected
();
this
.
getAvgUsersCompleted
();
this
.
getAvgUsersAwaitingCompletion
();
this
.
getAvgReclaimed
();
this
.
getAvgImpressions
();
this
.
completed
.
selectedOptionChange
.
subscribe
(()
=>
{
this
.
getAvgCompleted
();
});
this
.
notcompleted
.
selectedOptionChange
.
subscribe
(()
=>
{
this
.
getAvgNotCompleted
();
});
this
.
revoked
.
selectedOptionChange
.
subscribe
(()
=>
{
this
.
getAvgRevoked
();
});
this
.
rejected
.
selectedOptionChange
.
subscribe
(()
=>
{
this
.
getAvgRejected
();
});
this
.
userscompleted
.
selectedOptionChange
.
subscribe
(()
=>
{
this
.
getAvgUsersCompleted
();
});
this
.
userspending
.
selectedOptionChange
.
subscribe
(()
=>
{
this
.
getAvgUsersAwaitingCompletion
();
});
this
.
reclaimedtokens
.
selectedOptionChange
.
subscribe
(()
=>
{
this
.
getAvgReclaimed
();
});
this
.
impressions
.
selectedOptionChange
.
subscribe
(()
=>
{
this
.
getAvgImpressions
();
});
}
private
async
getAvgCompleted
()
{
try
{
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/offchainboosts
'
,
{
key
:
'
completed_avg
'
,
timespan
:
this
.
completed
.
selectedOption
,
});
this
.
avgNewsfeedCompleted
=
response
.
data
.
newsfeed
;
this
.
avgContentCompleted
=
response
.
data
.
content
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
}
private
async
getAvgNotCompleted
()
{
try
{
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/offchainboosts
'
,
{
key
:
'
not_completed_avg
'
,
timespan
:
this
.
notcompleted
.
selectedOption
,
});
this
.
avgNewsfeedNotCompleted
=
response
.
data
.
newsfeed
;
this
.
avgContentNotCompleted
=
response
.
data
.
content
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
}
private
async
getAvgRevoked
()
{
try
{
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/offchainboosts
'
,
{
key
:
'
revoked_avg
'
,
timespan
:
this
.
revoked
.
selectedOption
,
});
this
.
avgNewsfeedRevoked
=
response
.
data
.
newsfeed
;
this
.
avgContentRevoked
=
response
.
data
.
content
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
}
private
async
getAvgRejected
()
{
try
{
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/offchainboosts
'
,
{
key
:
'
rejected_avg
'
,
timespan
:
this
.
rejected
.
selectedOption
,
});
this
.
avgNewsfeedRejected
=
response
.
data
.
newsfeed
;
this
.
avgContentRejected
=
response
.
data
.
content
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
}
private
async
getAvgUsersCompleted
()
{
try
{
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/offchainboosts
'
,
{
key
:
'
users_who_completed_avg
'
,
timespan
:
this
.
userscompleted
.
selectedOption
,
});
this
.
avgNewsfeedUsersCompleted
=
response
.
data
.
newsfeed
;
this
.
avgContentUsersCompleted
=
response
.
data
.
content
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
}
private
async
getAvgUsersAwaitingCompletion
()
{
try
{
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/offchainboosts
'
,
{
key
:
'
users_waiting_for_completion_avg
'
,
timespan
:
this
.
userspending
.
selectedOption
,
});
this
.
avgNewsfeedUsersAwaitingCompletion
=
response
.
data
.
newsfeed
;
this
.
avgContentUsersAwaitingCompletion
=
response
.
data
.
content
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
}
private
async
getAvgReclaimed
()
{
try
{
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/offchainboosts
'
,
{
key
:
'
reclaimed_tokens_avg
'
,
timespan
:
this
.
reclaimedtokens
.
selectedOption
,
});
this
.
avgNewsfeedReclaimed
=
response
.
data
.
newsfeed
;
this
.
avgContentReclaimed
=
response
.
data
.
content
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
}
private
async
getAvgImpressions
()
{
try
{
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/offchainboosts
'
,
{
key
:
'
impressions_served_avg
'
,
timespan
:
this
.
impressions
.
selectedOption
,
});
this
.
avgNewsfeedImpressions
=
response
.
data
.
newsfeed
;
this
.
avgContentImpressions
=
response
.
data
.
content
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
}
}
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/offchain-plus/offchain-plus.component.html
View file @
0248724e
...
...
@@ -4,24 +4,28 @@
#
card
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Overall Avg Reclaimed Tokens
</h6>
<h5>
{{reclaimedTokens | number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg
Number of
Plus Users
</h6>
<h6>
Avg Plus Users
</h6>
<h5>
{{users | number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg Plus Transactions
</h6>
<h5>
{{transactions | number : '1.0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currents"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__offchainplus
[
timespan
]="
card
.
selectedOption
"
></m-analyticscharts
__offchainplus
>
<m-analyticscharts
__offchainplus
[
timespan
]="
card
.
selectedOption
"
(
loaded
)="
currents =
$event"
></m-analyticscharts
__offchainplus
>
</div>
</m-analytics
__card
>
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/offchain-plus/offchain-plus.component.ts
View file @
0248724e
...
...
@@ -13,6 +13,7 @@ export class OffChainPlusCardComponent {
reclaimedTokens
:
number
=
0
;
users
:
number
=
0
;
transactions
:
number
=
0
;
currents
:
{
name
:
string
,
value
:
number
}[];
constructor
(
private
client
:
Client
)
{
}
...
...
@@ -23,24 +24,14 @@ export class OffChainPlusCardComponent {
private
async
getAvgData
()
{
try
{
let
avgs
:
Array
<
any
>
=
await
Promise
.
all
([
this
.
client
.
get
(
'
api/v2/analytics/offchainplus
'
,
{
key
:
'
average_reclaimed_tokens
'
,
timespan
:
this
.
card
.
selectedOption
}),
this
.
client
.
get
(
'
api/v2/analytics/offchainplus
'
,
{
key
:
'
average_plus_users
'
,
timespan
:
this
.
card
.
selectedOption
}),
this
.
client
.
get
(
'
api/v2/analytics/offchainplus
'
,
{
key
:
'
average_plus_tx
'
,
timespan
:
this
.
card
.
selectedOption
}),
]);
this
.
reclaimedTokens
=
avgs
[
0
].
data
;
this
.
users
=
avgs
[
1
].
data
;
this
.
transactions
=
avgs
[
2
].
data
;
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/offchainplus
'
,
{
key
:
'
avg
'
,
timespan
:
this
.
card
.
selectedOption
});
this
.
reclaimedTokens
=
response
.
data
.
tokens
;
this
.
users
=
response
.
data
.
users
;
this
.
transactions
=
response
.
data
.
transactions
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/offchain-wire/wire.component.html
View file @
0248724e
...
...
@@ -3,29 +3,34 @@
[
options
]="['
daily
',
'
monthly
']"
#
card
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Avg Wired Tokens
</h6>
<h5>
{{tokens | number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg
Number of
Transactions
</h6>
<h6>
Avg Transactions
</h6>
<h5>
{{transactions | number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg
Number of
Wire Receivers
</h6>
<h6>
Avg Wire Receivers
</h6>
<h5>
{{receivers | number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg
Number of
Wire Senders
</h6>
<h6>
Avg Wire Senders
</h6>
<h5>
{{senders | number : '1.0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currents"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__offchainwire
[
timespan
]="
card
.
selectedOption
"
></m-analyticscharts
__offchainwire
>
<m-analyticscharts
__offchainwire
[
timespan
]="
card
.
selectedOption
"
(
loaded
)="
currents =
$event"
></m-analyticscharts
__offchainwire
>
</div>
</m-analytics
__card
>
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/offchain-wire/wire.component.ts
View file @
0248724e
...
...
@@ -17,6 +17,7 @@ export class OffchainWireCardComponent implements OnInit {
transactions
:
number
=
0
;
receivers
:
number
=
0
;
senders
:
number
=
0
;
currents
:
{
name
:
string
,
value
:
number
}[];
constructor
(
private
client
:
Client
)
{
}
...
...
@@ -35,29 +36,15 @@ export class OffchainWireCardComponent implements OnInit {
private
async
getAvgData
()
{
try
{
let
avgs
:
Array
<
any
>
=
await
Promise
.
all
([
this
.
client
.
get
(
'
api/v2/analytics/offchainwire
'
,
{
key
:
'
average_tokens
'
,
timespan
:
this
.
card
.
selectedOption
}),
this
.
client
.
get
(
'
api/v2/analytics/offchainwire
'
,
{
key
:
'
average
'
,
timespan
:
this
.
card
.
selectedOption
}),
this
.
client
.
get
(
'
api/v2/analytics/offchainwire
'
,
{
key
:
'
average_receivers
'
,
timespan
:
this
.
card
.
selectedOption
}),
this
.
client
.
get
(
'
api/v2/analytics/offchainwire
'
,
{
key
:
'
average_senders
'
,
timespan
:
this
.
card
.
selectedOption
}),
]);
this
.
tokens
=
avgs
[
0
].
data
;
this
.
transactions
=
avgs
[
1
].
data
;
this
.
receivers
=
avgs
[
2
].
data
;
this
.
senders
=
avgs
[
3
].
data
;
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/offchainwire
'
,
{
key
:
'
avg
'
,
timespan
:
this
.
card
.
selectedOption
});
this
.
tokens
=
response
.
data
.
tokens
;
this
.
transactions
=
response
.
data
.
transactions
;
this
.
receivers
=
response
.
data
.
receivers
;
this
.
senders
=
response
.
data
.
senders
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/onchain-boosts/boosts.component.html
View file @
0248724e
...
...
@@ -4,23 +4,30 @@
#
card
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
A
VG
Boosts
</h6>
<h6>
A
vg
Boosts
</h6>
<h5>
{{average | number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
A
VG Reclaimed Tokens Boost
s
</h6>
<h6>
A
vg Reclaimed Token
s
</h6>
<h5>
{{averageReclaimedTokens | number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
A
VG
Users that Used Boosts
</h6>
<h6>
A
vg
Users that Used Boosts
</h6>
<h5>
{{averageUsers | number : '1.0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currents"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__onchainboosts
[
timespan
]="
card
.
selectedOption
"
></m-analyticscharts
__onchainboosts
>
<m-analyticscharts
__onchainboosts
[
timespan
]="
card
.
selectedOption
"
(
loaded
)="
currents =
$event"
></m-analyticscharts
__onchainboosts
>
</div>
</m-analytics
__card
>
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/onchain-boosts/boosts.component.ts
View file @
0248724e
...
...
@@ -18,6 +18,7 @@ export class OnChainBoostsCardComponent {
average
:
number
=
0
;
averageReclaimedTokens
:
number
=
0
;
averageUsers
:
number
=
0
;
currents
:
{
name
:
string
,
value
:
number
}[];
constructor
(
private
client
:
Client
)
{
}
...
...
@@ -37,17 +38,16 @@ export class OnChainBoostsCardComponent {
private
async
getAvgData
()
{
try
{
let
avgs
:
Array
<
any
>
=
await
Promise
.
all
([
this
.
client
.
get
(
'
api/v2/analytics/onchainboosts
'
,
{
key
:
'
average
'
,
timespan
:
this
.
timespan
}),
this
.
client
.
get
(
'
api/v2/analytics/onchainboosts
'
,
{
key
:
'
average_reclaimed_tokens
'
,
timespan
:
this
.
timespan
}),
this
.
client
.
get
(
'
api/v2/analytics/onchainboosts
'
,
{
key
:
'
average_users
'
,
timespan
:
this
.
timespan
}),
]);
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/onchainboosts
'
,
{
key
:
'
avg
'
,
timespan
:
this
.
timespan
});
this
.
average
=
avgs
[
0
].
data
;
this
.
average
=
response
.
data
.
transactions
;
this
.
averageReclaimedTokens
=
avgs
[
1
].
data
;
this
.
averageReclaimedTokens
=
response
.
data
.
reclaimedTokens
;
this
.
averageUsers
=
avgs
[
2
].
data
;
this
.
averageUsers
=
response
.
data
.
users
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/onchain-plus/onchain-plus.component.html
View file @
0248724e
...
...
@@ -4,24 +4,29 @@
#
card
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Overall Avg Reclaimed Tokens
</h6>
<h5>
{{reclaimedTokens | number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg
Number of
Plus Users
</h6>
<h6>
Avg Plus Users
</h6>
<h5>
{{users | number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg Plus Transactions
</h6>
<h5>
{{transactions | number : '1.0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currents"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__onchainplus
[
timespan
]="
card
.
selectedOption
"
></m-analyticscharts
__onchainplus
>
<m-analyticscharts
__onchainplus
[
timespan
]="
card
.
selectedOption
"
(
loaded
)="
currents =
$event"
></m-analyticscharts
__onchainplus
>
</div>
</m-analytics
__card
>
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/onchain-plus/onchain-plus.component.ts
View file @
0248724e
...
...
@@ -13,6 +13,7 @@ export class OnChainPlusCardComponent {
reclaimedTokens
:
number
=
0
;
users
:
number
=
0
;
transactions
:
number
=
0
;
currents
:
{
name
:
string
,
value
:
number
}[];
constructor
(
private
client
:
Client
)
{
}
...
...
@@ -23,24 +24,14 @@ export class OnChainPlusCardComponent {
private
async
getAvgData
()
{
try
{
let
avgs
:
Array
<
any
>
=
await
Promise
.
all
([
this
.
client
.
get
(
'
api/v2/analytics/onchainplus
'
,
{
key
:
'
average_reclaimed_tokens
'
,
timespan
:
this
.
card
.
selectedOption
}),
this
.
client
.
get
(
'
api/v2/analytics/onchainplus
'
,
{
key
:
'
average_plus_users
'
,
timespan
:
this
.
card
.
selectedOption
}),
this
.
client
.
get
(
'
api/v2/analytics/onchainplus
'
,
{
key
:
'
average_plus_tx
'
,
timespan
:
this
.
card
.
selectedOption
}),
]);
this
.
reclaimedTokens
=
avgs
[
0
].
data
;
this
.
users
=
avgs
[
1
].
data
;
this
.
transactions
=
avgs
[
2
].
data
;
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/onchainplus
'
,
{
key
:
'
avg
'
,
timespan
:
this
.
card
.
selectedOption
});
this
.
reclaimedTokens
=
response
.
data
.
tokens
;
this
.
users
=
response
.
data
.
users
;
this
.
transactions
=
response
.
data
.
transactions
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/onchain-wire/wire.component.html
View file @
0248724e
<m-analytics
__card
[
title
]="'
OnChain
Wire
'"
[
options
]="['
daily
',
'
monthly
']"
#
card
>
#
card
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Avg Wired Tokens
</h6>
<h5>
{{tokens | number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg
Number of
Transactions
</h6>
<h6>
Avg Transactions
</h6>
<h5>
{{transactions | number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg
Number of
Wire Receivers
</h6>
<h6>
Avg Wire Receivers
</h6>
<h5>
{{receivers | number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg
Number of
Wire Senders
</h6>
<h6>
Avg Wire Senders
</h6>
<h5>
{{senders | number : '1.0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currents"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__onchainwire
[
timespan
]="
card
.
selectedOption
"
></m-analyticscharts
__onchainwire
>
<m-analyticscharts
__onchainwire
[
timespan
]="
card
.
selectedOption
"
(
loaded
)="
currents =
$event"
></m-analyticscharts
__onchainwire
>
</div>
</m-analytics
__card
>
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/onchain-wire/wire.component.ts
View file @
0248724e
...
...
@@ -17,6 +17,7 @@ export class OnchainWireCardComponent implements OnInit {
transactions
:
number
=
0
;
receivers
:
number
=
0
;
senders
:
number
=
0
;
currents
:
{
name
:
string
,
value
:
number
}[];
constructor
(
private
client
:
Client
)
{
}
...
...
@@ -35,29 +36,15 @@ export class OnchainWireCardComponent implements OnInit {
private
async
getAvgData
()
{
try
{
let
avgs
:
Array
<
any
>
=
await
Promise
.
all
([
this
.
client
.
get
(
'
api/v2/analytics/onchainwire
'
,
{
key
:
'
average_tokens
'
,
timespan
:
this
.
card
.
selectedOption
}),
this
.
client
.
get
(
'
api/v2/analytics/onchainwire
'
,
{
key
:
'
average
'
,
timespan
:
this
.
card
.
selectedOption
}),
this
.
client
.
get
(
'
api/v2/analytics/onchainwire
'
,
{
key
:
'
average_receivers
'
,
timespan
:
this
.
card
.
selectedOption
}),
this
.
client
.
get
(
'
api/v2/analytics/onchainwire
'
,
{
key
:
'
average_senders
'
,
timespan
:
this
.
card
.
selectedOption
}),
]);
this
.
tokens
=
avgs
[
0
].
data
;
this
.
transactions
=
avgs
[
1
].
data
;
this
.
receivers
=
avgs
[
2
].
data
;
this
.
senders
=
avgs
[
3
].
data
;
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/onchainwire
'
,
{
key
:
'
avg
'
,
timespan
:
this
.
card
.
selectedOption
});
this
.
tokens
=
response
.
data
.
tokens
;
this
.
transactions
=
response
.
data
.
transactions
;
this
.
receivers
=
response
.
data
.
receivers
;
this
.
senders
=
response
.
data
.
senders
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/pageviews/pageviews.component.html
0 → 100644
View file @
0248724e
<m-analytics
__card
[
title
]="'
Pageviews
'"
[
options
]="['
daily
',
'
monthly
']"
#
card
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currents"
>
<h6>
Avg Pageviews
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currents"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__pageviews
[
timespan
]="
card
.
selectedOption
"
(
loaded
)="
currents =
$event"
></m-analyticscharts
__pageviews
>
<m-analyticscharts
__pageviews
[
timespan
]="
card
.
selectedOption
"
[
pie
]="
true
"
></m-analyticscharts
__pageviews
>
</div>
</m-analytics
__card
>
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/pageviews/pageviews.component.ts
0 → 100644
View file @
0248724e
import
{
Component
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
AnalyticsCardComponent
}
from
"
../card/card.component
"
;
@
Component
({
selector
:
'
m-analyticspageviews__card
'
,
templateUrl
:
'
pageviews.component.html
'
})
export
class
PageviewsCardComponent
{
@
ViewChild
(
'
card
'
,
{
static
:
true
})
card
:
AnalyticsCardComponent
;
currents
:
{
name
:
string
,
value
:
number
}[];
avgPageviews
:
number
=
0
;
constructor
(
private
client
:
Client
)
{
}
ngOnInit
()
{
this
.
getAvgData
();
this
.
card
.
selectedOptionChange
.
subscribe
(()
=>
{
this
.
getAvgData
();
});
}
private
async
getAvgData
()
{
try
{
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/pageviews
'
,
{
key
:
'
avg
'
,
timespan
:
this
.
card
.
selectedOption
,
});
this
.
avgPageviews
=
response
.
data
.
pageviews
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
}
}
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/rewards/rewards.component.html
View file @
0248724e
<m-analytics
__card
[
title
]="'
Rewards
'"
[
options
]="['
daily
',
'
monthly
']"
#
card
>
#
card
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Avg Transactions
</h6>
<h5>
{{avgTransactions | number : '1.0-0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg Rewarded Tokens
</h6>
<h5>
{{avgRewardedTokens | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currents"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__rewards
[
timespan
]="
card
.
selectedOption
"
></m-analyticscharts
__rewards
>
<m-analyticscharts
__rewards
[
timespan
]="
card
.
selectedOption
"
(
loaded
)="
currents =
$event"
></m-analyticscharts
__rewards
>
</div>
</m-analytics
__card
>
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/rewards/rewards.component.ts
View file @
0248724e
import
{
Component
}
from
'
@angular/core
'
;
import
{
Component
,
ViewChild
}
from
'
@angular/core
'
;
import
{
AnalyticsCardComponent
}
from
"
../card/card.component
"
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
Subscription
}
from
"
rxjs
"
;
@
Component
({
selector
:
'
m-analyticsrewards__card
'
,
...
...
@@ -6,5 +9,41 @@ import { Component } from '@angular/core';
})
export
class
RewardsCardComponent
{
@
ViewChild
(
'
card
'
,
{
static
:
true
})
card
:
AnalyticsCardComponent
;
subscription
:
Subscription
;
avgTransactions
:
number
=
0
;
avgRewardedTokens
:
number
=
0
;
currents
:
{
name
:
string
,
value
:
number
}[];
constructor
(
private
client
:
Client
)
{
}
ngOnInit
()
{
this
.
getAvgData
();
this
.
subscription
=
this
.
card
.
selectedOptionChange
.
subscribe
(()
=>
{
this
.
getAvgData
();
});
}
ngOnDestroy
()
{
this
.
subscription
.
unsubscribe
();
}
private
async
getAvgData
()
{
try
{
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/rewards
'
,
{
key
:
'
avg
'
,
timespan
:
this
.
card
.
selectedOption
});
this
.
avgTransactions
=
response
.
data
.
tokens
;
this
.
avgRewardedTokens
=
response
.
data
.
transactions
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
}
}
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/token-sales/sales.component.html
View file @
0248724e
<m-analytics
__card
[
title
]="'
Token
Sales
'"
[
options
]="['
daily
',
'
monthly
']"
#
card
>
#
card
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Avg Sold Tokens
</h6>
<h5>
{{tokens | number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg
Number of
Sales Tx
</h6>
<h6>
Avg Sales Tx
</h6>
<h5>
{{sales | number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg
Number of
Token Buyers
</h6>
<h6>
Avg Token Buyers
</h6>
<h5>
{{buyers | number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg Eth
Earned
</h6>
<h5>
{{eth
Earned
| number : '1.0'}}
</h5>
<h6>
Avg Eth
Value
</h6>
<h5>
{{eth
Value
| number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Avg Eth/Usd Rate
</h6>
<h5>
{{ethUsdRate | number : '1.0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currentSales"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__tokensales
[
analytics
]="'
sales
'"
[
timespan
]="
card
.
selectedOption
"
(
loaded
)="
currentSales =
$event"
></m-analyticscharts
__tokensales
>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currentRates"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__tokensales
[
analytics
]="'
sales
'"
[
timespan
]="
card
.
selectedOption
"
></m-analyticscharts
__tokensales
>
<m-analyticscharts
__tokensales
[
analytics
]="'
rates
'"
[
timespan
]="
card
.
selectedOption
"
></m-analyticscharts
__tokensales
>
<m-analyticscharts
__tokensales
[
analytics
]="'
rates
'"
[
timespan
]="
card
.
selectedOption
"
(
loaded
)="
currentRates =
$event"
></m-analyticscharts
__tokensales
>
</div>
</m-analytics
__card
>
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/token-sales/sales.component.ts
View file @
0248724e
...
...
@@ -16,8 +16,10 @@ export class TokenSalesCardComponent implements OnInit {
tokens
:
number
=
0
;
sales
:
number
=
0
;
buyers
:
number
=
0
;
eth
Earned
:
number
=
0
;
eth
Value
:
number
=
0
;
ethUsdRate
:
number
=
0
;
currentSales
:
{
name
:
string
,
value
:
number
}[];
currentRates
:
{
name
:
string
,
value
:
number
}[];
constructor
(
private
client
:
Client
)
{
}
...
...
@@ -37,21 +39,24 @@ export class TokenSalesCardComponent implements OnInit {
private
async
getAvgData
()
{
try
{
let
avgs
:
Array
<
any
>
=
await
Promise
.
all
([
this
.
client
.
get
(
'
api/v2/analytics/tokensales
'
,
{
key
:
'
average_sold
'
}),
this
.
client
.
get
(
'
api/v2/analytics/tokensales
'
,
{
key
:
'
average_sales
'
}),
this
.
client
.
get
(
'
api/v2/analytics/tokensales
'
,
{
key
:
'
average_buyers
'
}),
this
.
client
.
get
(
'
api/v2/analytics/tokensales
'
,
{
key
:
'
average_eth_earned
'
}),
this
.
client
.
get
(
'
api/v2/analytics/tokensales
'
,
{
key
:
'
average_eth_usd_rate
'
}),
this
.
client
.
get
(
'
api/v2/analytics/tokensales
'
,
{
key
:
'
_avg
'
,
timespan
:
this
.
card
.
selectedOption
}),
this
.
client
.
get
(
'
api/v2/analytics/tokensales
'
,
{
key
:
'
monthly_rate_avg
'
,
timespan
:
this
.
card
.
selectedOption
}),
]);
this
.
tokens
=
avgs
[
0
].
data
;
this
.
tokens
=
avgs
[
0
].
data
.
tokens
;
this
.
sales
=
avgs
[
1
].
data
;
this
.
sales
=
avgs
[
0
].
data
.
transactions
;
this
.
buyers
=
avgs
[
2
].
data
;
this
.
buyers
=
avgs
[
0
].
data
.
buyers
;
this
.
eth
Earned
=
avgs
[
3
].
data
;
this
.
eth
Value
=
avgs
[
1
].
data
.
ethValue
;
this
.
ethUsdRate
=
avgs
[
4
].
data
;
this
.
ethUsdRate
=
avgs
[
1
].
data
.
ethUsdRate
;
}
catch
(
e
)
{
console
.
error
(
e
);
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/user-segments/segments.component.html
View file @
0248724e
<m-analytics
__card
[
title
]="'
User
Segments
'"
[
options
]="['
daily
',
'
monthly
']"
#
card
>
[
options
]="['
daily
']"
defaultOption=
"daily"
#
card
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Resurrected
(Avg)
</h6>
<h5>
{{
resurrected
| number : '1.0'}}
</h5>
<h6>
Curious
(Avg)
</h6>
<h5>
{{
curious
| number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
New (Avg)
</h6>
<h5>
{{new | number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Curious (Avg)
</h6>
<h5>
{{curious | number : '1.0'}}
</h5>
<h6>
Casual (Avg)
</h6>
<h5>
{{casual | number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Core (Avg)
</h6>
<h5>
{{core | number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Cold (Avg)
</h6>
<h5>
{{cold | number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
Casual
(Avg)
</h6>
<h5>
{{
casual
| number : '1.0'}}
</h5>
<h6>
Resurrected
(Avg)
</h6>
<h5>
{{
resurrected
| number : '1.0'}}
</h5>
</div>
<div
class=
"m-analytics__average"
>
<h6>
New (Avg)
</h6>
<h5>
{{new | number : '1.0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currents"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__usersegments
[
timespan
]="
card
.
selectedOption
"
></m-analyticscharts
__usersegments
>
<m-analyticscharts
__usersegments
[
timespan
]="
card
.
selectedOption
"
(
loaded
)="
currents =
$event"
></m-analyticscharts
__usersegments
>
</div>
</m-analytics
__card
>
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/user-segments/segments.component.ts
View file @
0248724e
...
...
@@ -19,6 +19,7 @@ export class UserSegmentsCardComponent implements OnInit {
core
:
number
=
0
;
cold
:
number
=
0
;
casual
:
number
=
0
;
currents
:
{
name
:
string
,
value
:
number
}[];
constructor
(
private
client
:
Client
)
{
}
...
...
@@ -32,7 +33,8 @@ export class UserSegmentsCardComponent implements OnInit {
}
ngOnDestroy
()
{
this
.
subscription
.
unsubscribe
();
if
(
this
.
subscription
)
this
.
subscription
.
unsubscribe
();
}
private
async
getAvgData
()
{
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/withdraw/withdraw.component.html
View file @
0248724e
<m-analytics
__card
[
title
]="'
Withdraw
'"
[
options
]="['
daily
',
'
monthly
']"
#
card
>
#
card
>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
>
<h6>
Avg Withdrawn Tokens
</h6>
<h5>
{{tokens | number : '1.0'}}
</h5>
...
...
@@ -17,10 +17,16 @@
<h6>
Avg of Withdrawing Users
</h6>
<h5>
{{users | number : '1.0'}}
</h5>
</div>
</div>
<div
class=
"m-analytics__averages"
>
<div
class=
"m-analytics__average"
*
ngFor=
"let current of currents"
>
<h6>
Current {{current.name}}
</h6>
<h5>
{{current.value | number : '1.0-0'}}
</h5>
</div>
</div>
<div
class=
"m-analyticsCard__charts"
>
<m-analyticscharts
__withdraw
[
timespan
]="
card
.
selectedOption
"
></m-analyticscharts
__withdraw
>
<m-analyticscharts
__withdraw
[
timespan
]="
card
.
selectedOption
"
(
loaded
)="
currents =
$event"
></m-analyticscharts
__withdraw
>
</div>
</m-analytics
__card
>
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/cards/withdraw/withdraw.component.ts
View file @
0248724e
...
...
@@ -16,6 +16,7 @@ export class WithdrawCardComponent implements OnInit {
tokens
:
number
=
0
;
transactions
:
number
=
0
;
users
:
number
=
0
;
currents
:
{
name
:
string
,
value
:
number
}[];
constructor
(
private
client
:
Client
)
{
}
...
...
@@ -34,17 +35,16 @@ export class WithdrawCardComponent implements OnInit {
private
async
getAvgData
()
{
try
{
let
avgs
:
Array
<
any
>
=
await
Promise
.
all
([
this
.
client
.
get
(
'
api/v2/analytics/withdraw
'
,
{
key
:
'
average_tokens
'
,
timespan
:
this
.
card
.
selectedOption
}),
this
.
client
.
get
(
'
api/v2/analytics/withdraw
'
,
{
key
:
'
average
'
,
timespan
:
this
.
card
.
selectedOption
}),
this
.
client
.
get
(
'
api/v2/analytics/withdraw
'
,
{
key
:
'
average_users
'
,
timespan
:
this
.
card
.
selectedOption
}),
]);
const
response
:
any
=
await
this
.
client
.
get
(
'
api/v2/analytics/withdraw
'
,
{
key
:
'
avg
'
,
timespan
:
this
.
card
.
selectedOption
});
this
.
tokens
=
avgs
[
0
].
data
;
this
.
tokens
=
response
.
data
.
tokens
;
this
.
transactions
=
avgs
[
1
].
data
;
this
.
transactions
=
response
.
data
.
transactions
;
this
.
users
=
avgs
[
2
].
data
;
this
.
users
=
response
.
data
.
users
;
}
catch
(
e
)
{
console
.
error
(
e
);
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/charts/active-users/active-users.component.ts
View file @
0248724e
import
{
Component
,
ElementRef
,
HostListener
,
Input
,
OnIni
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Component
,
ElementRef
,
EventEmitter
,
HostListener
,
Input
,
OnInit
,
Outpu
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
timespanOption
}
from
"
../timespanOption
"
;
import
{
removeCurrentUnits
}
from
"
../../../util
"
;
@
Component
({
selector
:
'
m-analyticscharts__activeusers
'
,
...
...
@@ -19,6 +20,7 @@ import { timespanOption } from "../timespanOption";
export
class
ActiveUsersChartComponent
implements
OnInit
{
@
Input
()
total
:
boolean
=
false
;
@
Output
()
loaded
:
EventEmitter
<
Array
<
any
>>
=
new
EventEmitter
<
Array
<
any
>>
();
timespan
:
timespanOption
;
...
...
@@ -67,7 +69,6 @@ export class ActiveUsersChartComponent implements OnInit {
}
ngOnInit
()
{
//this.layout.title = this.total ? 'Total Pageviews' : 'Active Users';
this
.
applyDimensions
();
this
.
getData
();
this
.
init
=
true
;
...
...
@@ -80,7 +81,10 @@ export class ActiveUsersChartComponent implements OnInit {
try
{
const
response
:
any
=
await
this
.
client
.
get
(
url
,
{
timespan
:
this
.
timespan
});
this
.
data
=
response
.
data
;
const
[
data
,
current
]
=
removeCurrentUnits
(
response
.
data
);
this
.
data
=
data
;
this
.
loaded
.
emit
(
current
);
}
catch
(
e
)
{
console
.
error
(
e
);
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/charts/boosts/channel-boosts.component.ts
View file @
0248724e
import
{
Component
,
ElementRef
,
HostListener
,
Input
,
OnIni
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Component
,
ElementRef
,
EventEmitter
,
HostListener
,
Input
,
OnInit
,
Outpu
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
removeCurrentUnits
}
from
"
../../../util
"
;
@
Component
({
selector
:
'
m-analyticscharts__channelboosts
'
,
...
...
@@ -18,6 +19,7 @@ import { Client } from "../../../../../services/api/client";
export
class
ChannelBoostsComponent
implements
OnInit
{
@
Input
()
analytics
:
'
totals
'
|
'
monthly
'
;
@
Output
()
loaded
:
EventEmitter
<
Array
<
any
>>
=
new
EventEmitter
<
Array
<
any
>>
();
@
ViewChild
(
'
chartContainer
'
,
{
static
:
true
})
chartContainer
:
ElementRef
;
...
...
@@ -60,7 +62,11 @@ export class ChannelBoostsComponent implements OnInit {
switch
(
this
.
analytics
)
{
case
'
monthly
'
:
this
.
layout
.
title
=
'
Percentage of Interactions from Boosts
'
;
this
.
data
=
response
.
data
;
const
[
data
,
current
]
=
removeCurrentUnits
(
response
.
data
);
this
.
data
=
data
;
this
.
loaded
.
emit
(
current
);
for
(
let
i
=
0
;
i
<
this
.
data
.
length
;
i
++
)
{
this
.
data
[
i
].
stackgroup
=
'
one
'
;
this
.
data
[
i
].
groupnorm
=
'
percent
'
;
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/charts/boosts/offchain-boosts.component.ts
View file @
0248724e
import
{
Component
,
ElementRef
,
HostListener
,
Input
,
OnIni
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Component
,
ElementRef
,
EventEmitter
,
HostListener
,
Input
,
OnInit
,
Outpu
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
timespanOption
}
from
"
../timespanOption
"
;
import
{
removeCurrentUnits
}
from
"
../../../util
"
;
@
Component
({
selector
:
'
m-analyticscharts__offchainboosts
'
,
...
...
@@ -18,6 +19,8 @@ import { timespanOption } from "../timespanOption";
export
class
OffChainBoostsChartComponent
implements
OnInit
{
@
Input
()
analytics
:
'
completed
'
|
'
not_completed
'
|
'
revoked
'
|
'
rejected
'
|
'
users_who_completed
'
|
'
users_waiting_for_completion
'
|
'
reclaimed_tokens
'
|
'
impressions_served
'
;
@
Output
()
loaded
:
EventEmitter
<
Array
<
any
>>
=
new
EventEmitter
<
Array
<
any
>>
();
timespan
:
timespanOption
;
@
ViewChild
(
'
chartContainer
'
,
{
static
:
true
})
chartContainer
:
ElementRef
;
...
...
@@ -75,7 +78,10 @@ export class OffChainBoostsChartComponent implements OnInit {
key
:
this
.
analytics
,
timespan
:
this
.
timespan
});
this
.
data
=
response
.
data
;
const
[
data
,
current
]
=
removeCurrentUnits
(
response
.
data
);
this
.
data
=
data
;
this
.
loaded
.
emit
(
current
);
}
@
HostListener
(
'
window:resize
'
)
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/charts/boosts/onchain-boosts.component.ts
View file @
0248724e
import
{
Component
,
ElementRef
,
HostListener
,
Input
,
OnIni
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Component
,
ElementRef
,
EventEmitter
,
HostListener
,
Input
,
OnInit
,
Outpu
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
timespanOption
}
from
"
../timespanOption
"
;
import
{
removeCurrentUnits
}
from
"
../../../util
"
;
@
Component
({
selector
:
'
m-analyticscharts__onchainboosts
'
,
...
...
@@ -17,6 +18,8 @@ import { timespanOption } from "../timespanOption";
})
export
class
OnChainBoostsChartComponent
implements
OnInit
{
@
Output
()
loaded
:
EventEmitter
<
Array
<
any
>>
=
new
EventEmitter
<
Array
<
any
>>
();
timespan
:
timespanOption
;
@
ViewChild
(
'
chartContainer
'
,
{
static
:
true
})
chartContainer
:
ElementRef
;
...
...
@@ -70,7 +73,10 @@ export class OnChainBoostsChartComponent implements OnInit {
async
getData
()
{
const
response
:
any
=
await
this
.
client
.
get
(
`api/v2/analytics/onchainboosts`
,
{
timespan
:
this
.
timespan
});
this
.
data
=
response
.
data
;
const
[
data
,
current
]
=
removeCurrentUnits
(
response
.
data
);
this
.
data
=
data
;
this
.
loaded
.
emit
(
current
);
}
@
HostListener
(
'
window:resize
'
)
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/charts/comments/comments.component.ts
View file @
0248724e
import
{
Component
,
ElementRef
,
HostListener
,
Input
,
OnIni
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Component
,
ElementRef
,
EventEmitter
,
HostListener
,
Input
,
OnInit
,
Outpu
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
MindsUser
}
from
"
../../../../../interfaces/entities
"
;
import
{
timespanOption
}
from
"
../timespanOption
"
;
import
{
removeCurrentUnits
}
from
"
../../../util
"
;
@
Component
({
selector
:
'
m-analyticscharts__comments
'
,
...
...
@@ -19,9 +20,10 @@ import { timespanOption } from "../timespanOption";
})
export
class
CommentsChartComponent
implements
OnInit
{
@
ViewChild
(
'
chartContainer
'
,
{
static
:
true
})
chartContainer
:
ElementRef
;
@
Input
()
user
:
MindsUser
;
@
Output
()
loaded
:
EventEmitter
<
Array
<
any
>>
=
new
EventEmitter
<
Array
<
any
>>
();
@
ViewChild
(
'
chartContainer
'
,
{
static
:
true
})
chartContainer
:
ElementRef
;
init
:
boolean
=
false
;
timespan
:
timespanOption
;
...
...
@@ -84,8 +86,10 @@ export class CommentsChartComponent implements OnInit {
try
{
const
response
:
any
=
await
this
.
client
.
get
(
url
,
opts
);
this
.
data
=
response
.
data
;
}
catch
(
e
)
{
const
[
data
,
current
]
=
removeCurrentUnits
(
response
.
data
);
this
.
data
=
data
;
this
.
loaded
.
emit
(
current
);
}
catch
(
e
)
{
console
.
error
(
e
);
}
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/charts/interactions/interactions.component.ts
View file @
0248724e
import
{
Component
,
ElementRef
,
HostListener
,
Input
,
OnIni
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Component
,
ElementRef
,
EventEmitter
,
HostListener
,
Input
,
OnInit
,
Outpu
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
removeCurrentUnits
}
from
"
../../../util
"
;
@
Component
({
selector
:
'
m-analyticscharts__channelinteractions
'
,
...
...
@@ -18,6 +19,7 @@ import { Client } from "../../../../../services/api/client";
export
class
ChannelInteractionsComponent
implements
OnInit
{
@
Input
()
analytics
:
'
totals
'
|
'
monthly
'
;
@
Output
()
loaded
:
EventEmitter
<
Array
<
any
>>
=
new
EventEmitter
<
Array
<
any
>>
();
@
ViewChild
(
'
chartContainer
'
,
{
static
:
true
})
chartContainer
:
ElementRef
;
...
...
@@ -55,8 +57,10 @@ export class ChannelInteractionsComponent implements OnInit {
async
getData
()
{
const
response
:
any
=
await
this
.
client
.
get
(
`api/v2/analytics/interactions/`
,
{
key
:
this
.
analytics
});
this
.
data
=
response
.
data
;
const
[
data
,
current
]
=
removeCurrentUnits
(
response
.
data
);
this
.
data
=
data
;
this
.
loaded
.
emit
(
current
);
switch
(
this
.
analytics
)
{
case
'
monthly
'
:
this
.
layout
.
title
=
'
Interactions
'
;
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/charts/pageviews/pageviews.component.ts
0 → 100644
View file @
0248724e
import
{
Component
,
ElementRef
,
EventEmitter
,
HostListener
,
Input
,
OnInit
,
Output
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
timespanOption
}
from
"
../timespanOption
"
;
import
{
removeCurrentUnits
}
from
"
../../../util
"
;
@
Component
({
selector
:
'
m-analyticscharts__pageviews
'
,
template
:
`
<div class="m-chart" #chartContainer>
<div class="mdl-spinner mdl-js-spinner is-active" [mdl] *ngIf="inProgress"></div>
<m-graph
[data]="data"
[layout]="layout"
*ngIf="!inProgress && !!data"
></m-graph>
</div>
`
})
export
class
PageviewsChartComponent
implements
OnInit
{
@
Input
()
pie
:
boolean
=
false
;
@
Output
()
loaded
:
EventEmitter
<
Array
<
any
>>
=
new
EventEmitter
<
Array
<
any
>>
();
@
ViewChild
(
'
chartContainer
'
,
{
static
:
true
})
chartContainer
:
ElementRef
;
timespan
:
timespanOption
;
init
:
boolean
=
false
;
inProgress
:
boolean
=
false
;
data
:
any
;
layout
:
any
=
{
width
:
0
,
height
:
0
,
title
:
''
,
font
:
{
family
:
'
Roboto
'
},
titlefont
:
{
family
:
'
Roboto
'
,
size
:
24
,
weight
:
'
bold
'
},
xaxis
:
{
type
:
'
-
'
,
},
yaxis
:
{
type
:
'
log
'
,
dtick
:
1
,
},
margin
:
{
t
:
16
,
b
:
32
,
l
:
32
,
},
};
@
Input
(
'
timespan
'
)
set
_timespan
(
value
:
timespanOption
)
{
this
.
timespan
=
value
;
if
(
this
.
init
)
{
this
.
getData
();
}
}
constructor
(
private
client
:
Client
)
{
}
ngOnInit
()
{
this
.
applyDimensions
();
this
.
getData
();
this
.
init
=
true
;
}
async
getData
()
{
const
opts
=
{
timespan
:
this
.
timespan
};
if
(
this
.
pie
)
{
opts
[
'
key
'
]
=
'
routes
'
;
}
const
response
:
any
=
await
this
.
client
.
get
(
`api/v2/analytics/pageviews`
,
opts
);
if
(
this
.
pie
)
{
this
.
data
=
response
.
data
;
this
.
data
[
0
].
type
=
'
pie
'
;
}
else
{
const
[
data
,
current
]
=
removeCurrentUnits
(
response
.
data
);
this
.
data
=
data
;
this
.
loaded
.
emit
(
current
);
}
}
@
HostListener
(
'
window:resize
'
)
applyDimensions
()
{
this
.
layout
=
{
...
this
.
layout
,
width
:
this
.
chartContainer
.
nativeElement
.
clientWidth
,
height
:
this
.
chartContainer
.
nativeElement
.
clientHeight
-
35
,
};
}
}
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/charts/plus/offchain-plus.component.ts
View file @
0248724e
import
{
Component
,
ElementRef
,
HostListener
,
Input
,
OnIni
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Component
,
ElementRef
,
EventEmitter
,
HostListener
,
Input
,
OnInit
,
Outpu
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
timespanOption
}
from
"
../timespanOption
"
;
import
{
removeCurrentUnits
}
from
"
../../../util
"
;
@
Component
({
selector
:
'
m-analyticscharts__offchainplus
'
,
...
...
@@ -18,6 +19,8 @@ import { timespanOption } from "../timespanOption";
})
export
class
OffchainPlusChartComponent
implements
OnInit
{
@
Output
()
loaded
:
EventEmitter
<
Array
<
any
>>
=
new
EventEmitter
<
Array
<
any
>>
();
@
ViewChild
(
'
chartContainer
'
,
{
static
:
true
})
chartContainer
:
ElementRef
;
timespan
:
timespanOption
;
...
...
@@ -70,8 +73,10 @@ export class OffchainPlusChartComponent implements OnInit {
async
getData
()
{
const
response
:
any
=
await
this
.
client
.
get
(
`api/v2/analytics/offchainplus`
,
{
timespan
:
this
.
timespan
});
this
.
data
=
response
.
data
;
}
const
[
data
,
current
]
=
removeCurrentUnits
(
response
.
data
);
this
.
data
=
data
;
this
.
loaded
.
emit
(
current
);
}
@
HostListener
(
'
window:resize
'
)
applyDimensions
()
{
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/charts/plus/onchain-plus.component.ts
View file @
0248724e
import
{
Component
,
ElementRef
,
HostListener
,
Input
,
OnIni
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Component
,
ElementRef
,
EventEmitter
,
HostListener
,
Input
,
OnInit
,
Outpu
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
timespanOption
}
from
"
../timespanOption
"
;
import
{
removeCurrentUnits
}
from
"
../../../util
"
;
@
Component
({
selector
:
'
m-analyticscharts__onchainplus
'
,
...
...
@@ -18,6 +19,8 @@ import { timespanOption } from "../timespanOption";
})
export
class
OnchainPlusChartComponent
implements
OnInit
{
@
Output
()
loaded
:
EventEmitter
<
Array
<
any
>>
=
new
EventEmitter
<
Array
<
any
>>
();
@
ViewChild
(
'
chartContainer
'
,
{
static
:
true
})
chartContainer
:
ElementRef
;
timespan
:
timespanOption
;
...
...
@@ -69,8 +72,11 @@ export class OnchainPlusChartComponent implements OnInit {
}
async
getData
()
{
const
response
:
any
=
await
this
.
client
.
get
(
`api/v2/analytics/offchainplus`
,
{
timespan
:
this
.
timespan
});
this
.
data
=
response
.
data
;
const
response
:
any
=
await
this
.
client
.
get
(
`api/v2/analytics/onchainplus`
,
{
timespan
:
this
.
timespan
});
const
[
data
,
current
]
=
removeCurrentUnits
(
response
.
data
);
this
.
data
=
data
;
this
.
loaded
.
emit
(
current
);
}
@
HostListener
(
'
window:resize
'
)
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/charts/posts/posts.component.ts
View file @
0248724e
import
{
Component
,
ElementRef
,
HostListener
,
Input
,
OnIni
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Component
,
ElementRef
,
EventEmitter
,
HostListener
,
Input
,
OnInit
,
Outpu
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
MindsUser
}
from
"
../../../../../interfaces/entities
"
;
import
{
timespanOption
}
from
"
../timespanOption
"
;
import
{
removeCurrentUnits
}
from
"
../../../util
"
;
@
Component
({
selector
:
'
m-analyticscharts__posts
'
,
...
...
@@ -20,6 +21,7 @@ import { timespanOption } from "../timespanOption";
export
class
PostsChartComponent
implements
OnInit
{
@
Input
()
user
:
MindsUser
;
@
Output
()
loaded
:
EventEmitter
<
Array
<
any
>>
=
new
EventEmitter
<
Array
<
any
>>
();
@
ViewChild
(
'
chartContainer
'
,
{
static
:
true
})
chartContainer
:
ElementRef
;
...
...
@@ -83,7 +85,10 @@ export class PostsChartComponent implements OnInit {
try
{
const
response
:
any
=
await
this
.
client
.
get
(
url
,
opts
);
this
.
data
=
response
.
data
;
const
[
data
,
current
]
=
removeCurrentUnits
(
response
.
data
);
this
.
data
=
data
;
this
.
loaded
.
emit
(
current
);
this
.
data
[
0
].
type
=
'
lines
'
;
}
catch
(
e
)
{
console
.
error
(
e
);
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/charts/reminds/reminds.component.ts
View file @
0248724e
import
{
Component
,
ElementRef
,
HostListener
,
Input
,
OnIni
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Component
,
ElementRef
,
EventEmitter
,
HostListener
,
Input
,
OnInit
,
Outpu
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
MindsUser
}
from
"
../../../../../interfaces/entities
"
;
import
{
timespanOption
}
from
"
../timespanOption
"
;
import
{
removeCurrentUnits
}
from
"
../../../util
"
;
@
Component
({
selector
:
'
m-analyticscharts__reminds
'
,
...
...
@@ -20,6 +21,7 @@ import { timespanOption } from "../timespanOption";
export
class
RemindsChartComponent
implements
OnInit
{
@
Input
()
user
:
MindsUser
;
@
Output
()
loaded
:
EventEmitter
<
Array
<
any
>>
=
new
EventEmitter
<
Array
<
any
>>
();
@
ViewChild
(
'
chartContainer
'
,
{
static
:
true
})
chartContainer
:
ElementRef
;
...
...
@@ -83,7 +85,10 @@ export class RemindsChartComponent implements OnInit {
try
{
const
response
:
any
=
await
this
.
client
.
get
(
url
,
opts
);
this
.
data
=
response
.
data
;
const
[
data
,
current
]
=
removeCurrentUnits
(
response
.
data
);
this
.
data
=
data
;
this
.
loaded
.
emit
(
current
);
this
.
data
[
0
].
type
=
'
lines
'
;
}
catch
(
e
)
{
console
.
error
(
e
);
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/charts/rewards/rewards.component.ts
View file @
0248724e
import
{
Component
,
ElementRef
,
HostListener
,
Input
,
OnIni
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Component
,
ElementRef
,
EventEmitter
,
HostListener
,
Input
,
OnInit
,
Outpu
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
timespanOption
}
from
"
../timespanOption
"
;
import
{
removeCurrentUnits
}
from
"
../../../util
"
;
@
Component
({
selector
:
'
m-analyticscharts__rewards
'
,
...
...
@@ -18,6 +19,8 @@ import { timespanOption } from "../timespanOption";
})
export
class
RewardsChartComponent
implements
OnInit
{
@
Output
()
loaded
:
EventEmitter
<
Array
<
any
>>
=
new
EventEmitter
<
Array
<
any
>>
();
@
ViewChild
(
'
chartContainer
'
,
{
static
:
true
})
chartContainer
:
ElementRef
;
timespan
:
timespanOption
;
...
...
@@ -70,7 +73,10 @@ export class RewardsChartComponent implements OnInit {
async
getData
()
{
const
response
:
any
=
await
this
.
client
.
get
(
`api/v2/analytics/rewards`
,
{
timespan
:
this
.
timespan
});
this
.
data
=
response
.
data
;
const
[
data
,
current
]
=
removeCurrentUnits
(
response
.
data
);
this
.
data
=
data
;
this
.
loaded
.
emit
(
current
);
}
@
HostListener
(
'
window:resize
'
)
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/charts/token-sales/sales.component.ts
View file @
0248724e
import
{
Component
,
ElementRef
,
HostListener
,
Input
,
OnIni
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Component
,
ElementRef
,
EventEmitter
,
HostListener
,
Input
,
OnInit
,
Outpu
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
timespanOption
}
from
"
../timespanOption
"
;
import
{
removeCurrentUnits
}
from
"
../../../util
"
;
@
Component
({
selector
:
'
m-analyticscharts__tokensales
'
,
...
...
@@ -19,6 +20,8 @@ import { timespanOption } from "../timespanOption";
export
class
TokenSalesChartComponent
implements
OnInit
{
@
Input
()
analytics
:
'
rates
'
|
'
sales
'
;
@
Output
()
loaded
:
EventEmitter
<
Array
<
any
>>
=
new
EventEmitter
<
Array
<
any
>>
();
@
ViewChild
(
'
chartContainer
'
,
{
static
:
true
})
chartContainer
:
ElementRef
;
timespan
:
timespanOption
;
...
...
@@ -77,7 +80,10 @@ export class TokenSalesChartComponent implements OnInit {
}
const
response
:
any
=
await
this
.
client
.
get
(
`api/v2/analytics/tokensales`
,
opts
);
this
.
data
=
response
.
data
;
const
[
data
,
current
]
=
removeCurrentUnits
(
response
.
data
);
this
.
data
=
data
;
this
.
loaded
.
emit
(
current
);
}
@
HostListener
(
'
window:resize
'
)
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/charts/user-segments/segments.component.ts
View file @
0248724e
import
{
Component
,
ElementRef
,
HostListener
,
Input
,
OnIni
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Component
,
ElementRef
,
EventEmitter
,
HostListener
,
Input
,
OnInit
,
Outpu
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
timespanOption
}
from
"
../timespanOption
"
;
import
{
removeCurrentUnits
}
from
"
../../../util
"
;
@
Component
({
selector
:
'
m-analyticscharts__usersegments
'
,
...
...
@@ -18,6 +19,8 @@ import { timespanOption } from "../timespanOption";
})
export
class
UserSegmentsChartComponent
implements
OnInit
{
@
Output
()
loaded
:
EventEmitter
<
Array
<
any
>>
=
new
EventEmitter
<
Array
<
any
>>
();
@
ViewChild
(
'
chartContainer
'
,
{
static
:
true
})
chartContainer
:
ElementRef
;
timespan
:
timespanOption
;
...
...
@@ -76,7 +79,10 @@ export class UserSegmentsChartComponent implements OnInit {
try
{
const
response
:
any
=
await
this
.
client
.
get
(
url
,
opts
);
this
.
data
=
response
.
data
;
const
[
data
,
current
]
=
removeCurrentUnits
(
response
.
data
);
this
.
data
=
data
;
this
.
loaded
.
emit
(
current
);
this
.
data
[
0
].
type
=
'
lines
'
;
}
catch
(
e
)
{
console
.
error
(
e
);
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/charts/votes/votes.component.ts
View file @
0248724e
import
{
Component
,
ElementRef
,
HostListener
,
Input
,
OnIni
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Component
,
ElementRef
,
EventEmitter
,
HostListener
,
Input
,
OnInit
,
Outpu
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
timespanOption
}
from
"
../timespanOption
"
;
import
{
MindsUser
}
from
"
../../../../../interfaces/entities
"
;
import
{
removeCurrentUnits
}
from
"
../../../util
"
;
@
Component
({
selector
:
'
m-analyticscharts__votes
'
,
...
...
@@ -19,6 +20,8 @@ import { MindsUser } from "../../../../../interfaces/entities";
})
export
class
VotesChartComponent
implements
OnInit
{
@
Output
()
loaded
:
EventEmitter
<
Array
<
any
>>
=
new
EventEmitter
<
Array
<
any
>>
();
@
ViewChild
(
'
chartContainer
'
,
{
static
:
true
})
chartContainer
:
ElementRef
;
@
Input
()
user
:
MindsUser
;
...
...
@@ -83,7 +86,10 @@ export class VotesChartComponent implements OnInit {
try
{
const
response
:
any
=
await
this
.
client
.
get
(
url
,
opts
);
this
.
data
=
response
.
data
;
const
[
data
,
current
]
=
removeCurrentUnits
(
response
.
data
);
this
.
data
=
data
;
this
.
loaded
.
emit
(
current
);
this
.
data
[
0
].
type
=
'
lines
'
;
}
catch
(
e
)
{
console
.
error
(
e
);
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/charts/wire/offchain-wire.component.ts
View file @
0248724e
import
{
Component
,
ElementRef
,
HostListener
,
Input
,
OnIni
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Component
,
ElementRef
,
EventEmitter
,
HostListener
,
Input
,
OnInit
,
Outpu
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
timespanOption
}
from
"
../timespanOption
"
;
import
{
removeCurrentUnits
}
from
"
../../../util
"
;
@
Component
({
selector
:
'
m-analyticscharts__offchainwire
'
,
...
...
@@ -18,6 +19,8 @@ import { timespanOption } from "../timespanOption";
})
export
class
OffchainWireChartComponent
implements
OnInit
{
@
Output
()
loaded
:
EventEmitter
<
Array
<
any
>>
=
new
EventEmitter
<
Array
<
any
>>
();
@
ViewChild
(
'
chartContainer
'
,
{
static
:
true
})
chartContainer
:
ElementRef
;
timespan
:
timespanOption
;
...
...
@@ -70,7 +73,10 @@ export class OffchainWireChartComponent implements OnInit {
async
getData
()
{
const
response
:
any
=
await
this
.
client
.
get
(
`api/v2/analytics/offchainwire`
,
{
timespan
:
this
.
timespan
});
this
.
data
=
response
.
data
;
const
[
data
,
current
]
=
removeCurrentUnits
(
response
.
data
);
this
.
data
=
data
;
this
.
loaded
.
emit
(
current
);
}
@
HostListener
(
'
window:resize
'
)
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/charts/wire/onchain-wire.component.ts
View file @
0248724e
import
{
Component
,
ElementRef
,
HostListener
,
Input
,
OnIni
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Component
,
ElementRef
,
EventEmitter
,
HostListener
,
Input
,
OnInit
,
Outpu
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
timespanOption
}
from
"
../timespanOption
"
;
import
{
removeCurrentUnits
}
from
"
../../../util
"
;
@
Component
({
selector
:
'
m-analyticscharts__onchainwire
'
,
...
...
@@ -18,6 +19,8 @@ import { timespanOption } from "../timespanOption";
})
export
class
OnchainWireChartComponent
implements
OnInit
{
@
Output
()
loaded
:
EventEmitter
<
Array
<
any
>>
=
new
EventEmitter
<
Array
<
any
>>
();
@
ViewChild
(
'
chartContainer
'
,
{
static
:
true
})
chartContainer
:
ElementRef
;
timespan
:
timespanOption
;
...
...
@@ -64,7 +67,10 @@ export class OnchainWireChartComponent implements OnInit {
async
getData
()
{
const
response
:
any
=
await
this
.
client
.
get
(
`api/v2/analytics/onchainwire`
,
{
timespan
:
this
.
timespan
});
this
.
data
=
response
.
data
;
const
[
data
,
current
]
=
removeCurrentUnits
(
response
.
data
);
this
.
data
=
data
;
this
.
loaded
.
emit
(
current
);
}
@
HostListener
(
'
window:resize
'
)
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/components/charts/withdraw/withdraw.component.ts
View file @
0248724e
import
{
Component
,
ElementRef
,
HostListener
,
Input
,
OnIni
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Component
,
ElementRef
,
EventEmitter
,
HostListener
,
Input
,
OnInit
,
Outpu
t
,
ViewChild
}
from
'
@angular/core
'
;
import
{
Client
}
from
"
../../../../../services/api/client
"
;
import
{
timespanOption
}
from
"
../timespanOption
"
;
import
{
removeCurrentUnits
}
from
"
../../../util
"
;
@
Component
({
selector
:
'
m-analyticscharts__withdraw
'
,
...
...
@@ -18,6 +19,8 @@ import { timespanOption } from "../timespanOption";
})
export
class
WithdrawChartComponent
implements
OnInit
{
@
Output
()
loaded
:
EventEmitter
<
Array
<
any
>>
=
new
EventEmitter
<
Array
<
any
>>
();
@
ViewChild
(
'
chartContainer
'
,
{
static
:
true
})
chartContainer
:
ElementRef
;
timespan
:
timespanOption
;
...
...
@@ -69,7 +72,10 @@ export class WithdrawChartComponent implements OnInit {
async
getData
()
{
const
response
:
any
=
await
this
.
client
.
get
(
`api/v2/analytics/withdraw`
,
{
timespan
:
this
.
timespan
});
this
.
data
=
response
.
data
;
const
[
data
,
current
]
=
removeCurrentUnits
(
response
.
data
);
this
.
data
=
data
;
this
.
loaded
.
emit
(
current
);
}
@
HostListener
(
'
window:resize
'
)
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/pages/admin/network-activity/network-activity.component.ts
View file @
0248724e
...
...
@@ -4,6 +4,7 @@ import { Component, OnInit } from '@angular/core';
selector
:
'
m-analyticssite__networkactivity
'
,
template
:
`
<m-analyticsactiveusers__card></m-analyticsactiveusers__card>
<m-analyticspageviews__card></m-analyticspageviews__card>
<m-analyticsusersegments__card></m-analyticsusersegments__card>
<m-analyticsengagement__card></m-analyticsengagement__card>
`
...
...
This diff is collapsed.
Click to expand it.
src/app/modules/analytics/util.ts
0 → 100644
View file @
0248724e
export
function
removeCurrentUnits
(
data
:
Array
<
any
>
):
Array
<
any
>
{
let
currents
=
[];
for
(
let
series
of
data
)
{
currents
.
push
({
'
name
'
:
series
.
name
,
'
value
'
:
series
.
y
[
series
.
y
.
length
-
1
]
});
series
.
x
.
pop
();
series
.
y
.
pop
();
}
return
[
data
,
currents
];
}
This diff is collapsed.
Click to expand it.