diff --git a/boto.txt b/boto.txt new file mode 100644 index 0000000..515eeb3 --- /dev/null +++ b/boto.txt @@ -0,0 +1,2 @@ +boto3==1.9.28 +requests==2.18.4 \ No newline at end of file diff --git a/chat-ops-ui/.gitignore b/chat-ops-ui/.gitignore index ee5c9d8..821f02b 100644 --- a/chat-ops-ui/.gitignore +++ b/chat-ops-ui/.gitignore @@ -33,6 +33,7 @@ npm-debug.log yarn-error.log testem.log /typings +.htpasswd # System Files .DS_Store diff --git a/chat-ops-ui/Dockerfile b/chat-ops-ui/Dockerfile new file mode 100644 index 0000000..8aef3bf --- /dev/null +++ b/chat-ops-ui/Dockerfile @@ -0,0 +1,8 @@ +FROM nginx:latest + +RUN mkdir /etc/nginx/ssl +ADD /chat-ops.key /etc/nginx/ssl/chat-ops.key +ADD /chat-ops.crt /etc/nginx/ssl/chat-ops.crt +ADD /chat-ops.nginx.conf /etc/nginx/conf.d/default.conf +ADD /.htpasswd /etc/nginx/.htpasswd +ADD /dist/chat-ops-ui /usr/share/nginx/html \ No newline at end of file diff --git a/chat-ops-ui/build.sh b/chat-ops-ui/build.sh new file mode 100755 index 0000000..6391c15 --- /dev/null +++ b/chat-ops-ui/build.sh @@ -0,0 +1,4 @@ +#! /bin/bash + +ng build --prod +docker build -t ${1} . diff --git a/chat-ops-ui/chat-ops.nginx.conf b/chat-ops-ui/chat-ops.nginx.conf new file mode 100644 index 0000000..62e94d3 --- /dev/null +++ b/chat-ops-ui/chat-ops.nginx.conf @@ -0,0 +1,51 @@ +server { + listen 443 ssl; + server_name chat-ops-ato.dispatchframework.io; + + ssl_certificate /etc/nginx/ssl/chat-ops.crt; + ssl_certificate_key /etc/nginx/ssl/chat-ops.key; + + + #charset koi8-r; + #access_log /var/log/nginx/log/host.access.log main; + + location / { + auth_basic "Restricted Content"; + auth_basic_user_file /etc/nginx/.htpasswd; + root /usr/share/nginx/html; + index index.html index.htm; + try_files $uri $uri/ /index.html; + } + + #error_page 404 /404.html; + + # redirect server error pages to the static page /50x.html + # + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + + # proxy the PHP scripts to Apache listening on 127.0.0.1:80 + # + #location ~ \.php$ { + # proxy_pass http://127.0.0.1; + #} + + # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 + # + #location ~ \.php$ { + # root html; + # fastcgi_pass 127.0.0.1:9000; + # fastcgi_index index.php; + # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; + # include fastcgi_params; + #} + + # deny access to .htaccess files, if Apache's document root + # concurs with nginx's one + # + #location ~ /\.ht { + # deny all; + #} +} diff --git a/chat-ops-ui/src/app/vm/vm.component.ts b/chat-ops-ui/src/app/vm/vm.component.ts index a7581ed..23af317 100644 --- a/chat-ops-ui/src/app/vm/vm.component.ts +++ b/chat-ops-ui/src/app/vm/vm.component.ts @@ -1,13 +1,7 @@ -import { Component, OnInit } from '@angular/core'; +import { OnInit } from '@angular/core'; import { VMService } from "./vm.service"; import { VM } from "./vm"; - -@Component({ - selector: 'app-aws', - templateUrl: './../vm/vm.component.html', - styleUrls: ['./../vm/vm.component.css'] -}) export abstract class VMComponent implements OnInit { vmService !: VMService; diff --git a/chat-ops-ui/src/app/vm/vm.service.ts b/chat-ops-ui/src/app/vm/vm.service.ts index b24715e..3cfacaa 100644 --- a/chat-ops-ui/src/app/vm/vm.service.ts +++ b/chat-ops-ui/src/app/vm/vm.service.ts @@ -2,12 +2,11 @@ import { Injectable } from '@angular/core'; import { Http, Response, RequestOptions, Headers } from '@angular/http'; import { Observable } from 'rxjs/Observable'; import { environment } from '../../environments/environment'; -import { interval } from 'rxjs'; +import { interval, throwError } from 'rxjs'; import 'rxjs/add/operator/map'; import 'rxjs/add/operator/catch'; import 'rxjs/add/operator/switchMap'; -import 'rxjs/add/observable/throw'; import { VM } from '../vm/vm'; @@ -50,14 +49,14 @@ export abstract class VMService { .catch(this.handleError); } - private extractVMs(cloud: string, res: Response) { + extractVMs(cloud: string, res: Response) { let data = res.json(); if (data) { data.forEach(element => { element.cloud = cloud element.name = element.name element.id = element.id - element.state = element.state + element.state = element.status }); console.log(data); return data; @@ -76,6 +75,6 @@ export abstract class VMService { errMsg = error.message ? error.message : error.toString(); } console.error(errMsg); - return Observable.throw(errMsg); + return throwError(errMsg); } } diff --git a/chat-ops-ui/src/app/vmware/vmware.service.ts b/chat-ops-ui/src/app/vmware/vmware.service.ts index 5f28cf4..8324d22 100644 --- a/chat-ops-ui/src/app/vmware/vmware.service.ts +++ b/chat-ops-ui/src/app/vmware/vmware.service.ts @@ -6,5 +6,5 @@ import { VMService } from '../vm/vm.service'; providedIn: 'root' }) export class VMwareService extends VMService { - cloud = "vmware"; + cloud = "vsphere"; } diff --git a/chat-ops-ui/src/environments/environment.prod.ts b/chat-ops-ui/src/environments/environment.prod.ts index 54a6623..7b54642 100644 --- a/chat-ops-ui/src/environments/environment.prod.ts +++ b/chat-ops-ui/src/environments/environment.prod.ts @@ -1,5 +1,4 @@ export const environment = { production: true, - apiURL: "http://localhost:8081/dispatch-server/", - apiPathAWS: "aws" + apiURL: "https://ato-api.dispatchframework.io/" }; diff --git a/chat-ops-ui/src/environments/environment.ts b/chat-ops-ui/src/environments/environment.ts index 320f4c8..5bf43b0 100644 --- a/chat-ops-ui/src/environments/environment.ts +++ b/chat-ops-ui/src/environments/environment.ts @@ -4,8 +4,7 @@ export const environment = { production: false, - apiURL: "http://localhost:8081/dispatch-server/", - apiPathAWS: "aws" + apiURL: "https://ato-api.dispatchframework.io/" }; /* diff --git a/chat-ops-ui/src/index.html b/chat-ops-ui/src/index.html index f4dcd7f..fbab54a 100644 --- a/chat-ops-ui/src/index.html +++ b/chat-ops-ui/src/index.html @@ -8,11 +8,11 @@ - + - + - +