aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/core/server/server.service.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/core/server/server.service.ts')
-rw-r--r--client/src/app/core/server/server.service.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/client/src/app/core/server/server.service.ts b/client/src/app/core/server/server.service.ts
index 3997ce6db..e015d0e14 100644
--- a/client/src/app/core/server/server.service.ts
+++ b/client/src/app/core/server/server.service.ts
@@ -9,6 +9,7 @@ import { VideoConstant } from '../../../../../shared/models/videos'
9import { isDefaultLocale, peertubeTranslate } from '../../../../../shared/models/i18n' 9import { isDefaultLocale, peertubeTranslate } from '../../../../../shared/models/i18n'
10import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils' 10import { getDevLocale, isOnDevLocale } from '@app/shared/i18n/i18n-utils'
11import { sortBy } from '@app/shared/misc/utils' 11import { sortBy } from '@app/shared/misc/utils'
12import { ServerStats } from '@shared/models/server'
12 13
13@Injectable() 14@Injectable()
14export class ServerService { 15export class ServerService {
@@ -16,6 +17,8 @@ export class ServerService {
16 private static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos/' 17 private static BASE_VIDEO_URL = environment.apiUrl + '/api/v1/videos/'
17 private static BASE_VIDEO_PLAYLIST_URL = environment.apiUrl + '/api/v1/video-playlists/' 18 private static BASE_VIDEO_PLAYLIST_URL = environment.apiUrl + '/api/v1/video-playlists/'
18 private static BASE_LOCALE_URL = environment.apiUrl + '/client/locales/' 19 private static BASE_LOCALE_URL = environment.apiUrl + '/client/locales/'
20 private static BASE_STATS_URL = environment.apiUrl + '/api/v1/server/stats'
21
19 private static CONFIG_LOCAL_STORAGE_KEY = 'server-config' 22 private static CONFIG_LOCAL_STORAGE_KEY = 'server-config'
20 23
21 configReloaded = new Subject<void>() 24 configReloaded = new Subject<void>()
@@ -44,6 +47,12 @@ export class ServerService {
44 css: '' 47 css: ''
45 } 48 }
46 }, 49 },
50 search: {
51 remoteUri: {
52 users: true,
53 anonymous: false
54 }
55 },
47 plugin: { 56 plugin: {
48 registered: [] 57 registered: []
49 }, 58 },
@@ -238,6 +247,10 @@ export class ServerService {
238 return this.localeObservable.pipe(first()) 247 return this.localeObservable.pipe(first())
239 } 248 }
240 249
250 getServerStats () {
251 return this.http.get<ServerStats>(ServerService.BASE_STATS_URL)
252 }
253
241 private loadAttributeEnum <T extends string | number> ( 254 private loadAttributeEnum <T extends string | number> (
242 baseUrl: string, 255 baseUrl: string,
243 attributeName: 'categories' | 'licences' | 'languages' | 'privacies', 256 attributeName: 'categories' | 'licences' | 'languages' | 'privacies',