aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/models/server
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-02-28 18:04:46 +0100
committerChocobozzz <me@florianbigard.com>2018-02-28 18:04:55 +0100
commit09cababd79f9d445aa027c93cdfe823745fa041a (patch)
treef781d6ba78b5c4ce7220dea55f13b21230f203d6 /shared/models/server
parent22b59e8099947605085cf65a440f07f37fce6b65 (diff)
downloadPeerTube-09cababd79f9d445aa027c93cdfe823745fa041a.tar.gz
PeerTube-09cababd79f9d445aa027c93cdfe823745fa041a.tar.zst
PeerTube-09cababd79f9d445aa027c93cdfe823745fa041a.zip
Add stats route
Diffstat (limited to 'shared/models/server')
-rw-r--r--shared/models/server/about.model.ts7
-rw-r--r--shared/models/server/custom-config.model.ts42
-rw-r--r--shared/models/server/customization.model.ts8
-rw-r--r--shared/models/server/job.model.ts17
-rw-r--r--shared/models/server/server-config.model.ts40
-rw-r--r--shared/models/server/server-stats.model.ts12
6 files changed, 126 insertions, 0 deletions
diff --git a/shared/models/server/about.model.ts b/shared/models/server/about.model.ts
new file mode 100644
index 000000000..7d11da850
--- /dev/null
+++ b/shared/models/server/about.model.ts
@@ -0,0 +1,7 @@
1export interface About {
2 instance: {
3 name: string
4 description: string
5 terms: string
6 }
7}
diff --git a/shared/models/server/custom-config.model.ts b/shared/models/server/custom-config.model.ts
new file mode 100644
index 000000000..46d0a86ef
--- /dev/null
+++ b/shared/models/server/custom-config.model.ts
@@ -0,0 +1,42 @@
1export interface CustomConfig {
2 instance: {
3 name: string
4 description: string
5 terms: string
6 customizations: {
7 javascript?: string
8 css?: string
9 }
10 }
11
12 cache: {
13 previews: {
14 size: number
15 }
16 }
17
18 signup: {
19 enabled: boolean
20 limit: number
21 }
22
23 admin: {
24 email: string
25 }
26
27 user: {
28 videoQuota: number
29 }
30
31 transcoding: {
32 enabled: boolean
33 threads: number
34 resolutions: {
35 '240p': boolean
36 '360p': boolean
37 '480p': boolean
38 '720p': boolean
39 '1080p': boolean
40 }
41 }
42}
diff --git a/shared/models/server/customization.model.ts b/shared/models/server/customization.model.ts
new file mode 100644
index 000000000..4e4d0d193
--- /dev/null
+++ b/shared/models/server/customization.model.ts
@@ -0,0 +1,8 @@
1export interface Customization {
2 instance: {
3 customization: {
4 javascript: string
5 css: string
6 }
7 }
8}
diff --git a/shared/models/server/job.model.ts b/shared/models/server/job.model.ts
new file mode 100644
index 000000000..5ebb75a5c
--- /dev/null
+++ b/shared/models/server/job.model.ts
@@ -0,0 +1,17 @@
1export type JobState = 'active' | 'complete' | 'failed' | 'inactive' | 'delayed'
2
3export type JobType = 'activitypub-http-unicast' |
4 'activitypub-http-broadcast' |
5 'activitypub-http-fetcher' |
6 'video-file' |
7 'email'
8
9export interface Job {
10 id: number
11 state: JobState
12 type: JobType
13 data: any,
14 error: any,
15 createdAt: Date
16 updatedAt: Date
17}
diff --git a/shared/models/server/server-config.model.ts b/shared/models/server/server-config.model.ts
new file mode 100644
index 000000000..004cf6ddb
--- /dev/null
+++ b/shared/models/server/server-config.model.ts
@@ -0,0 +1,40 @@
1export interface ServerConfig {
2 serverVersion: string
3
4 instance: {
5 name: string;
6 customizations: {
7 javascript: string
8 css: string
9 }
10 }
11
12 signup: {
13 allowed: boolean
14 }
15
16 transcoding: {
17 enabledResolutions: number[]
18 }
19
20 avatar: {
21 file: {
22 size: {
23 max: number
24 },
25 extensions: string[]
26 }
27 }
28
29 video: {
30 image: {
31 size: {
32 max: number
33 }
34 extensions: string[]
35 },
36 file: {
37 extensions: string[]
38 }
39 }
40}
diff --git a/shared/models/server/server-stats.model.ts b/shared/models/server/server-stats.model.ts
new file mode 100644
index 000000000..5c1bf3468
--- /dev/null
+++ b/shared/models/server/server-stats.model.ts
@@ -0,0 +1,12 @@
1export interface ServerStats {
2 totalUsers: number
3 totalLocalVideos: number
4 totalLocalVideoViews: number
5 totalLocalVideoComments: number
6
7 totalVideos: number
8 totalVideoComments: number
9
10 totalInstanceFollowers: number
11 totalInstanceFollowing: number
12}