aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+admin
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+admin')
-rw-r--r--client/src/app/+admin/follows/followers-list/followers-list.component.ts2
-rw-r--r--client/src/app/+admin/follows/following-list/following-list.component.ts8
-rw-r--r--client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts2
-rw-r--r--client/src/app/+admin/moderation/registration-list/registration-list.component.ts2
-rw-r--r--client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts27
-rw-r--r--client/src/app/+admin/overview/comments/video-comment-list.component.ts2
-rw-r--r--client/src/app/+admin/overview/users/user-list/user-list.component.ts4
-rw-r--r--client/src/app/+admin/overview/videos/video-list.component.ts34
-rw-r--r--client/src/app/+admin/system/jobs/jobs.component.ts2
9 files changed, 40 insertions, 43 deletions
diff --git a/client/src/app/+admin/follows/followers-list/followers-list.component.ts b/client/src/app/+admin/follows/followers-list/followers-list.component.ts
index 6dd64fc57..cebb2e1a2 100644
--- a/client/src/app/+admin/follows/followers-list/followers-list.component.ts
+++ b/client/src/app/+admin/follows/followers-list/followers-list.component.ts
@@ -140,7 +140,7 @@ export class FollowersListComponent extends RestTable <ActorFollow> implements O
140 return follow.follower.name + '@' + follow.follower.host 140 return follow.follower.name + '@' + follow.follower.host
141 } 141 }
142 142
143 protected reloadData () { 143 protected reloadDataInternal () {
144 this.followService.getFollowers({ pagination: this.pagination, sort: this.sort, search: this.search }) 144 this.followService.getFollowers({ pagination: this.pagination, sort: this.sort, search: this.search })
145 .subscribe({ 145 .subscribe({
146 next: resultList => { 146 next: resultList => {
diff --git a/client/src/app/+admin/follows/following-list/following-list.component.ts b/client/src/app/+admin/follows/following-list/following-list.component.ts
index e986a610a..71f2fbe66 100644
--- a/client/src/app/+admin/follows/following-list/following-list.component.ts
+++ b/client/src/app/+admin/follows/following-list/following-list.component.ts
@@ -62,8 +62,10 @@ export class FollowingListComponent extends RestTable <ActorFollow> implements O
62 } 62 }
63 63
64 async removeFollowing (follows: ActorFollow[]) { 64 async removeFollowing (follows: ActorFollow[]) {
65 const icuParams = { count: follows.length, entryName: this.buildFollowingName(follows[0]) }
66
65 const message = prepareIcu($localize`Do you really want to unfollow {count, plural, =1 {{entryName}?} other {{count} entries?}}`)( 67 const message = prepareIcu($localize`Do you really want to unfollow {count, plural, =1 {{entryName}?} other {{count} entries?}}`)(
66 { count: follows.length, entryName: this.buildFollowingName(follows[0]) }, 68 icuParams,
67 $localize`Do you really want to unfollow these entries?` 69 $localize`Do you really want to unfollow these entries?`
68 ) 70 )
69 71
@@ -75,7 +77,7 @@ export class FollowingListComponent extends RestTable <ActorFollow> implements O
75 next: () => { 77 next: () => {
76 // eslint-disable-next-line max-len 78 // eslint-disable-next-line max-len
77 const message = prepareIcu($localize`You are not following {count, plural, =1 {{entryName} anymore.} other {these {count} entries anymore.}}`)( 79 const message = prepareIcu($localize`You are not following {count, plural, =1 {{entryName} anymore.} other {these {count} entries anymore.}}`)(
78 { count: follows.length, entryName: this.buildFollowingName(follows[0]) }, 80 icuParams,
79 $localize`You are not following them anymore.` 81 $localize`You are not following them anymore.`
80 ) 82 )
81 83
@@ -87,7 +89,7 @@ export class FollowingListComponent extends RestTable <ActorFollow> implements O
87 }) 89 })
88 } 90 }
89 91
90 protected reloadData () { 92 protected reloadDataInternal () {
91 this.followService.getFollowing({ pagination: this.pagination, sort: this.sort, search: this.search }) 93 this.followService.getFollowing({ pagination: this.pagination, sort: this.sort, search: this.search })
92 .subscribe({ 94 .subscribe({
93 next: resultList => { 95 next: resultList => {
diff --git a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts
index a89603048..b31c5b35e 100644
--- a/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts
+++ b/client/src/app/+admin/follows/video-redundancies-list/video-redundancies-list.component.ts
@@ -162,7 +162,7 @@ export class VideoRedundanciesListComponent extends RestTable implements OnInit
162 162
163 } 163 }
164 164
165 protected reloadData () { 165 protected reloadDataInternal () {
166 const options = { 166 const options = {
167 pagination: this.pagination, 167 pagination: this.pagination,
168 sort: this.sort, 168 sort: this.sort,
diff --git a/client/src/app/+admin/moderation/registration-list/registration-list.component.ts b/client/src/app/+admin/moderation/registration-list/registration-list.component.ts
index 569eccaa2..ed8fbec51 100644
--- a/client/src/app/+admin/moderation/registration-list/registration-list.component.ts
+++ b/client/src/app/+admin/moderation/registration-list/registration-list.component.ts
@@ -92,7 +92,7 @@ export class RegistrationListComponent extends RestTable <UserRegistration> impl
92 this.reloadData() 92 this.reloadData()
93 } 93 }
94 94
95 protected reloadData () { 95 protected reloadDataInternal () {
96 this.adminRegistrationService.listRegistrations({ 96 this.adminRegistrationService.listRegistrations({
97 pagination: this.pagination, 97 pagination: this.pagination,
98 sort: this.sort, 98 sort: this.sort,
diff --git a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts
index efd99e52b..f365a2500 100644
--- a/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts
+++ b/client/src/app/+admin/moderation/video-block-list/video-block-list.component.ts
@@ -159,26 +159,25 @@ export class VideoBlockListComponent extends RestTable implements OnInit {
159 }) 159 })
160 } 160 }
161 161
162 protected reloadData () { 162 protected reloadDataInternal () {
163 this.videoBlocklistService.listBlocks({ 163 this.videoBlocklistService.listBlocks({
164 pagination: this.pagination, 164 pagination: this.pagination,
165 sort: this.sort, 165 sort: this.sort,
166 search: this.search 166 search: this.search
167 }) 167 }).subscribe({
168 .subscribe({ 168 next: async resultList => {
169 next: async resultList => { 169 this.totalRecords = resultList.total
170 this.totalRecords = resultList.total
171 170
172 this.blocklist = resultList.data 171 this.blocklist = resultList.data
173 172
174 for (const element of this.blocklist) { 173 for (const element of this.blocklist) {
175 Object.assign(element, { 174 Object.assign(element, {
176 reasonHtml: await this.toHtml(element.reason) 175 reasonHtml: await this.toHtml(element.reason)
177 }) 176 })
178 } 177 }
179 }, 178 },
180 179
181 error: err => this.notifier.error(err.message) 180 error: err => this.notifier.error(err.message)
182 }) 181 })
183 } 182 }
184} 183}
diff --git a/client/src/app/+admin/overview/comments/video-comment-list.component.ts b/client/src/app/+admin/overview/comments/video-comment-list.component.ts
index cfa68ed9d..28efdc076 100644
--- a/client/src/app/+admin/overview/comments/video-comment-list.component.ts
+++ b/client/src/app/+admin/overview/comments/video-comment-list.component.ts
@@ -117,7 +117,7 @@ export class VideoCommentListComponent extends RestTable <VideoCommentAdmin> imp
117 return this.markdownRenderer.textMarkdownToHTML({ markdown: text, withHtml: true, withEmoji: true }) 117 return this.markdownRenderer.textMarkdownToHTML({ markdown: text, withHtml: true, withEmoji: true })
118 } 118 }
119 119
120 reloadData () { 120 protected reloadDataInternal () {
121 this.videoCommentService.getAdminVideoComments({ 121 this.videoCommentService.getAdminVideoComments({
122 pagination: this.pagination, 122 pagination: this.pagination,
123 sort: this.sort, 123 sort: this.sort,
diff --git a/client/src/app/+admin/overview/users/user-list/user-list.component.ts b/client/src/app/+admin/overview/users/user-list/user-list.component.ts
index 7d62302f8..19420b748 100644
--- a/client/src/app/+admin/overview/users/user-list/user-list.component.ts
+++ b/client/src/app/+admin/overview/users/user-list/user-list.component.ts
@@ -283,9 +283,7 @@ export class UserListComponent extends RestTable <User> implements OnInit {
283 }) 283 })
284 } 284 }
285 285
286 protected reloadData () { 286 protected reloadDataInternal () {
287 this.selectedRows = []
288
289 this.userAdminService.getUsers({ 287 this.userAdminService.getUsers({
290 pagination: this.pagination, 288 pagination: this.pagination,
291 sort: this.sort, 289 sort: this.sort,
diff --git a/client/src/app/+admin/overview/videos/video-list.component.ts b/client/src/app/+admin/overview/videos/video-list.component.ts
index cd5d2eb34..1ea295499 100644
--- a/client/src/app/+admin/overview/videos/video-list.component.ts
+++ b/client/src/app/+admin/overview/videos/video-list.component.ts
@@ -183,9 +183,23 @@ export class VideoListComponent extends RestTable <Video> implements OnInit {
183 return files.reduce((p, f) => p += f.size, 0) 183 return files.reduce((p, f) => p += f.size, 0)
184 } 184 }
185 185
186 reloadData () { 186 async removeVideoFile (video: Video, file: VideoFile, type: 'hls' | 'webtorrent') {
187 this.selectedRows = [] 187 const message = $localize`Are you sure you want to delete this ${file.resolution.label} file?`
188 const res = await this.confirmService.confirm(message, $localize`Delete file`)
189 if (res === false) return
190
191 this.videoService.removeFile(video.uuid, file.id, type)
192 .subscribe({
193 next: () => {
194 this.notifier.success($localize`File removed.`)
195 this.reloadData()
196 },
197
198 error: err => this.notifier.error(err.message)
199 })
200 }
188 201
202 protected reloadDataInternal () {
189 this.loading = true 203 this.loading = true
190 204
191 this.videoAdminService.getAdminVideos({ 205 this.videoAdminService.getAdminVideos({
@@ -203,22 +217,6 @@ export class VideoListComponent extends RestTable <Video> implements OnInit {
203 }) 217 })
204 } 218 }
205 219
206 async removeVideoFile (video: Video, file: VideoFile, type: 'hls' | 'webtorrent') {
207 const message = $localize`Are you sure you want to delete this ${file.resolution.label} file?`
208 const res = await this.confirmService.confirm(message, $localize`Delete file`)
209 if (res === false) return
210
211 this.videoService.removeFile(video.uuid, file.id, type)
212 .subscribe({
213 next: () => {
214 this.notifier.success($localize`File removed.`)
215 this.reloadData()
216 },
217
218 error: err => this.notifier.error(err.message)
219 })
220 }
221
222 private async removeVideos (videos: Video[]) { 220 private async removeVideos (videos: Video[]) {
223 const message = prepareIcu($localize`Are you sure you want to delete {count, plural, =1 {this video} other {these {count} videos}}?`)( 221 const message = prepareIcu($localize`Are you sure you want to delete {count, plural, =1 {this video} other {these {count} videos}}?`)(
224 { count: videos.length }, 222 { count: videos.length },
diff --git a/client/src/app/+admin/system/jobs/jobs.component.ts b/client/src/app/+admin/system/jobs/jobs.component.ts
index 12dc88a70..6e10c81ff 100644
--- a/client/src/app/+admin/system/jobs/jobs.component.ts
+++ b/client/src/app/+admin/system/jobs/jobs.component.ts
@@ -120,7 +120,7 @@ export class JobsComponent extends RestTable implements OnInit {
120 this.reloadData() 120 this.reloadData()
121 } 121 }
122 122
123 protected reloadData () { 123 protected reloadDataInternal () {
124 let jobState = this.jobState as JobState 124 let jobState = this.jobState as JobState
125 if (this.jobState === 'all') jobState = null 125 if (this.jobState === 'all') jobState = null
126 126