aboutsummaryrefslogtreecommitdiffstats
path: root/webapp
diff options
context:
space:
mode:
authorSebastien Douheret <sebastien.douheret@iot.bzh>2017-05-27 23:11:04 +0200
committerSebastien Douheret <sebastien.douheret@iot.bzh>2017-05-27 23:11:04 +0200
commiteafe4283b476d1122be6920a7b5d78a94babdc91 (patch)
tree7251c19ef5abac110d5018a8d9204af140e5f7b5 /webapp
parent330cffa06c3efea42a42ca8e908b8b24db6bba3f (diff)
Improved devel/build panel (support PreBuild/Build/Populate)
Diffstat (limited to 'webapp')
-rw-r--r--webapp/src/app/devel/build/build.component.css4
-rw-r--r--webapp/src/app/devel/build/build.component.html46
-rw-r--r--webapp/src/app/devel/build/build.component.ts34
-rw-r--r--webapp/src/app/devel/devel.component.html3
-rw-r--r--webapp/src/app/services/config.service.ts2
5 files changed, 76 insertions, 13 deletions
diff --git a/webapp/src/app/devel/build/build.component.css b/webapp/src/app/devel/build/build.component.css
index 6784a9f..92f953e 100644
--- a/webapp/src/app/devel/build/build.component.css
+++ b/webapp/src/app/devel/build/build.component.css
@@ -25,6 +25,10 @@
border: none;
}
+.table-in-accordion>tbody>tr>th {
+ width: 30%
+}
+
.btn-large {
width: 10em;
}
diff --git a/webapp/src/app/devel/build/build.component.html b/webapp/src/app/devel/build/build.component.html
index f4be204..7f85aa6 100644
--- a/webapp/src/app/devel/build/build.component.html
+++ b/webapp/src/app/devel/build/build.component.html
@@ -25,12 +25,45 @@
<td> <input type="text" style="width:99%;" formControlName="subpath"> </td>
</tr>
<tr>
- <th>Command arguments</th>
- <td> <input type="text" style="width:99%;" formControlName="cmdArgs"> </td>
- </tr>
- <tr>
- <th>Env variables</th>
- <td> <input type="text" style="width:99%;" formControlName="envVars"> </td>
+ <td colspan="2">
+ <accordion>
+ <accordion-group #group>
+ <div accordion-heading>
+ Advanced Settings
+ <i class="pull-right float-xs-right fa" [ngClass]="{'fa-chevron-down': group.isOpen, 'fa-chevron-right': !group.isOpen}"></i>
+ </div>
+
+ <table class="table table-borderless table-in-accordion">
+ <tbody>
+ <tr>
+ <th>Clean Command</th>
+ <td> <input type="text" style="width:99%;" formControlName="cmdClean"> </td>
+ </tr>
+ <tr>
+ <th>Pre-Build Command</th>
+ <td> <input type="text" style="width:99%;" formControlName="cmdPrebuild"> </td>
+ </tr>
+ <tr>
+ <th>Build Command</th>
+ <td> <input type="text" style="width:99%;" formControlName="cmdBuild"> </td>
+ </tr>
+ <tr>
+ <th>Populate Command</th>
+ <td> <input type="text" style="width:99%;" formControlName="cmdPopulate"> </td>
+ </tr>
+ <tr>
+ <th>Env variables</th>
+ <td> <input type="text" style="width:99%;" formControlName="envVars"> </td>
+ </tr>
+ <tr *ngIf="debugEnable">
+ <th>Args variables</th>
+ <td> <input type="text" style="width:99%;" formControlName="cmdArgs"> </td>
+ </tr>
+ </tbody>
+ </table>
+ </accordion-group>
+ </accordion>
+ </td>
</tr>
</tbody>
</table>
@@ -38,6 +71,7 @@
<div class="row">
<div class="col-xs-12 text-center">
<div class="btn-group blocks">
+ <button class="btn btn-primary btn-large" (click)="clean()" [disabled]="!curProject ">Clean</button>
<button class="btn btn-primary btn-large" (click)="preBuild()" [disabled]="!curProject">Pre-Build</button>
<button class="btn btn-primary btn-large" (click)="build()" [disabled]="!curProject">Build</button>
<button class="btn btn-primary btn-large" (click)="populate()" [disabled]="!curProject ">Populate</button>
diff --git a/webapp/src/app/devel/build/build.component.ts b/webapp/src/app/devel/build/build.component.ts
index b7003b1..449c557 100644
--- a/webapp/src/app/devel/build/build.component.ts
+++ b/webapp/src/app/devel/build/build.component.ts
@@ -43,12 +43,28 @@ export class BuildComponent implements OnInit, AfterViewChecked {
this.cmdInfo = ""; // TODO: to be remove (only for debug)
this.buildForm = fb.group({
subpath: this.subpathCtrl,
+ cmdClean: ["", Validators.nullValidator],
+ cmdPrebuild: ["", Validators.nullValidator],
+ cmdBuild: ["", Validators.nullValidator],
+ cmdPopulate: ["", Validators.nullValidator],
cmdArgs: ["", Validators.nullValidator],
envVars: ["", Validators.nullValidator],
});
}
ngOnInit() {
+ // Set default settings
+ // TODO save & restore values from cookies
+ this.buildForm.patchValue({
+ subpath: "",
+ cmdClean: "rm -rf build",
+ cmdPrebuild: "mkdir -p build && cd build && cmake ..",
+ cmdBuild: "cd build && make",
+ cmdPopulate: "cd build && make remote-target-populate",
+ cmdArgs: "",
+ envVars: "",
+ });
+
// Command output data tunneling
this.xdsSvr.CmdOutput$.subscribe(data => {
this.cmdOutput += data.stdout + "\n";
@@ -69,7 +85,7 @@ export class BuildComponent implements OnInit, AfterViewChecked {
this._scrollToBottom();
// only use for debug
- this.debugEnable = (this.cookie.get("debug_build") !== "");
+ this.debugEnable = (this.cookie.get("debug_build") === "1");
}
ngAfterViewChecked() {
@@ -80,9 +96,17 @@ export class BuildComponent implements OnInit, AfterViewChecked {
this.cmdOutput = '';
}
+ clean() {
+ this._exec(
+ this.buildForm.value.cmdClean,
+ this.buildForm.value.subpath,
+ [],
+ this.buildForm.value.envVars);
+ }
+
preBuild() {
this._exec(
- "mkdir -p build && cd build && cmake ..",
+ this.buildForm.value.cmdPrebuild,
this.buildForm.value.subpath,
[],
this.buildForm.value.envVars);
@@ -90,16 +114,16 @@ export class BuildComponent implements OnInit, AfterViewChecked {
build() {
this._exec(
- "cd build && make",
+ this.buildForm.value.cmdBuild,
this.buildForm.value.subpath,
- this.buildForm.value.cmdArgs,
+ [],
this.buildForm.value.envVars
);
}
populate() {
this._exec(
- "SEB_TODO_script_populate",
+ this.buildForm.value.cmdPopulate,
this.buildForm.value.subpath,
[], // args
this.buildForm.value.envVars
diff --git a/webapp/src/app/devel/devel.component.html b/webapp/src/app/devel/devel.component.html
index 5950f51..feac413 100644
--- a/webapp/src/app/devel/devel.component.html
+++ b/webapp/src/app/devel/devel.component.html
@@ -25,7 +25,8 @@
</div>
<div class="row">
- <div class="col-md-8">
+ <!--<div class="col-md-8">-->
+ <div class="col-md-12">
<panel-build [curProject]=curPrj></panel-build>
</div>
<!-- TODO: disable for now
diff --git a/webapp/src/app/services/config.service.ts b/webapp/src/app/services/config.service.ts
index 390340a..9b9f5db 100644
--- a/webapp/src/app/services/config.service.ts
+++ b/webapp/src/app/services/config.service.ts
@@ -118,7 +118,7 @@ export class ConfigService {
this.confStore.xdsAgentZipUrl = "";
this.xdsServerSvr.getXdsAgentInfo().subscribe(nfo => {
let os = this.utils.getOSName(true);
- let zurl = nfo.tarballs.filter(elem => elem.os === os);
+ let zurl = nfo.tarballs && nfo.tarballs.filter(elem => elem.os === os);
if (zurl && zurl.length) {
this.confStore.xdsAgentZipUrl = zurl[0].fileUrl;
this.confSubject.next(Object.assign({}, this.confStore));