channelz: allow grpc address to be overridden, and make builds less noisy (#300)

This commit is contained in:
zpencer 2018-07-17 18:25:18 -07:00 committed by GitHub
parent 4e0cc508ff
commit 6ac114da18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 13 additions and 5 deletions

View File

@ -3,9 +3,15 @@ set -eux -o pipefail
readonly GRPC_ZPAGES_DIR="$(cd "$(dirname "$0")"/.. && pwd)"
cd "$GRPC_ZPAGES_DIR/web/channelzui/"
npm install
SRC_DIR="$GRPC_ZPAGES_DIR/web/channelzui/"
cd "$SRC_DIR"
rm -rf "$GRPC_ZPAGES_DIR/docker/static-assets/dist_channelz/"
if [[ $(which ng) == "" ]]; then
echo "ng is not on the path, you must run 'npm install' in $SRC_DIR"
exit 1
fi
ng build --prod --build-optimizer --base-href=/dist_channelz/

View File

@ -11,5 +11,5 @@
<script src="./assets/packed_anys_protos.js" type="text/javascript"/></script>
<body>
<app-root></app-root>
<script type="text/javascript" src="runtime.a66f828dca56eeb90e02.js"></script><script type="text/javascript" src="polyfills.001f1812942338ddb405.js"></script><script type="text/javascript" src="main.d48da207fe2011dffb9e.js"></script></body>
<script type="text/javascript" src="runtime.a66f828dca56eeb90e02.js"></script><script type="text/javascript" src="polyfills.001f1812942338ddb405.js"></script><script type="text/javascript" src="main.8ab4a87bb472a38271b5.js"></script></body>
</html>

File diff suppressed because one or more lines are too long

View File

@ -18,6 +18,7 @@
import { Injectable } from "@angular/core";
import { Observable } from "rxjs";
import { HttpClient } from "@angular/common/http";
import { environment } from "../environments/environment";
// The proto symbol is loaded by the web browser via a
// <script src="..."></script> tag.
@ -38,7 +39,7 @@ export class ChannelzService {
// window.location.origin is the reverse proxy that both serves the
// app and performs grpc-web translation
private client = new proto.grpc.channelz.v1.ChannelzClient(
window.location.origin);
environment.grpcRemoteAddr);
private functionToObserver(rpcMethod: any, req: any): Observable<any> {
return new Observable(observer => {

View File

@ -1,3 +1,4 @@
export const environment = {
production: true,
grpcRemoteAddr: window.location.origin,
};

View File

@ -5,4 +5,5 @@
export const environment = {
production: false,
grpcRemoteAddr: window.location.origin,
};