8000 feat(ui): cdsctl page by yesnault · Pull Request #3787 · ovh/cds · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(ui): cdsctl page #3787

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Dec 31, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ui/src/app/views/navbar/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,7 @@
</sm-select>
<sm-dropdown icon="settings" *ngIf="currentUser">
<a sm-item href="#" [routerLink]="['settings', 'user', currentUser.username]">{{ 'navbar_profile' | translate }}</a>
<a sm-item href="#" [routerLink]="['settings', 'cdsctl']">{{ 'navbar_cdsctl' | translate }}</a>
<a sm-item href="#" [routerLink]="['settings', 'action']">{{ 'navbar_actions' | translate }}</a>
<a sm-item *ngIf="currentUser.admin" href="#" [routerLink]="['settings', 'user']">{{ 'navbar_users' | translate }}</a>
<a sm-item href="#" [routerLink]="['settings', 'group']">{{ 'navbar_groups' | translate }}</a>
Expand Down
68 changes: 68 additions & 0 deletions ui/src/app/views/settings/cdsctl/cdsctl.component.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import { Component, } from '@angular/core';
import { TranslateService } from '@ngx-translate/core';
import { environment } from '../../../../environments/environment';
import { User } from '../../../model/user.model';
import { AuthentificationStore } from '../../../service/auth/authentification.store';
import { PathItem } from '../../../shared/breadcrumb/breadcrumb.component';


@Component({
selector: 'app-cdsctl',
templateUrl: './cdsctl.html',
styleUrls: ['./cdsctl.scss']
})
export class CdsctlComponent {
currentUser: User;
apiURL: string;
arch: Array<string>;
os: Array<string>;
path: Array<PathItem>;
codeMirrorConfig: any;
tutorials: Array<string> = new Array();
osChoice: string;
archChoice: string;

constructor(
private _authentificationStore: AuthentificationStore,
private _translate: TranslateService
) {
this.codeMirrorConfig = {
matchBrackets: true,
autoCloseBrackets: true,
mode: 'shell',
lineWrapping: true,
autoRefresh: true,
readOnly: true,
lineNumbers: true
};

this.os = new Array<string>('windows', 'linux', 'darwin', 'freebsd');
this.arch = new Array<string>('amd64', '386');
this.osChoice = 'linux';
this.archChoice = 'amd64'
this.currentUser = this._authentificationStore.getUser();
this.apiURL = environment.apiURL;

this.buildData();
}

buildData(): void {
this.tutorials['part1'] = this._translate.instant('cdsctl_part_1',
{apiURL: this.apiURL, osChoice: this.osChoice, archChoice: this.archChoice});
this.tutorials['part2'] = this._translate.instant('cdsctl_part_2',
{apiURL: this.apiURL, username: this.currentUser.username});
this.tutorials['part3'] = this._translate.instant('cdsctl_part_3');
this.tutorials['part4'] = this._translate.instant('cdsctl_part_4');
this.tutorials['part5'] = this._translate.instant('cdsctl_part_5');
this.tutorials['part6'] = this._translate.instant('cdsctl_part_6');
this.tutorials['part7'] = this._translate.instant('cdsctl_part_7');
this.tutorials['part8'] = this._translate.instant('cdsctl_part_8');

this.path = [<PathItem>{
translate: 'common_settings'
}, <PathItem>{
translate: 'navbar_cdsctl',
routerLink: ['/', 'settings', 'cdsctl']
}];
}
}
141 changes: 141 additions & 0 deletions ui/src/app/views/settings/cdsctl/cdsctl.html
8000
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
<div class="wrapper">
<app-breadcrumb [path]="path"></app-breadcrumb>
<app-scrollview class="scrollview">

<div class="ui info message">
<b>cdsctl</b> {{ 'cdsctl_info_title' | translate }}
<ul>
<li>{{ 'cdsctl_info_list_1' | translate }}</li>
<li>{{ 'cdsctl_info_list_2' | translate }}</li>
<li>{{ 'cdsctl_info_list_3' | translate }}</li>
<li>{{ 'cdsctl_info_list_4' | translate }}</li>
</ul>
</div>

<h1>{{ 'cdsctl_title_1' | translate }}</h1>

