mirror of
https://github.com/simon987/task_tracker.git
synced 2025-04-17 17:36:44 +00:00
Add console page
This commit is contained in:
parent
9cb8891024
commit
5c25811561
@ -178,7 +178,7 @@ func (database *Database) GetAllWorkerStats() *[]WorkerStats {
|
|||||||
|
|
||||||
db := database.getDB()
|
db := database.getDB()
|
||||||
rows, err := db.Query(`SELECT alias, closed_task_count, paused, worker.id
|
rows, err := db.Query(`SELECT alias, closed_task_count, paused, worker.id
|
||||||
FROM worker WHERE closed_task_count>0 LIMIT 50`)
|
FROM worker`)
|
||||||
|
|
||||||
handleErr(err)
|
handleErr(err)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -1,7 +1,9 @@
|
|||||||
import {Injectable} from '@angular/core';
|
import {Injectable} from '@angular/core';
|
||||||
import {HttpClient} from '@angular/common/http';
|
import {HttpClient, HttpHeaders} from '@angular/common/http';
|
||||||
import {Project} from './models/project';
|
import {Project} from './models/project';
|
||||||
|
import {Worker} from './models/worker';
|
||||||
import {Credentials} from './models/credentials';
|
import {Credentials} from './models/credentials';
|
||||||
|
import {SubmitTaskOptions} from './models/console';
|
||||||
|
|
||||||
@Injectable()
|
@Injectable()
|
||||||
export class ApiService {
|
export class ApiService {
|
||||||
@ -17,6 +19,13 @@ export class ApiService {
|
|||||||
) {
|
) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static getWorkerHeaders(w: Worker): HttpHeaders {
|
||||||
|
return new HttpHeaders({
|
||||||
|
'X-Worker-ID': w.id.toString(),
|
||||||
|
'X-Secret': w.secret,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
getLogs(level: number) {
|
getLogs(level: number) {
|
||||||
return this.http.post(this.url + '/logs', {level: level, since: 1}, this.options);
|
return this.http.post(this.url + '/logs', {level: level, since: 1}, this.options);
|
||||||
}
|
}
|
||||||
@ -135,4 +144,19 @@ export class ApiService {
|
|||||||
return this.http.get(this.url + `/worker/get/${wid}`, this.options);
|
return this.http.get(this.url + `/worker/get/${wid}`, this.options);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
workerSubmitTask(taskOptions: SubmitTaskOptions) {
|
||||||
|
return this.http.post(this.url + `/task/submit`, {
|
||||||
|
project: taskOptions.project.id,
|
||||||
|
max_retries: taskOptions.maxRetries,
|
||||||
|
recipe: taskOptions.recipe,
|
||||||
|
priority: taskOptions.priority,
|
||||||
|
max_assign_time: taskOptions.maxAssignTime,
|
||||||
|
hash64: 0,
|
||||||
|
unique_string: taskOptions.uniqueStr,
|
||||||
|
verification_count: taskOptions.verificationCount
|
||||||
|
}, {
|
||||||
|
headers: ApiService.getWorkerHeaders(taskOptions.worker),
|
||||||
|
responseType: 'json'
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,6 +15,7 @@ import {ProjectPermsComponent} from './project-perms/project-perms.component';
|
|||||||
import {ManagerListComponent} from './manager-list/manager-list.component';
|
import {ManagerListComponent} from './manager-list/manager-list.component';
|
||||||
import {IndexComponent} from './index/index.component';
|
import {IndexComponent} from './index/index.component';
|
||||||
import {ProjectSecretComponent} from './project-secret/project-secret.component';
|
import {ProjectSecretComponent} from './project-secret/project-secret.component';
|
||||||
|
import {ConsoleComponent} from './console/console.component';
|
||||||
|
|
||||||
const routes: Routes = [
|
const routes: Routes = [
|
||||||
{path: '', component: IndexComponent},
|
{path: '', component: IndexComponent},
|
||||||
@ -22,6 +23,7 @@ const routes: Routes = [
|
|||||||
{path: 'login', component: LoginComponent},
|
{path: 'login', component: LoginComponent},
|
||||||
{path: 'account', component: AccountDetailsComponent},
|
{path: 'account', component: AccountDetailsComponent},
|
||||||
{path: 'projects', component: ProjectListComponent},
|
{path: 'projects', component: ProjectListComponent},
|
||||||
|
{path: 'console', component: ConsoleComponent},
|
||||||
{path: 'project/:id', component: ProjectDashboardComponent},
|
{path: 'project/:id', component: ProjectDashboardComponent},
|
||||||
{path: 'project/:id/update', component: UpdateProjectComponent},
|
{path: 'project/:id/update', component: UpdateProjectComponent},
|
||||||
{path: 'project/:id/perms', component: ProjectPermsComponent},
|
{path: 'project/:id/perms', component: ProjectPermsComponent},
|
||||||
|
@ -15,6 +15,9 @@
|
|||||||
[routerLink]="'manager_list'"
|
[routerLink]="'manager_list'"
|
||||||
*ngIf="authService.logged && authService.account.tracker_admin"
|
*ngIf="authService.logged && authService.account.tracker_admin"
|
||||||
>{{"nav.manager_list" | translate}}</button>
|
>{{"nav.manager_list" | translate}}</button>
|
||||||
|
<button mat-button [class.mat-accent]="router.url === '/console'" class="nav-link"
|
||||||
|
[routerLink]="'console'"
|
||||||
|
*ngIf="authService.logged">{{"nav.console" | translate}}</button>
|
||||||
</div>
|
</div>
|
||||||
<div class="small-nav">
|
<div class="small-nav">
|
||||||
<button mat-button [matMenuTriggerFor]="smallNav">
|
<button mat-button [matMenuTriggerFor]="smallNav">
|
||||||
@ -36,6 +39,10 @@
|
|||||||
[routerLink]="'manager_list'"
|
[routerLink]="'manager_list'"
|
||||||
*ngIf="authService.logged && authService.account.tracker_admin"
|
*ngIf="authService.logged && authService.account.tracker_admin"
|
||||||
>{{"nav.manager_list" | translate}}</button>
|
>{{"nav.manager_list" | translate}}</button>
|
||||||
|
<button mat-button [class.mat-accent]="router.url === '/console'" class="nav-link"
|
||||||
|
[routerLink]="'console'"
|
||||||
|
*ngIf="authService.logged && authService.account.tracker_admin"
|
||||||
|
>{{"nav.console" | translate}}</button>
|
||||||
</mat-menu>
|
</mat-menu>
|
||||||
</div>
|
</div>
|
||||||
<span class="spacer"></span>
|
<span class="spacer"></span>
|
||||||
|
@ -58,6 +58,9 @@ import {IndexComponent} from './index/index.component';
|
|||||||
import {ProjectSecretComponent} from './project-secret/project-secret.component';
|
import {ProjectSecretComponent} from './project-secret/project-secret.component';
|
||||||
import {AdminPanelComponent} from './admin-panel/admin-panel.component';
|
import {AdminPanelComponent} from './admin-panel/admin-panel.component';
|
||||||
import {AreYouSureComponent} from './are-you-sure/are-you-sure.component';
|
import {AreYouSureComponent} from './are-you-sure/are-you-sure.component';
|
||||||
|
import {WorkerSelectComponent} from "./worker-select/worker-select.component";
|
||||||
|
import { ConsoleComponent } from './console/console.component';
|
||||||
|
import { ConsoleTaskSubmitComponent } from './console-task-submit/console-task-submit.component';
|
||||||
|
|
||||||
|
|
||||||
export function createTranslateLoader(http: HttpClient) {
|
export function createTranslateLoader(http: HttpClient) {
|
||||||
@ -86,6 +89,9 @@ export function createTranslateLoader(http: HttpClient) {
|
|||||||
ProjectSecretComponent,
|
ProjectSecretComponent,
|
||||||
AdminPanelComponent,
|
AdminPanelComponent,
|
||||||
AreYouSureComponent,
|
AreYouSureComponent,
|
||||||
|
WorkerSelectComponent,
|
||||||
|
ConsoleComponent,
|
||||||
|
ConsoleTaskSubmitComponent
|
||||||
],
|
],
|
||||||
imports: [
|
imports: [
|
||||||
BrowserModule,
|
BrowserModule,
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
.mat-form-field {
|
||||||
|
width: 100%;
|
||||||
|
}
|
@ -0,0 +1,46 @@
|
|||||||
|
<form (ngSubmit)="onSubmit()" id="console_task_submit">
|
||||||
|
|
||||||
|
<project-select [(project)]="submitOptions.project" [placeholder]="'test'"></project-select>
|
||||||
|
|
||||||
|
<worker-select [(worker)]="submitOptions.worker"></worker-select>
|
||||||
|
|
||||||
|
<mat-form-field appearance="outline">
|
||||||
|
<mat-label>{{"console.max_assign_time"|translate}}</mat-label>
|
||||||
|
<input matInput [(ngModel)]="submitOptions.maxAssignTime" name="max_assign_time" type="number">
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field appearance="outline">
|
||||||
|
<mat-label>{{"console.verification_count"|translate}}</mat-label>
|
||||||
|
<input matInput [(ngModel)]="submitOptions.verificationCount" name="verification_count" type="number">
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field appearance="outline">
|
||||||
|
<mat-label>{{"console.max_retries"|translate}}</mat-label>
|
||||||
|
<input matInput [(ngModel)]="submitOptions.maxRetries" name="max_retries" type="number">
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field appearance="outline">
|
||||||
|
<mat-label>{{"console.priority"|translate}}</mat-label>
|
||||||
|
<input matInput [(ngModel)]="submitOptions.priority" name="priority" type="number">
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field appearance="outline">
|
||||||
|
<mat-label>{{"console.recipe" | translate}}</mat-label>
|
||||||
|
<textarea matInput [(ngModel)]="submitOptions.recipe"
|
||||||
|
[placeholder]="'console.recipe'|translate"
|
||||||
|
name="recipe"></textarea>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-form-field appearance="outline">
|
||||||
|
<mat-label>{{"console.unique_str" | translate}}</mat-label>
|
||||||
|
<input type="text" matInput [(ngModel)]="submitOptions.uniqueStr" name="unique_str"
|
||||||
|
[placeholder]="'console.unique_str'|translate"
|
||||||
|
>
|
||||||
|
</mat-form-field>
|
||||||
|
|
||||||
|
<mat-card-actions>
|
||||||
|
<button type="submit" form="console_task_submit" mat-raised-button
|
||||||
|
[disabled]="buttonDisabled()"
|
||||||
|
color="primary">{{"console.task_submit" | translate}}</button>
|
||||||
|
</mat-card-actions>
|
||||||
|
</form>
|
@ -0,0 +1,32 @@
|
|||||||
|
import {Component, EventEmitter, OnInit, Output} from '@angular/core';
|
||||||
|
import {SubmitTaskOptions} from '../models/console';
|
||||||
|
import {ApiService} from '../api.service';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-console-task-submit',
|
||||||
|
templateUrl: './console-task-submit.component.html',
|
||||||
|
styleUrls: ['./console-task-submit.component.css']
|
||||||
|
})
|
||||||
|
export class ConsoleTaskSubmitComponent implements OnInit {
|
||||||
|
|
||||||
|
public submitOptions = new SubmitTaskOptions();
|
||||||
|
|
||||||
|
@Output() submitTask = new EventEmitter<SubmitTaskOptions>();
|
||||||
|
|
||||||
|
constructor(private apiService: ApiService) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
onSubmit() {
|
||||||
|
this.apiService.getWorker(this.submitOptions.worker.id).subscribe(data => {
|
||||||
|
this.submitOptions.worker.secret = data['content']['worker']['secret'];
|
||||||
|
this.submitTask.emit(this.submitOptions);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
public buttonDisabled(): boolean {
|
||||||
|
return this.submitOptions.project === undefined || this.submitOptions.worker === undefined;
|
||||||
|
}
|
||||||
|
}
|
0
web/angular/src/app/console/console.component.css
Normal file
0
web/angular/src/app/console/console.component.css
Normal file
18
web/angular/src/app/console/console.component.html
Normal file
18
web/angular/src/app/console/console.component.html
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
<div class="container">
|
||||||
|
<mat-card class="mat-elevation-z8">
|
||||||
|
<mat-card-header>
|
||||||
|
<mat-card-title>{{"console.title" | translate}}</mat-card-title>
|
||||||
|
<mat-card-subtitle>{{"console.subtitle" | translate}}</mat-card-subtitle>
|
||||||
|
</mat-card-header>
|
||||||
|
|
||||||
|
<mat-card-content>
|
||||||
|
<mat-expansion-panel style="margin-top: 1em">
|
||||||
|
<mat-expansion-panel-header>
|
||||||
|
<mat-panel-title>{{"console.submit" | translate}}</mat-panel-title>
|
||||||
|
</mat-expansion-panel-header>
|
||||||
|
|
||||||
|
<app-console-task-submit (submitTask)="onTaskSubmit($event)"></app-console-task-submit>
|
||||||
|
</mat-expansion-panel>
|
||||||
|
</mat-card-content>
|
||||||
|
</mat-card>
|
||||||
|
</div>
|
29
web/angular/src/app/console/console.component.ts
Normal file
29
web/angular/src/app/console/console.component.ts
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
import {Component, OnInit} from '@angular/core';
|
||||||
|
import {SubmitTaskOptions} from '../models/console';
|
||||||
|
import {ApiService} from '../api.service';
|
||||||
|
import {MessengerService} from '../messenger.service';
|
||||||
|
import {TranslateService} from '@ngx-translate/core';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'app-console',
|
||||||
|
templateUrl: './console.component.html',
|
||||||
|
styleUrls: ['./console.component.css']
|
||||||
|
})
|
||||||
|
export class ConsoleComponent implements OnInit {
|
||||||
|
|
||||||
|
constructor(private apiService: ApiService,
|
||||||
|
private messenger: MessengerService,
|
||||||
|
private translate: TranslateService) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
onTaskSubmit(options: SubmitTaskOptions) {
|
||||||
|
this.apiService.workerSubmitTask(options).subscribe(data => {
|
||||||
|
this.translate.get('console.submit_ok').subscribe(t => this.messenger.show(t));
|
||||||
|
}, error => {
|
||||||
|
this.messenger.show(error.error.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -29,7 +29,7 @@
|
|||||||
{{"project.git_repo_hint" | translate}}
|
{{"project.git_repo_hint" | translate}}
|
||||||
</mat-hint>
|
</mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<project-select [(project)]="selectedProject"></project-select>
|
<project-select [(project)]="selectedProject" [placeholder]="'project.chain' | translate"></project-select>
|
||||||
|
|
||||||
<mat-checkbox [(ngModel)]="project.public"
|
<mat-checkbox [(ngModel)]="project.public"
|
||||||
[disabled]="!authService.logged || !authService.account.tracker_admin"
|
[disabled]="!authService.logged || !authService.account.tracker_admin"
|
||||||
|
@ -1,14 +1,13 @@
|
|||||||
<mat-form-field appearance="outline" style="margin-top: 1em">
|
<mat-form-field appearance="outline" style="margin-top: 1em">
|
||||||
<mat-label>{{"project.manager_select" | translate}}</mat-label>
|
<mat-label>{{"console.worker_select" | translate}}</mat-label>
|
||||||
<mat-select [(ngModel)]="manager" (selectionChange)="managerChange.emit($event.value)"
|
<mat-select [(ngModel)]="manager" (selectionChange)="managerChange.emit($event.value)"
|
||||||
[placeholder]="'perms.manager_select' | translate"
|
[placeholder]="'project.manager_select' | translate"
|
||||||
(opened)="loadManagerList()">
|
(opened)="loadManagerList()">
|
||||||
<mat-select-trigger></mat-select-trigger>
|
<mat-select-trigger></mat-select-trigger>
|
||||||
<mat-option disabled *ngIf="managerList === undefined">
|
<mat-option disabled *ngIf="workerList === undefined">
|
||||||
{{"project_select.loading" | translate}}
|
{{"worker_select.loading" | translate}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
<mat-option *ngFor="let m of managerList" [value]="m">
|
<mat-option *ngFor="let m of workerList" [value]="m">
|
||||||
<mat-icon *ngIf="m.tracker_admin">supervisor_account</mat-icon>
|
|
||||||
<mat-icon *ngIf="!m.tracker_admin">person</mat-icon>
|
<mat-icon *ngIf="!m.tracker_admin">person</mat-icon>
|
||||||
{{m.username}}
|
{{m.username}}
|
||||||
</mat-option>
|
</mat-option>
|
||||||
|
@ -25,6 +25,4 @@ export class ManagerSelectComponent implements OnInit {
|
|||||||
this.apiService.getManagerList()
|
this.apiService.getManagerList()
|
||||||
.subscribe(data => this.managerList = data['content']['managers']);
|
.subscribe(data => this.managerList = data['content']['managers']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
13
web/angular/src/app/models/console.ts
Normal file
13
web/angular/src/app/models/console.ts
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import {Worker} from './worker';
|
||||||
|
import {Project} from './project';
|
||||||
|
|
||||||
|
export class SubmitTaskOptions {
|
||||||
|
public worker: Worker;
|
||||||
|
public project: Project;
|
||||||
|
public recipe: string;
|
||||||
|
public uniqueStr: string;
|
||||||
|
public maxAssignTime = 3600;
|
||||||
|
public verificationCount = 0;
|
||||||
|
public maxRetries = 3;
|
||||||
|
public priority = 1;
|
||||||
|
}
|
@ -41,7 +41,7 @@
|
|||||||
</button>
|
</button>
|
||||||
</mat-list-item>
|
</mat-list-item>
|
||||||
</mat-list>
|
</mat-list>
|
||||||
<p *ngIf="!accesses || accesses.length === 0">{{"perms.no_workers"|translate}}</p>
|
<p *ngIf="!accesses || accesses.length === 0">{{"perms.no_workers"|translate}}</p>
|
||||||
|
|
||||||
<h3>{{"perms.managers" | translate}}</h3>
|
<h3>{{"perms.managers" | translate}}</h3>
|
||||||
<manager-select (managerChange)="onSelectManager($event)"></manager-select>
|
<manager-select (managerChange)="onSelectManager($event)"></manager-select>
|
||||||
|
@ -28,7 +28,7 @@ export class ProjectPermsComponent implements OnInit {
|
|||||||
project: Project;
|
project: Project;
|
||||||
private projectId: number;
|
private projectId: number;
|
||||||
accesses: WorkerAccess[];
|
accesses: WorkerAccess[];
|
||||||
managerRoles: ManagerRoleOnProject;
|
managerRoles: ManagerRoleOnProject[];
|
||||||
unauthorized = false;
|
unauthorized = false;
|
||||||
moment = moment;
|
moment = moment;
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<mat-form-field appearance="outline" style="margin-top: 1em">
|
<mat-form-field appearance="outline" style="margin-top: 1em">
|
||||||
<mat-label>{{"project.chain" | translate}}</mat-label>
|
<mat-label>{{placeholder}}</mat-label>
|
||||||
<mat-select [(ngModel)]="project" (selectionChange)="projectChange.emit($event.value)"
|
<mat-select [(ngModel)]="project" (selectionChange)="projectChange.emit($event.value)"
|
||||||
[placeholder]="'project.chain' | translate"
|
[placeholder]="placeholder"
|
||||||
(opened)="loadProjectList()">
|
(opened)="loadProjectList()">
|
||||||
<mat-select-trigger>{{project?.name}}</mat-select-trigger>
|
<mat-select-trigger>{{project?.name}}</mat-select-trigger>
|
||||||
<mat-option disabled *ngIf="projectList === undefined">
|
<mat-option disabled *ngIf="projectList === undefined">
|
||||||
|
@ -12,6 +12,7 @@ export class ProjectSelectComponent implements OnInit {
|
|||||||
projectList: Project[];
|
projectList: Project[];
|
||||||
|
|
||||||
@Input() project: Project;
|
@Input() project: Project;
|
||||||
|
@Input() placeholder: string;
|
||||||
@Output() projectChange = new EventEmitter<Project>();
|
@Output() projectChange = new EventEmitter<Project>();
|
||||||
|
|
||||||
constructor(private apiService: ApiService) {
|
constructor(private apiService: ApiService) {
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
>
|
>
|
||||||
<mat-hint align="start">{{'project.git_repo_hint'|translate}}</mat-hint>
|
<mat-hint align="start">{{'project.git_repo_hint'|translate}}</mat-hint>
|
||||||
</mat-form-field>
|
</mat-form-field>
|
||||||
<project-select [(project)]="selectedProject"></project-select>
|
<project-select [(project)]="selectedProject" [placeholder]="'project.chain' | translate"></project-select>
|
||||||
<mat-form-field appearance="outline">
|
<mat-form-field appearance="outline">
|
||||||
<mat-label>{{"project.assign_rate"|translate}}</mat-label>
|
<mat-label>{{"project.assign_rate"|translate}}</mat-label>
|
||||||
<input matInput [(ngModel)]="project.assign_rate" name="assign_rate" type="number">
|
<input matInput [(ngModel)]="project.assign_rate" name="assign_rate" type="number">
|
||||||
|
@ -0,0 +1,3 @@
|
|||||||
|
.mat-form-field {
|
||||||
|
width: 100%;
|
||||||
|
}
|
@ -0,0 +1,15 @@
|
|||||||
|
<mat-form-field appearance="outline" style="margin-top: 1em">
|
||||||
|
<mat-label>{{"console.worker_select" | translate}}</mat-label>
|
||||||
|
<mat-select [(ngModel)]="worker" (selectionChange)="workerChange.emit($event.value)"
|
||||||
|
[placeholder]="'console.worker_select' | translate"
|
||||||
|
(opened)="loadWorkerList()">
|
||||||
|
<mat-select-trigger>{{worker?.alias}}</mat-select-trigger>
|
||||||
|
<mat-option disabled *ngIf="workerList === undefined">
|
||||||
|
{{"worker_select.loading" | translate}}
|
||||||
|
</mat-option>
|
||||||
|
<mat-option *ngFor="let w of workerList" [value]="w">
|
||||||
|
<span style="width: 3em; display: inline-block">{{w.id}}</span>
|
||||||
|
{{w.alias}}
|
||||||
|
</mat-option>
|
||||||
|
</mat-select>
|
||||||
|
</mat-form-field>
|
32
web/angular/src/app/worker-select/worker-select.component.ts
Normal file
32
web/angular/src/app/worker-select/worker-select.component.ts
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
import {Component, EventEmitter, Input, OnInit, Output} from '@angular/core';
|
||||||
|
import {ApiService} from '../api.service';
|
||||||
|
import {Manager} from '../models/manager';
|
||||||
|
import {Worker} from '../models/worker';
|
||||||
|
|
||||||
|
@Component({
|
||||||
|
selector: 'worker-select',
|
||||||
|
templateUrl: './worker-select.component.html',
|
||||||
|
styleUrls: ['./worker-select.component.css']
|
||||||
|
})
|
||||||
|
export class WorkerSelectComponent implements OnInit {
|
||||||
|
|
||||||
|
@Input() worker: Worker;
|
||||||
|
workerList: Worker[];
|
||||||
|
|
||||||
|
@Output()
|
||||||
|
workerChange = new EventEmitter<Worker>();
|
||||||
|
|
||||||
|
constructor(private apiService: ApiService) {
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnInit() {
|
||||||
|
}
|
||||||
|
|
||||||
|
loadWorkerList() {
|
||||||
|
this.apiService.getWorkerStats()
|
||||||
|
.subscribe(data => {
|
||||||
|
this.workerList = data['content']['stats'].sort((a, b) =>
|
||||||
|
(a.alias > b.alias) ? 1 : -1);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
@ -9,7 +9,8 @@
|
|||||||
"worker_dashboard": "Workers",
|
"worker_dashboard": "Workers",
|
||||||
"account": "Account",
|
"account": "Account",
|
||||||
"manager_list": "Managers",
|
"manager_list": "Managers",
|
||||||
"back": "Back"
|
"back": "Back",
|
||||||
|
"console": "Console"
|
||||||
},
|
},
|
||||||
"logs": {
|
"logs": {
|
||||||
"title": "Logs",
|
"title": "Logs",
|
||||||
@ -48,7 +49,8 @@
|
|||||||
"new_account": "Create account",
|
"new_account": "Create account",
|
||||||
"account": "Account details",
|
"account": "Account details",
|
||||||
"workers": "Workers",
|
"workers": "Workers",
|
||||||
"manager_list": "Managers"
|
"manager_list": "Managers",
|
||||||
|
"console": "Console"
|
||||||
},
|
},
|
||||||
"project": {
|
"project": {
|
||||||
"name": "Project name",
|
"name": "Project name",
|
||||||
@ -156,9 +158,12 @@
|
|||||||
"register_time": "Register date"
|
"register_time": "Register date"
|
||||||
},
|
},
|
||||||
"project_select": {
|
"project_select": {
|
||||||
"list_loading": "Loading project list...",
|
"loading": "Loading project list...",
|
||||||
"none": "None"
|
"none": "None"
|
||||||
},
|
},
|
||||||
|
"worker_select": {
|
||||||
|
"loading": "Loading worker list..."
|
||||||
|
},
|
||||||
"index": {
|
"index": {
|
||||||
"version": "Latest commit hash here",
|
"version": "Latest commit hash here",
|
||||||
"alias": "Relevent alias"
|
"alias": "Relevent alias"
|
||||||
@ -178,5 +183,19 @@
|
|||||||
"are_you_sure": "Are you sure?",
|
"are_you_sure": "Are you sure?",
|
||||||
"no": "No",
|
"no": "No",
|
||||||
"ok": "Ok"
|
"ok": "Ok"
|
||||||
|
},
|
||||||
|
"console": {
|
||||||
|
"title": "Console",
|
||||||
|
"subtitle": "Misc debugging operations",
|
||||||
|
"submit": "Manual task submit",
|
||||||
|
"worker_select": "Select worker",
|
||||||
|
"max_assign_time": "Maximum assign time (in seconds)",
|
||||||
|
"recipe": "Task recipe",
|
||||||
|
"unique_str": "Unique string (optionnal)",
|
||||||
|
"task_submit": "Submit task",
|
||||||
|
"verification_count": "Verification count",
|
||||||
|
"max_retries": "Maximum retries",
|
||||||
|
"priority": "Priority",
|
||||||
|
"submit_ok": "Task submitted"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,8 @@
|
|||||||
"worker_dashboard": "Workers",
|
"worker_dashboard": "Workers",
|
||||||
"account": "Compte",
|
"account": "Compte",
|
||||||
"manager_list": "Managers",
|
"manager_list": "Managers",
|
||||||
"back": "Retour"
|
"back": "Retour",
|
||||||
|
"console": "Console"
|
||||||
},
|
},
|
||||||
"logs": {
|
"logs": {
|
||||||
"title": "Journaux",
|
"title": "Journaux",
|
||||||
@ -49,7 +50,8 @@
|
|||||||
"new_account": "Création de compte",
|
"new_account": "Création de compte",
|
||||||
"account": "Compte",
|
"account": "Compte",
|
||||||
"workers": "Workers",
|
"workers": "Workers",
|
||||||
"manager_list": "Managers"
|
"manager_list": "Managers",
|
||||||
|
"console": "Console"
|
||||||
},
|
},
|
||||||
"project": {
|
"project": {
|
||||||
"name": "Nom du projet",
|
"name": "Nom du projet",
|
||||||
@ -153,9 +155,12 @@
|
|||||||
"register_time": "Date d'inscription"
|
"register_time": "Date d'inscription"
|
||||||
},
|
},
|
||||||
"project_select": {
|
"project_select": {
|
||||||
"list_loading": "Chargement de la liste de projets...",
|
"loading": "Chargement de la liste de projets...",
|
||||||
"none": "Aucun"
|
"none": "Aucun"
|
||||||
},
|
},
|
||||||
|
"worker_select": {
|
||||||
|
"loading": "Chargement de la liste de worker..."
|
||||||
|
},
|
||||||
"index": {
|
"index": {
|
||||||
"version": "Le dernier hash de commit",
|
"version": "Le dernier hash de commit",
|
||||||
"alias": "Alias pertinent"
|
"alias": "Alias pertinent"
|
||||||
@ -169,6 +174,20 @@
|
|||||||
"secret": "Secret",
|
"secret": "Secret",
|
||||||
"update": "Mettre à jour",
|
"update": "Mettre à jour",
|
||||||
"ok": "Mis à jour"
|
"ok": "Mis à jour"
|
||||||
|
},
|
||||||
|
"console": {
|
||||||
|
"title": "Console",
|
||||||
|
"subtitle": "Opération diverses",
|
||||||
|
"submit": "Soumission de tâches manuelle",
|
||||||
|
"worker_select": "Selectionner un Worker",
|
||||||
|
"max_assign_time": "Temps maximum d'execution",
|
||||||
|
"recipe": "Contenu de la tâcheu",
|
||||||
|
"unique_str": "Chaine de charactères unique",
|
||||||
|
"task_submit": "Soumettre",
|
||||||
|
"verification_count": "Nombre de vérification",
|
||||||
|
"max_retries": "Nombre maximal d'essai",
|
||||||
|
"priority": "Priorité",
|
||||||
|
"submit_ok": "Tâche soummise"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user