diff options
author | Chocobozzz <me@florianbigard.com> | 2023-07-27 11:44:31 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2023-07-27 14:17:12 +0200 |
commit | f18003d0ac5c3fc6ec8de2a89102d1e1e89182df (patch) | |
tree | 0b3baa5658478607f3417fe7c747cc3a782f15b3 /client/src/app/shared | |
parent | f5af5feb5a41eb6e2796e480402106b55bd10f04 (diff) | |
download | PeerTube-f18003d0ac5c3fc6ec8de2a89102d1e1e89182df.tar.gz PeerTube-f18003d0ac5c3fc6ec8de2a89102d1e1e89182df.tar.zst PeerTube-f18003d0ac5c3fc6ec8de2a89102d1e1e89182df.zip |
Improve runner management
* Add ability to remove runner jobs
* Add runner job state quick filter
* Merge registration tokens and runners tables in the same page
* Add copy button to copy registration token
Diffstat (limited to 'client/src/app/shared')
8 files changed, 55 insertions, 12 deletions
diff --git a/client/src/app/shared/shared-forms/advanced-input-filter.component.scss b/client/src/app/shared/shared-forms/advanced-input-filter.component.scss index 4efbeb85d..f5438ffdb 100644 --- a/client/src/app/shared/shared-forms/advanced-input-filter.component.scss +++ b/client/src/app/shared/shared-forms/advanced-input-filter.component.scss | |||
@@ -33,6 +33,5 @@ my-global-icon { | |||
33 | 33 | ||
34 | div[role=menu] { | 34 | div[role=menu] { |
35 | max-height: 50vh; | 35 | max-height: 50vh; |
36 | min-height: 200px; | ||
37 | overflow: auto; | 36 | overflow: auto; |
38 | } | 37 | } |
diff --git a/client/src/app/shared/shared-forms/input-text.component.html b/client/src/app/shared/shared-forms/input-text.component.html index abb53a085..4747e2f8f 100644 --- a/client/src/app/shared/shared-forms/input-text.component.html +++ b/client/src/app/shared/shared-forms/input-text.component.html | |||
@@ -11,13 +11,12 @@ | |||
11 | <my-global-icon *ngIf="!show" iconName="eye-close"></my-global-icon> | 11 | <my-global-icon *ngIf="!show" iconName="eye-close"></my-global-icon> |
12 | </button> | 12 | </button> |
13 | 13 | ||
14 | <button | 14 | <my-copy-button |
15 | *ngIf="withCopy" [cdkCopyToClipboard]="input.value" (click)="activateCopiedMessage()" type="button" | 15 | *ngIf="withCopy" [value]="input.value" i18n-notification notification="Copied" |
16 | class="btn btn-outline-secondary text-uppercase" i18n-title title="Copy" | 16 | [isInputGroup]="true" i18n |
17 | > | 17 | > |
18 | <my-global-icon iconName="copy"></my-global-icon> | 18 | COPY |
19 | <span class="copy-text">Copy</span> | 19 | </my-copy-button> |
20 | </button> | ||
21 | </div> | 20 | </div> |
22 | 21 | ||
23 | <div *ngIf="formError" class="form-error">{{ formError }}</div> | 22 | <div *ngIf="formError" class="form-error">{{ formError }}</div> |
diff --git a/client/src/app/shared/shared-forms/input-text.component.ts b/client/src/app/shared/shared-forms/input-text.component.ts index aa4a1cba8..be03f25b9 100644 --- a/client/src/app/shared/shared-forms/input-text.component.ts +++ b/client/src/app/shared/shared-forms/input-text.component.ts | |||
@@ -46,10 +46,6 @@ export class InputTextComponent implements ControlValueAccessor { | |||
46 | this.show = !this.show | 46 | this.show = !this.show |
47 | } | 47 | } |
48 | 48 | ||
49 | activateCopiedMessage () { | ||
50 | this.notifier.success($localize`Copied`) | ||
51 | } | ||
52 | |||
53 | propagateChange = (_: any) => { /* empty */ } | 49 | propagateChange = (_: any) => { /* empty */ } |
54 | 50 | ||
55 | writeValue (value: string) { | 51 | writeValue (value: string) { |
diff --git a/client/src/app/shared/shared-main/buttons/copy-button.component.html b/client/src/app/shared/shared-main/buttons/copy-button.component.html new file mode 100644 index 000000000..a99c0a93a --- /dev/null +++ b/client/src/app/shared/shared-main/buttons/copy-button.component.html | |||
@@ -0,0 +1,9 @@ | |||
1 | <button | ||
2 | class="btn btn-outline-secondary btn-sm copy-button" | ||
3 | [cdkCopyToClipboard]="value" (click)="activateCopiedMessage()" | ||
4 | [title]="title" [ngClass]="{ 'is-input-group': isInputGroup }" | ||
5 | > | ||
6 | <my-global-icon iconName="copy"></my-global-icon> | ||
7 | |||
8 | <ng-content></ng-content> | ||
9 | </button> | ||
diff --git a/client/src/app/shared/shared-main/buttons/copy-button.component.scss b/client/src/app/shared/shared-main/buttons/copy-button.component.scss new file mode 100644 index 000000000..7e3720418 --- /dev/null +++ b/client/src/app/shared/shared-main/buttons/copy-button.component.scss | |||
@@ -0,0 +1,15 @@ | |||
1 | @use '_variables' as *; | ||
2 | @use '_mixins' as *; | ||
3 | |||
4 | button:not(.is-input-group) { | ||
5 | border: 0; | ||
6 | } | ||
7 | |||
8 | .is-input-group { | ||
9 | border-top-left-radius: 0; | ||
10 | border-bottom-left-radius: 0; | ||
11 | } | ||
12 | |||
13 | my-global-icon { | ||
14 | width: 15px; | ||
15 | } | ||
diff --git a/client/src/app/shared/shared-main/buttons/copy-button.component.ts b/client/src/app/shared/shared-main/buttons/copy-button.component.ts new file mode 100644 index 000000000..aac9ab8b0 --- /dev/null +++ b/client/src/app/shared/shared-main/buttons/copy-button.component.ts | |||
@@ -0,0 +1,22 @@ | |||
1 | import { Component, Input } from '@angular/core' | ||
2 | import { Notifier } from '@app/core' | ||
3 | |||
4 | @Component({ | ||
5 | selector: 'my-copy-button', | ||
6 | styleUrls: [ './copy-button.component.scss' ], | ||
7 | templateUrl: './copy-button.component.html' | ||
8 | }) | ||
9 | export class CopyButtonComponent { | ||
10 | @Input() value: string | ||
11 | @Input() title: string | ||
12 | @Input() notification: string | ||
13 | @Input() isInputGroup = false | ||
14 | |||
15 | constructor (private notifier: Notifier) { | ||
16 | |||
17 | } | ||
18 | |||
19 | activateCopiedMessage () { | ||
20 | if (this.notification) this.notifier.success(this.notification) | ||
21 | } | ||
22 | } | ||
diff --git a/client/src/app/shared/shared-main/buttons/index.ts b/client/src/app/shared/shared-main/buttons/index.ts index 775a47a39..75efbdea3 100644 --- a/client/src/app/shared/shared-main/buttons/index.ts +++ b/client/src/app/shared/shared-main/buttons/index.ts | |||
@@ -1,4 +1,5 @@ | |||
1 | export * from './action-dropdown.component' | 1 | export * from './action-dropdown.component' |
2 | export * from './button.component' | 2 | export * from './button.component' |
3 | export * from './copy-button.component' | ||
3 | export * from './delete-button.component' | 4 | export * from './delete-button.component' |
4 | export * from './edit-button.component' | 5 | export * from './edit-button.component' |
diff --git a/client/src/app/shared/shared-main/shared-main.module.ts b/client/src/app/shared/shared-main/shared-main.module.ts index 480277450..243394bda 100644 --- a/client/src/app/shared/shared-main/shared-main.module.ts +++ b/client/src/app/shared/shared-main/shared-main.module.ts | |||
@@ -31,7 +31,7 @@ import { | |||
31 | PeerTubeTemplateDirective | 31 | PeerTubeTemplateDirective |
32 | } from './angular' | 32 | } from './angular' |
33 | import { AUTH_INTERCEPTOR_PROVIDER } from './auth' | 33 | import { AUTH_INTERCEPTOR_PROVIDER } from './auth' |
34 | import { ActionDropdownComponent, ButtonComponent, DeleteButtonComponent, EditButtonComponent } from './buttons' | 34 | import { ActionDropdownComponent, ButtonComponent, CopyButtonComponent, DeleteButtonComponent, EditButtonComponent } from './buttons' |
35 | import { CustomPageService } from './custom-page' | 35 | import { CustomPageService } from './custom-page' |
36 | import { DateToggleComponent } from './date' | 36 | import { DateToggleComponent } from './date' |
37 | import { FeedComponent } from './feeds' | 37 | import { FeedComponent } from './feeds' |
@@ -100,6 +100,7 @@ import { VideoChannelService } from './video-channel' | |||
100 | 100 | ||
101 | ActionDropdownComponent, | 101 | ActionDropdownComponent, |
102 | ButtonComponent, | 102 | ButtonComponent, |
103 | CopyButtonComponent, | ||
103 | DeleteButtonComponent, | 104 | DeleteButtonComponent, |
104 | EditButtonComponent, | 105 | EditButtonComponent, |
105 | 106 | ||
@@ -162,6 +163,7 @@ import { VideoChannelService } from './video-channel' | |||
162 | 163 | ||
163 | ActionDropdownComponent, | 164 | ActionDropdownComponent, |
164 | ButtonComponent, | 165 | ButtonComponent, |
166 | CopyButtonComponent, | ||
165 | DeleteButtonComponent, | 167 | DeleteButtonComponent, |
166 | EditButtonComponent, | 168 | EditButtonComponent, |
167 | 169 | ||