Multiple UI/UX enhancements
1. Maintain the header bar consistency between stoarge and HTTP template html files; 2. Setting up logging in earlier stage; 3. Print user-friendly message for stoping Pecan server from PyPI installation; Change-Id: I8bfc16812456a1475f0050a731cc4b9b081f2840
This commit is contained in:
parent
1048de065d
commit
84f2f3d741
@ -713,13 +713,16 @@ def create_html(hfp, template, task_re):
|
|||||||
|
|
||||||
def generate_charts(json_results, html_file_name):
|
def generate_charts(json_results, html_file_name):
|
||||||
'''Save results in HTML format file.'''
|
'''Save results in HTML format file.'''
|
||||||
LOG.info('Saving results in HTML file: ' + html_file_name + "...")
|
LOG.info('Saving results to HTML file: ' + html_file_name + '...')
|
||||||
|
try:
|
||||||
if json_results['test_mode'] == "storage":
|
if json_results['test_mode'] == "storage":
|
||||||
template_path = resource_filename(__name__, 'template_storage.html')
|
template_path = resource_filename(__name__, 'template_storage.html')
|
||||||
elif json_results['test_mode'] == "http":
|
elif json_results['test_mode'] == "http":
|
||||||
template_path = resource_filename(__name__, 'template_http.html')
|
template_path = resource_filename(__name__, 'template_http.html')
|
||||||
else:
|
else:
|
||||||
LOG.error('Error parsing the json file')
|
raise
|
||||||
|
except Exception:
|
||||||
|
LOG.error('Invalid json file.')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
with open(html_file_name, 'w') as hfp, open(template_path, 'r') as template:
|
with open(html_file_name, 'w') as hfp, open(template_path, 'r') as template:
|
||||||
create_html(hfp,
|
create_html(hfp,
|
||||||
@ -783,10 +786,11 @@ def main():
|
|||||||
CONF.set_default("verbose", True)
|
CONF.set_default("verbose", True)
|
||||||
full_version = __version__ + ', VM image: ' + kb_vm_agent.get_image_name()
|
full_version = __version__ + ', VM image: ' + kb_vm_agent.get_image_name()
|
||||||
CONF(sys.argv[1:], project="kloudbuster", version=full_version)
|
CONF(sys.argv[1:], project="kloudbuster", version=full_version)
|
||||||
|
logging.setup("kloudbuster")
|
||||||
|
|
||||||
if CONF.charts_from_json:
|
if CONF.charts_from_json:
|
||||||
if not CONF.html:
|
if not CONF.html:
|
||||||
print 'Error: you must specify the destination html file name using --html'
|
LOG.error('Destination html filename must be specified using --html.')
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
with open(CONF.charts_from_json, 'r') as jfp:
|
with open(CONF.charts_from_json, 'r') as jfp:
|
||||||
json_results = json.load(jfp)
|
json_results = json.load(jfp)
|
||||||
@ -797,7 +801,6 @@ def main():
|
|||||||
print resource_string(__name__, "cfg.scale.yaml")
|
print resource_string(__name__, "cfg.scale.yaml")
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
logging.setup("kloudbuster")
|
|
||||||
try:
|
try:
|
||||||
kb_config = KBConfig()
|
kb_config = KBConfig()
|
||||||
kb_config.init_with_cli()
|
kb_config.init_with_cli()
|
||||||
|
@ -29,12 +29,15 @@ def exec_command(cmd, cwd=None, show_console=False):
|
|||||||
def main():
|
def main():
|
||||||
cwd = resource_filename(__name__, 'config.py')
|
cwd = resource_filename(__name__, 'config.py')
|
||||||
cwd = cwd[:cwd.rfind('/')] + '/../kb_server'
|
cwd = cwd[:cwd.rfind('/')] + '/../kb_server'
|
||||||
|
try:
|
||||||
cmd = ['stdbuf', '-oL', 'python', 'setup.py', 'develop']
|
cmd = ['stdbuf', '-oL', 'python', 'setup.py', 'develop']
|
||||||
rc = exec_command(cmd, cwd=cwd)
|
rc = exec_command(cmd, cwd=cwd)
|
||||||
if not rc:
|
if not rc:
|
||||||
cmd = ['stdbuf', '-oL', 'pecan', 'serve', 'config.py']
|
cmd = ['stdbuf', '-oL', 'pecan', 'serve', 'config.py']
|
||||||
rc = exec_command(cmd, cwd=cwd, show_console=True)
|
rc = exec_command(cmd, cwd=cwd, show_console=True)
|
||||||
sys.exit(rc)
|
sys.exit(rc)
|
||||||
|
except KeyboardInterrupt:
|
||||||
|
print 'Terminating server...'
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
main()
|
main()
|
||||||
|
@ -46,18 +46,25 @@
|
|||||||
<body ng-controller="MainCtrl">
|
<body ng-controller="MainCtrl">
|
||||||
<nav class="navbar navbar-default">
|
<nav class="navbar navbar-default">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<div class="navbar-header">
|
<a class="navbar-brand" ng-href="#/" style="font-family: Arial">
|
||||||
<a class="navbar-brand" href="#">KloudBuster Report</a>
|
<span style="color:#DF314D">K</span>loudBuster
|
||||||
</div>
|
</a>
|
||||||
|
|
||||||
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
|
||||||
|
<ul class="nav navbar-nav">
|
||||||
|
<li class="active">
|
||||||
|
<a><span class="glyphicon" aria-hidden="true" ></span>[[label]]</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
<!--<ul class="nav navbar-nav navbar-right">-->
|
<!--<ul class="nav navbar-nav navbar-right">-->
|
||||||
<!--<li><a href="#"></a></li>-->
|
<!--<li><a href="#"></a></li>-->
|
||||||
<!--</ul>-->
|
<!--</ul>-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h3>[[label]]</h3>
|
<h3>KloudBuster HTTP Testing Report</h3>
|
||||||
<div class="my-chart" style="height: 400px;margin-bottom: 10%">
|
<div class="my-chart" style="height: 400px;margin-bottom: 10%">
|
||||||
<linechart data="data" options="options"></linechart>
|
<linechart data="data" options="options"></linechart>
|
||||||
</div>
|
</div>
|
||||||
|
@ -52,7 +52,7 @@
|
|||||||
</nav>
|
</nav>
|
||||||
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
|
<h3>KloudBuster Storage Testing Report</h3>
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li ng-repeat="title in titleList" ng-class="{active: current_index==$index}" ng-click="handleEvent($event, $index,'')">
|
<li ng-repeat="title in titleList" ng-class="{active: current_index==$index}" ng-click="handleEvent($event, $index,'')">
|
||||||
<a data-toggle="tab" aria-expanded="true">
|
<a data-toggle="tab" aria-expanded="true">
|
||||||
@ -165,7 +165,7 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
var storage_target = {"volume":"Cinder Volume","ephemeral":"Ephemeral Volume"};
|
var storage_target = {"volume":"Cinder Volume","ephemeral":"Ephemeral Disk"};
|
||||||
|
|
||||||
angular.module("app", ["n3-line-chart", "ngTable"]).controller("MainCtrl", function ($scope, ngTableParams) {
|
angular.module("app", ["n3-line-chart", "ngTable"]).controller("MainCtrl", function ($scope, ngTableParams) {
|
||||||
$scope.current_index = 0;
|
$scope.current_index = 0;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user