<div class="ui form">
<div class="ui grid">
<div class="four wide column">
<div class="grouped fields">
<label for="os">{{ 'cdsctl_choice_os' | translate }}</label>
<ng-container *ngFor="let o of os">
<div class="field">
<div class="ui radio checkbox">
<sui-radio-button type="radio" id="os-{{a}}" name="os" [value]="o" [(ngModel)]="osChoice" (ngModelChange)="buildData()">
{{o}}
</sui-radio-button>
</div>
</div>
</ng-container>
</div>
< 8000 /td> </div>
<div class="four wide column">
<div class="grouped fields">
<label for="arch">{{ 'cdsctl_choice_arch' | translate }}</label>
<ng-container *ngFor="let a of arch">
<div class="field">
<div class="ui radio checkbox">
<sui-radio-button type="radio" id="arch-{{a}}" name="arch" [value]="a" [(ngModel)]="archChoice" (ngModelChange)="buildData()">
{{a}}
</sui-radio-button>
</div>
</div>
</ng-container>
</div>
</div>
</div>
</div>

<codemirror
[(ngModel)]="tutorials['part1']"
[config]="codeMirrorConfig"
#textareaCodeMirror>
</codemirror>

<div class="ui info message">
{{ 'cdsctl_notice' | translate }}
<ul>
<li>{{ 'cdsctl_notice_1_1' | translate }}<a href="" [routerLink]="['/settings', 'downloads']">{{ 'downloads_title' | translate }}</a>
<li>{{ 'cdsctl_notice_1_2' | translate }}</li>
</ul>
</div>

<h1>{{ 'cdsctl_title_2' | translate }}</h1>

<codemirror
[(ngModel)]="tutorials['part2']"
[config]="codeMirrorConfig"
#textareaCodeMirror>
</codemirror>

