diff --git a/client/src/app/+admin/jobs/jobs-list/jobs-list.component.html b/client/src/app/+admin/jobs/jobs-list/jobs-list.component.html
index a90267172..29103c06b 100644
--- a/client/src/app/+admin/jobs/jobs-list/jobs-list.component.html
+++ b/client/src/app/+admin/jobs/jobs-list/jobs-list.component.html
@@ -1,18 +1,20 @@
-
-
-
Jobs list
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ {{ job.handlerInputData }}
+
+
+
+
+
+
diff --git a/client/src/app/+admin/jobs/jobs-list/jobs-list.component.scss b/client/src/app/+admin/jobs/jobs-list/jobs-list.component.scss
new file mode 100644
index 000000000..9dde13216
--- /dev/null
+++ b/client/src/app/+admin/jobs/jobs-list/jobs-list.component.scss
@@ -0,0 +1,3 @@
+pre {
+ font-size: 13px;
+}
diff --git a/client/src/app/+admin/jobs/jobs-list/jobs-list.component.ts b/client/src/app/+admin/jobs/jobs-list/jobs-list.component.ts
index 88fe259fb..f93847f29 100644
--- a/client/src/app/+admin/jobs/jobs-list/jobs-list.component.ts
+++ b/client/src/app/+admin/jobs/jobs-list/jobs-list.component.ts
@@ -1,22 +1,24 @@
-import { Component } from '@angular/core'
+import { Component, OnInit } from '@angular/core'
import { NotificationsService } from 'angular2-notifications'
import { SortMeta } from 'primeng/primeng'
import { Job } from '../../../../../../shared/index'
import { RestPagination, RestTable } from '../../../shared'
+import { viewportHeight } from '../../../shared/misc/utils'
import { JobService } from '../shared'
import { RestExtractor } from '../../../shared/rest/rest-extractor.service'
@Component({
selector: 'my-jobs-list',
templateUrl: './jobs-list.component.html',
- styleUrls: [ ]
+ styleUrls: [ './jobs-list.component.scss' ]
})
-export class JobsListComponent extends RestTable {
+export class JobsListComponent extends RestTable implements OnInit {
jobs: Job[] = []
totalRecords = 0
- rowsPerPage = 10
+ rowsPerPage = 20
sort: SortMeta = { field: 'createdAt', order: 1 }
pagination: RestPagination = { count: this.rowsPerPage, start: 0 }
+ scrollHeight = ''
constructor (
private notificationsService: NotificationsService,
@@ -26,10 +28,14 @@ export class JobsListComponent extends RestTable {
super()
}
+ ngOnInit () {
+ // 270 -> headers + footer...
+ this.scrollHeight = (viewportHeight() - 380) + 'px'
+ }
+
protected loadData () {
this.jobsService
.getJobs(this.pagination, this.sort)
- .map(res => this.restExtractor.applyToResultListData(res, this.formatJob.bind(this)))
.subscribe(
resultList => {
this.jobs = resultList.data
@@ -39,12 +45,4 @@ export class JobsListComponent extends RestTable {
err => this.notificationsService.error('Error', err.message)
)
}
-
- private formatJob (job: Job) {
- const handlerInputData = JSON.stringify(job.handlerInputData)
-
- return Object.assign(job, {
- handlerInputData
- })
- }
}
diff --git a/client/src/app/+admin/jobs/shared/job.service.ts b/client/src/app/+admin/jobs/shared/job.service.ts
index 49f1ab6f5..0cfbdbbea 100644
--- a/client/src/app/+admin/jobs/shared/job.service.ts
+++ b/client/src/app/+admin/jobs/shared/job.service.ts
@@ -25,6 +25,13 @@ export class JobService {
return this.authHttp.get
>(JobService.BASE_JOB_URL, { params })
.map(res => this.restExtractor.convertResultListDateToHuman(res))
+ .map(res => this.restExtractor.applyToResultListData(res, this.prettyPrintData))
.catch(err => this.restExtractor.handleError(err))
}
+
+ private prettyPrintData (obj: Job) {
+ const handlerInputData = JSON.stringify(obj.handlerInputData, null, 2)
+
+ return Object.assign(obj, { handlerInputData })
+ }
}
diff --git a/client/src/app/+admin/users/user-list/user-list.component.html b/client/src/app/+admin/users/user-list/user-list.component.html
index a100ddfaa..5a19edfde 100644
--- a/client/src/app/+admin/users/user-list/user-list.component.html
+++ b/client/src/app/+admin/users/user-list/user-list.component.html
@@ -1,4 +1,4 @@
-
diff --git a/client/src/app/account/account-videos/account-videos.component.scss b/client/src/app/account/account-videos/account-videos.component.scss
index 083918e29..670fe992c 100644
--- a/client/src/app/account/account-videos/account-videos.component.scss
+++ b/client/src/app/account/account-videos/account-videos.component.scss
@@ -6,17 +6,7 @@
}
}
-.action-button {
- @include peertube-button-link;
-
- font-size: 15px;
- font-weight: $font-semibold;
- color: #585858;
- background-color: #E5E5E5;
-
- &:hover {
- background-color: #EFEFEF;
- }
+/deep/ .action-button {
&.action-button-delete {
margin-right: 10px;
@@ -32,21 +22,8 @@
}
.icon {
- @include icon(21px);
-
- position: relative;
- top: -2px;
-
- &.icon-edit {
- background-image: url('../../../assets/images/global/edit.svg');
- }
-
- &.icon-delete-grey {
- background-image: url('../../../assets/images/account/delete-grey.svg');
- }
-
&.icon-delete-white {
- background-image: url('../../../assets/images/account/delete-white.svg');
+ background-image: url('../../../assets/images/global/delete-white.svg');
}
}
}
diff --git a/client/src/app/shared/misc/button.component.scss b/client/src/app/shared/misc/button.component.scss
new file mode 100644
index 000000000..5fcae4f10
--- /dev/null
+++ b/client/src/app/shared/misc/button.component.scss
@@ -0,0 +1,27 @@
+.action-button {
+ @include peertube-button-link;
+
+ font-size: 15px;
+ font-weight: $font-semibold;
+ color: #585858;
+ background-color: #E5E5E5;
+
+ &:hover {
+ background-color: #EFEFEF;
+ }
+
+ .icon {
+ @include icon(21px);
+
+ position: relative;
+ top: -2px;
+
+ &.icon-edit {
+ background-image: url('../../../assets/images/global/edit.svg');
+ }
+
+ &.icon-delete-grey {
+ background-image: url('../../../assets/images/global/delete-grey.svg');
+ }
+ }
+}
diff --git a/client/src/app/shared/misc/delete-button.component.html b/client/src/app/shared/misc/delete-button.component.html
new file mode 100644
index 000000000..3db483882
--- /dev/null
+++ b/client/src/app/shared/misc/delete-button.component.html
@@ -0,0 +1,4 @@
+