Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Sharkey
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
Dima Krasner
Sharkey
Commits
bd54e44b
Commit
bd54e44b
authored
4 years ago
by
syuilo
Browse files
Options
Downloads
Patches
Plain Diff
feat(client): Implement federation widget chart
parent
e1f2e364
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/client/components/mini-chart.vue
+0
-0
0 additions, 0 deletions
src/client/components/mini-chart.vue
src/client/widgets/federation.vue
+11
-9
11 additions, 9 deletions
src/client/widgets/federation.vue
src/client/widgets/trends.vue
+3
-3
3 additions, 3 deletions
src/client/widgets/trends.vue
with
14 additions
and
12 deletions
src/client/
widgets/trends.
chart.vue
→
src/client/
components/mini-
chart.vue
+
0
−
0
View file @
bd54e44b
File moved
This diff is collapsed.
Click to expand it.
src/client/widgets/federation.vue
+
11
−
9
View file @
bd54e44b
...
...
@@ -5,12 +5,12 @@
<div
class=
"wbrkwalb"
>
<mk-loading
v-if=
"fetching"
/>
<transition-group
tag=
"div"
name=
"chart"
class=
"instances"
v-else
>
<div
v-for=
"instance in instances"
:key=
"instance.id"
>
<div
v-for=
"
(
instance
, i)
in instances"
:key=
"instance.id"
>
<div
class=
"instance"
>
<a
class=
"a"
:href=
"'https://' + instance.host"
target=
"_blank"
:title=
"instance.host"
>
#{{ instance.host }}
</a>
<p>
{{ instance.softwareName }} {{ instance.softwareVersion }}
</p>
</div>
<
!-- TODO: <x
-chart class="chart" :src="
stat.chart"/> --
>
<
mk-mini
-chart
class=
"chart"
:src=
"
charts[i].requests.received"
/
>
</div>
</transition-group>
</div>
...
...
@@ -21,7 +21,7 @@
import
{
faGlobe
}
from
'
@fortawesome/free-solid-svg-icons
'
;
import
MkContainer
from
'
../components/ui/container.vue
'
;
import
define
from
'
./define
'
;
import
X
Chart
from
'
.
/trends.
chart.vue
'
;
import
MkMini
Chart
from
'
.
./components/mini-
chart.vue
'
;
export
default
define
({
name
:
'
federation
'
,
...
...
@@ -33,11 +33,12 @@ export default define({
})
}).
extend
({
components
:
{
MkContainer
,
X
Chart
MkContainer
,
MkMini
Chart
},
data
()
{
return
{
instances
:
[],
charts
:
[],
fetching
:
true
,
faGlobe
};
...
...
@@ -50,14 +51,15 @@ export default define({
clearInterval
(
this
.
clock
);
},
methods
:
{
fetch
()
{
this
.
$root
.
api
(
'
federation/instances
'
,
{
async
fetch
()
{
const
instances
=
await
this
.
$root
.
api
(
'
federation/instances
'
,
{
sort
:
'
+lastCommunicatedAt
'
,
limit
:
5
}).
then
(
instances
=>
{
this
.
instances
=
instances
;
this
.
fetching
=
false
;
});
const
charts
=
await
Promise
.
all
(
instances
.
map
(
i
=>
this
.
$root
.
api
(
'
charts/instance
'
,
{
host
:
i
.
host
,
limit
:
16
,
span
:
'
hour
'
})));
this
.
instances
=
instances
;
this
.
charts
=
charts
;
this
.
fetching
=
false
;
}
}
});
...
...
This diff is collapsed.
Click to expand it.
src/client/widgets/trends.vue
+
3
−
3
View file @
bd54e44b
...
...
@@ -10,7 +10,7 @@
<router-link
class=
"a"
:to=
"`/tags/${ encodeURIComponent(stat.tag) }`"
:title=
"stat.tag"
>
#{{ stat.tag }}
</router-link>
<p>
{{ $t('nUsersMentioned', { n: stat.usersCount }) }}
</p>
</div>
<
x
-chart
class=
"chart"
:src=
"stat.chart"
/>
<
mk-mini
-chart
class=
"chart"
:src=
"stat.chart"
/>
</div>
</transition-group>
</div>
...
...
@@ -21,7 +21,7 @@
import
{
faHashtag
}
from
'
@fortawesome/free-solid-svg-icons
'
;
import
MkContainer
from
'
../components/ui/container.vue
'
;
import
define
from
'
./define
'
;
import
X
Chart
from
'
.
/trends.
chart.vue
'
;
import
MkMini
Chart
from
'
.
./components/mini-
chart.vue
'
;
export
default
define
({
name
:
'
hashtags
'
,
...
...
@@ -33,7 +33,7 @@ export default define({
})
}).
extend
({
components
:
{
MkContainer
,
X
Chart
MkContainer
,
MkMini
Chart
},
data
()
{
return
{
...
...
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