<div class="ui info message">
{{ 'cdsctl_notice' | translate }}
<ul>
<li>{{ 'cdsctl_notice_2_1' | translate }} {{currentUser.username}}`</li>
<li>{{ 'cdsctl_notice_2_2' | translate }} `CDS_API_URL="{{apiURL}}" CDS_USER="{{currentUser.username}}" CDS_TOKEN="yourtoken" cdsctl [command]`</li>
<li>{{ 'cdsctl_notice_2_3' | translate }} `CDS_VERBOSE=true ./cdsctl [command]`</li>
</ul>
</div>

<h1>{{ 'cdsctl_title_3' | translate }}</h1>

<codemirror
[(ngModel)]="tutorials['part3']"
[config]="codeMirrorConfig"
#textareaCodeMirror>
</codemirror>

<h1>{{ 'cdsctl_title_4' | translate }}</h1>

<codemirror
[(ngModel)]="tutorials['part4']"
[config]="codeMirrorConfig"
#textareaCodeMirror>
</codemirror>

<h1>{{ 'cdsctl_title_5' | translate }}</h1>

<codemirror
[(ngModel)]="tutorials['part5']"
[config]="codeMirrorConfig"
#textareaCodeMirror>
</codemirror>

<h1>{{ 'cdsctl_title_6' | translate }}</h1>

{{ 'cdsctl_title_6_info_1' | translate }}
(<a href="https://ovh.github.io/cds/workflows/design/hooks/git-repo-webhook/">Git Repository Webhook</a>).
{{ 'cdsctl_title_6_info_2' | translate }}

<codemirror
[(ngModel)]="tutorials['part6']"
[config]="codeMirrorConfig"
#textareaCodeMirror>
</codemirror>

<div class="ui info message">
{{ 'cdsctl_notice' | translate }}
<ul>
<li>{{ 'cdsctl_notice_6_1' | translate }}</li>
</ul>
</div>

<h1>{{ 'cdsctl_title_7' | translate }}</h1>

<codemirror
[(ngModel)]="tutorials['part7']"
[config]="codeMirrorConfig"
#textareaCodeMirror>
</codemirror>

<h1>{{ 'cdsctl_title_8' | translate }}</h1>

<codemirror
[(ngModel)]="tutorials['part8']"
[config]="codeMirrorConfig"
#textareaCodeMirror>
</codemirror>

</app-scrollview>
</div>
4 changes: 4 additions & 0 deletions ui/src/app/views/settings/cdsctl/cdsctl.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@import '../../../../common';
.scrollview {
margin-bottom: 1em;
}
2 changes: 2 additions & 0 deletions ui/src/app/views/settings/settings.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4 9E88 ,7 @@ import { SharedModule } from '../../shared/shared.module';
import { ActionAddComponent } from './action/add/action.add.component';
import { ActionEditComponent } from './action/edit/action.edit.component';
import { ActionListComponent } from './action/list/action.list.component';
import { CdsctlComponent } from './cdsctl/cdsctl.component';
import { DownloadComponent } from './download/download.component';
import { GroupEditComponent } from './group/edit/group.edit.component';
import { GroupListComponent } from './group/list/group.list.component';
Expand All @@ -27,6 +28,7 @@ import { WorkflowTemplateListComponent } from './workflow-template/list/workflow
ActionAddComponent,
ActionEditComponent,
ActionListComponent,
CdsctlComponent,
DownloadComponent,
GroupEditComponent,
GroupListComponent,
Expand Down
2 changes: 2 additions & 0 deletions ui/src/app/views/settings/settings.routing.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { CanActivateAuthRoute } from '../../service/auth/authenRouteActivate';
import { ActionAddComponent } from './action/add/action.add.component';
import { ActionEditComponent } from './action/edit/action.edit.component';
import { ActionListComponent } from './action/list/action.list.component';
import { CdsctlComponent } from './cdsctl/cdsctl.component';
import { DownloadComponent } from './download/download.component';
import { GroupEditComponent } from './group/edit/group.edit.component';
import { GroupListComponent } from './group/list/group.list.component';
Expand All @@ -26,6 +27,7 @@ const routes: Routes = [
canActivate: [CanActivateAuthRoute],
children: [
{ path: 'profile/:username', component: UserEditComponent, data: { title: 'Profile' } },
{ path: 'cdsctl', component: CdsctlComponent, data: { title: 'Cdsctl' } },
{ path: 'worker-model', component: WorkerModelListComponent, data: { title: 'Worker model' } },
{ path: 'worker-model/add', component: WorkerModelAddComponent, data: { title: 'Add • Worker model' } },
{
Expand Down
43 changes: 43 additions & 0 deletions ui/src/assets/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,48 @@
"btn_edit": "Edit",
"btn_add": "Add",
"btn_back": "Back",

"cdsctl_choice_os": "Choose your OS",
"cdsctl_choice_arch": "Choose your architecture",

"cdsctl_part_1": "curl {{apiURL}}/download/cdsctl/{{osChoice}}/{{archChoice}} -o cdsctl\n\n# add execution rights on cdsctl\nchmod +x cdsctl\n\n# check if binary is ok, this command will display cdsctl version\n./cdsctl version",
"cdsctl_part_2": "# The cdsctl login command will store credentials in your keychain\n./cdsctl login --api-url {{apiURL}} -u {{username}}\n\n# this command will display your username, fullname, email\n# if you see them, cdsctl is well configured\n./cdsctl user me",
"cdsctl_part_3": "# The cdsctl shell to browse your projects and workflows without the need to open a browser.\n# see https://ovh.github.io/cds/cli/cdsctl/shell/\ncdsctl shell\n\n# Display monitoring view\ncdsctl ui\n\n# help is available on each cdsctl command\ncdsctl --help",
"cdsctl_part_4": "# Launch a workflow, consider running cdsctl from a directory containing a git repository known from CDS\ncdsctl workflow run\n\n# You can explicitly set a projet and workflow\ncdsctl workflow run PRJ_KEY WORKFLOW_NAME\n\n# flags --interactive or --open-web-browser may interest you, help for all details\ncdsctl workflow run --help",
"cdsctl_part_5": "# Check status of a run\ncdsctl workflow status\n\n# --track command will wait the end of the workflow run\ncdsctl workflow status --track",
"cdsctl_part_6": "# Add a git alias in your gitconfig file\n$ cat ~/.gitconfig\n[alias]\n track = !cdsctl workflow status --track",
"cdsctl_part_7": "# Update from current CDS Platform\ncdsctl update\n\n# Update from latest release on github\ncdsctl update --from-github",
"cdsctl_part_8": "# All commands have the flag --format. This is useful for use cdsctl in your script\n# Formats available: table, json, yaml\ncdsctl user list --format json",

"cdsctl_info_title": "is the CDS Command Line tool. It has the same features, and even more than the web ui. It allows you to do everything:",

"cdsctl_info_list_1": "Administrate users, groups, actions, worker models, workflow templates, ...",
"cdsctl_info_list_2": "Manage your projects, workflows, applications, environments, ...",
"cdsctl_info_list_3": "Monitore & operate your CDS platform",
"cdsctl_info_list_4": "Script everything",

"cdsctl_title_1": "1 - Download cdsctl",
"cdsctl_title_2": "2 - Login",
"cdsctl_title_3": "3 - Play with cdsctl",
"cdsctl_title_4": "4 - Run a workflow",
"cdsctl_title_5": "5 - Check the workflow status",
"cdsctl_title_6": "6 - Git Track",
"cdsctl_title_7": "7 - Update cdsctl",
"cdsctl_title_8": "8 - Scripting",

"cdsctl_notice_1_1": "Binaries available on current installation: ",
"cdsctl_notice_1_2": "By default, the command line cdsctl uses your keychain on your os, you can bypass it by using '386' instead of 'amd64'",

"cdsctl_notice_2_1": "If you use many instances of CDS, you can use the -f flag, example: `./cdsctl -f .cds/anotherInstance login --api-url http://another-instance:8081 -u ",
"cdsctl_notice_2_2": "ByPass Keychain or file configuration:",
"cdsctl_notice_2_3": "Want to debug something? You can use CDS_VERBOSE environment variable:",

