Update message to download & install xds-agent.
authorSebastien Douheret <sebastien.douheret@iot.bzh>
Wed, 13 Sep 2017 20:37:50 +0000 (22:37 +0200)
committerSebastien Douheret <sebastien.douheret@iot.bzh>
Wed, 13 Sep 2017 20:38:15 +0000 (22:38 +0200)
Signed-off-by: Sebastien Douheret <sebastien.douheret@iot.bzh>
webapp/src/app/config/downloadXdsAgent.component.ts
webapp/src/app/services/config.service.ts

index 7a08174..b35a17f 100644 (file)
@@ -4,6 +4,7 @@ import { IxdsAgentPackage } from "../services/config.service";
 
 @Component({
     selector: 'dl-xds-agent',
+    /* XXX - cleanup
     template: `
         <template #popTemplate>
             <h3>Download xds-agent packages:</h3>
@@ -20,6 +21,26 @@ import { IxdsAgentPackage } from "../services/config.service";
             placement="left">
         </button>
     `,
+*/
+    template: `
+        <template #popTemplate>
+            <h3>Install xds-agent:</h3>
+            <ul>
+                <li>On Linux machine <a href="{{url_OS_Linux}}" target="_blank">
+                <span class="fa fa-external-link"></span></a></li>
+
+                <li>On Windows machine <a href="{{url_OS_Other}}" target="_blank"><span class="fa fa-external-link"></span></a></li>
+
+                <li>On MacOS machine <a href="{{url_OS_Other}}" target="_blank"><span class="fa fa-external-link"></span></a></li>
+            </ul>
+            <button type="button" class="btn btn-sm" (click)="pop.hide()"> Cancel </button>
+        </template>
+        <button type="button" class="btn btn-link fa fa-download fa-size-x2"
+            [popover]="popTemplate"
+            #pop="bs-popover"
+            placement="left">
+        </button>
+        `,
     styles: [`
         .fa-size-x2 {
             font-size: 20px;
@@ -31,6 +52,8 @@ export class DlXdsAgentComponent {
 
     @Input() packageUrls: IxdsAgentPackage[];
 
+    public url_OS_Linux = "https://en.opensuse.org/LinuxAutomotive#Installation_AGL_XDS";
+    public url_OS_Other = "https://github.com/iotbzh/xds-agent#how-to-install-on-other-platform";
 }
 
 @Pipe({
index 138e0fb..98dec34 100644 (file)
@@ -189,16 +189,19 @@ export class ConfigService {
 
             }, error => {
                 if (error.indexOf("XDS local Agent not responding") !== -1) {
-                    let msg = "<span><strong>" + error + "<br></strong>";
-                    msg += "You may need to download and execute XDS-Agent.<br>";
-
-                    let os = this.utils.getOSName(true);
-                    let zurl = this.confStore.xdsAgentPackages && this.confStore.xdsAgentPackages.filter(elem => elem.os === os);
-                    if (zurl && zurl.length) {
-                        msg += " Download XDS-Agent tarball for " + zurl[0].os + " host OS ";
-                        msg += "<a class=\"fa fa-download\" href=\"" + zurl[0].url + "\" target=\"_blank\"></a>";
-                    }
-                    msg += "</span>";
+                    let url_OS_Linux = "https://en.opensuse.org/LinuxAutomotive#Installation_AGL_XDS";
+                    let url_OS_Other = "https://github.com/iotbzh/xds-agent#how-to-install-on-other-platform";
+                    let msg = `<span><strong>` + error + `<br></strong>
+                    You may need to install and execute XDS-Agent: <br>
+                        On Linux machine <a href="` + url_OS_Linux + `" target="_blank"><span
+                            class="fa fa-external-link"></span></a>
+                        <br>
+                        On Windows machine <a href="` + url_OS_Other + `" target="_blank"><span
+                            class="fa fa-external-link"></span></a>
+                        <br>
+                        On MacOS machine <a href="` + url_OS_Other + `" target="_blank"><span
+                            class="fa fa-external-link"></span></a>
+                    `;
                     this.alert.error(msg);
                 } else {
                     this.alert.error(error);