"cdsctl_notice_6_1": "By setting this new alias in your gitconfig file, you can now use: git push && git track",

"cdsctl_title_6_info_1": "Imagine now that you develop something and you have a CDS Workflow triggered on each git push",
"cdsctl_title_6_info_2": "The `git track` alias allows you to see the workflow status without opening a browser.",

"cdsctl_notice": "Notice:",

"commit_author": "Author",
"commit_id": "ID",
Expand Down Expand Up @@ -445,6 +487,7 @@
"navbar_groups": "Groups",
"navbar_home": "Home Page",
"navbar_profile": "Profile",
"navbar_cdsctl": "Command Line cdsctl",
"navbar_projects_placeholder": "All Projects",
"navbar_projects": "Projects",
"navbar_favorites": "Bookmarks",
Expand Down
49 changes: 46 additions & 3 deletions ui/src/assets/i18n/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,48 @@
"btn_add": "Ajouter",
"btn_back": "Retour",

"cdsctl_choice_os": "Choisissez votre système d'exploitation",
"cdsctl_choice_arch": "Choisissez votre architecture",

"cdsctl_part_1": "curl {{apiURL}}/download/cdsctl/{{osChoice}}/{{archChoice}} -o cdsctl\n\n# ajoutez les droits EXEC sur cdsctl\nchmod +x cdsctl\n\n# vérifiez que le binaire est ok, cette commande affiche la version du binaire\n./cdsctl version",
"cdsctl_part_2": "# La commande cdsctl login enregistre dans votre trousseau votre mot de passe\n./cdsctl login --api-url {{apiURL}} -u {{username}}\n\n# cette command affiche votre nom d'utilisateur, nom complet, adresse mail\n# si vous les voyez, c'est que cdsctl est bien configuré\n./cdsctl user me",
"cdsctl_part_3": "# La commande cdsctl shell permet de naviguer dans vos projets et vos workflows sans avoir besoin d'ouvrir un navigateur.\n# voir https://ovh.github.io/cds/cli/cdsctl/shell/\ncdsctl shell\n\n# Affiche la vue de monitoring\ncdsctl ui\n\n# l'aide est disponible sur chaque commande cdsctl\ncdsctl --help",
"cdsctl_part_4": "# Démarre un workflow, en considérant que cette commande est lancée à partir d'un dépôt git connu de CDS\ncdsctl workflow run\n\n# Vous pouvez explicitement renseigner le projet et le workflow\ncdsctl workflow run PRJ_KEY WORKFLOW_NAME\n\n# flags --interactive ou --open-web-browser peuvdent vous intéresser, l'aide contient tous les détails\ncdsctl workflow run --help",
"cdsctl_part_5": "# Vérifiez le statut d'un run\ncdsctl workflow status\n\n# le flag --track permet d'attendre la fin de l'exécution du workflow\ncdsctl workflow status --track",
"cdsctl_part_6": "# Ajoutez un alias git dans votre fichier gitconfig\n$ cat ~/.gitconfig\n[alias]\n track = !cdsctl workflow status --track",
"cdsctl_part_7": "# Mettez à jour votre binaire cdsctl depuis votre plateforme CDS\ncdsctl update\n\n# Mettez à jour depuis la dernière release disponible sur github\ncdsctl update --from-github",
"cdsctl_part_8": "# Toutes les commandes ont un flag --format. Ceci facilite l'usage de cdsctl dans vos scripts\n# Formats disponibles: table, json, yaml\ncdsctl user list --format json",

"cdsctl_info_title": "est l'outil de Ligne de Commande CDS. Cet outil contient toutes les fonctionnalités disponibles dans l'interface web, et même plus. Il vous permet par exemple de:",

"cdsctl_info_list_1": "Gérer vos utilisateurs, vos groupes, vos actions, vos worker models, vos templates de workflow, ...",
"cdsctl_info_list_2": "Gérer vos projets, vos workflows, vos applications, vos environnements, ...",
"cdsctl_info_list_3": "Monitorer & administrer votre plateforme CDS",
"cdsctl_info_list_4": "Automatiser n'importe quelle tâche (administation, utilisation...)",

"cdsctl_title_1": "1 - Télécharger CDSCTL",
"cdsctl_title_2": "2 - Login",
"cdsctl_title_3": "3 - Premiers pas avec cdsctl",
"cdsctl_title_4": "4 - Lancer un workflow",
"cdsctl_title_5": "5 - Vérifier le statut d'un workflow",
"cdsctl_title_6": "6 - Git Track",
"cdsctl_title_7": "7 - Mettre à jour cdsctl",
"cdsctl_title_8": "8 - Automatisation",

"cdsctl_notice_1_1": "Binaires disponibles sur cette instance de CDS: ",
"cdsctl_notice_1_2": "Par défaut, cdsctl utilise le trousseau disponible sur votre système d'exploitation. Vous pouvez ne pas l'utiliser en utilisant la version '386' au lieu de la version 'amd64'",

"cdsctl_notice_2_1": "Si vous avez plusieurs instances de CDS, vous pouvez utiliser le flag -f, exemple: `./cdsctl -f .cds/anotherInstance login --api-url http://another-instance:8081 -u ",
"cdsctl_notice_2_2": "Ne pas utiliser le secret en provenance du trousseau ou d'un fichier de configuration:",
"cdsctl_notice_2_3": "Vous souhaitez débugger quelque chose ? Vous pouvez utiliser la variable d'environnement CDS_VERBOSE:",

"cdsctl_notice_6_1": "Après avoir ajouté cet alias dans votre fichier gitconfig, vous pouvez maintenant utiliser: git push && git track",

"cdsctl_title_6_info_1": "Imaginez maintenant que vous développiez quelque chose et que vous avez un workflow CDS lancé à chaque git push",
"cdsctl_title_6_info_2": "La commande `git track` permet de voir dans votre console le statut du workflow en cours, sans voir besoin d'ouvrir un navigateur web.",

"cdsctl_notice": "À noter:",

"commit_author": "Auteur",
"commit_id": "ID",
"commit_message": "Message",
Expand Down Expand Up @@ -232,7 +274,7 @@
"common_platform": "Plateforme",
"common_project_title": "Projet : ",
"common_requirements": "Pré-requis",
"common_status": "Status",
"common_status": "Statut",
"common_test": "Test",
"common_tests": "Tests",
"common_trigger_by": "Déclenché par",
Expand Down Expand Up @@ -445,6 +487,7 @@
"navbar_groups": "Groupes",
"navbar_home": "Accueil",
"navbar_profile": "Votre Compte",
"navbar_cdsctl": "Ligne de commande cdsctl",
"navbar_projects_placeholder": "Tous les projets",
"navbar_projects": "Projets",
"navbar_favorites": "Favoris",
Expand Down Expand Up @@ -704,8 +747,8 @@
"service_view_details": "Voir les details",
"service_details": "Service",
"service_group": "Groupe",
"service_alert": "Status Alert - vérifier le status ci-dessous",
"service_warning": "Status Warning - vérifier le status ci-dessous",
"service_alert": "Status Alert - vérifier le statut ci-dessous",
"service_warning": "Status Warning - vérifier le statut ci-dessous",
"service_ok": "Status OK - tout est ok",

"stage_add_label": "Ajouter un stage",
Expand Down
0