Skip to content

Commit

Permalink
minor UI tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
whummer committed Apr 22, 2017
1 parent 3cfe5ee commit b9cf1ce
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 9 deletions.
8 changes: 5 additions & 3 deletions localstack/dashboard/infra.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ def aws_cmd(service, env):

cmd = '. .venv/bin/activate; aws'
endpoint_url = None
env = aws_stack.get_environment(env)
if env.region == REGION_LOCAL:
endpoint_url = aws_stack.get_local_service_url(service)
if endpoint_url:
Expand Down Expand Up @@ -197,6 +198,7 @@ def get_lambda_event_sources(func_name=None, env=None):
def get_lambda_code(func_name, retries=1, cache_time=None, env=None):
if MOCK_OBJ:
return ''
env = aws_stack.get_environment(env)
if cache_time is None and env.region != REGION_LOCAL:
cache_time = AWS_LAMBDA_CODE_CACHE_TIMEOUT
out = cmd_lambda('get-function --function-name %s' % func_name, env, cache_time)
Expand All @@ -210,10 +212,10 @@ def get_lambda_code(func_name, retries=1, cache_time=None, env=None):
try:
run('mkdir -p %s' % folder)
if not os.path.isfile(archive):
print("Downloading %s" % archive)
# print("Downloading %s" % archive)
run("wget -O %s '%s'" % (archive, loc))
if len(os.listdir(folder)) <= 1:
print("Unzipping %s/%s" % (folder, filename))
# print("Unzipping %s/%s" % (folder, filename))
run("cd %s && unzip -o %s" % (folder, filename))
except Exception, e:
print("WARN: %s" % e)
Expand Down Expand Up @@ -424,6 +426,6 @@ def get_graph(name_filter='.*', env=None):
src_uid = node_ids[b.id]
tgt_uid = node_ids[n.target.id]
result['edges'].append({'source': src_uid, 'target': tgt_uid})
print json.dumps(result)
# print json.dumps(result)

return result
Binary file removed localstack/dashboard/web/img/arrows-circle.png
Binary file not shown.
Binary file added localstack/dashboard/web/img/localstack_icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added localstack/dashboard/web/img/localstack_small.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 3 additions & 3 deletions localstack/dashboard/web/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<head>
<title>Dashboard</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="icon" type="image/png" href="/img/arrows-circle.png" />
<link rel="icon" type="image/png" href="/img/localstack_icon.png" />
<link rel="stylesheet" href="node_modules/@atlassian/aui/dist/aui/css/aui.css" media="all">
<link rel="stylesheet" href="node_modules/@atlassian/aui/dist/aui/css/aui-experimental.css" media="all">
<link rel="stylesheet" href="node_modules/angular-aui/lib/aui/5.9.5/css/aui-iconfonts.css" media="all">
Expand All @@ -25,15 +25,15 @@
<div class="aui-header-primary">
<h1 id="logo" class="aui-header-logo aui-header-logo-textonly">
<span class="aui-header-logo-device">
<img src="img/arrows-circle.png" style="width: 30px; height: 30px; padding: 2px; margin-right: 10px;"/></span>
<img src="img/localstack_small.png" style="height: 30px; padding: 2px; margin-right: 10px;"/></span>
</h1>
<ul class="aui-nav">
<li><a id="data-link" href="/#/">Infrastructure</a></li>
</ul>
</div>
<div class="aui-header-secondary">
<ul class="aui-nav">
<li><span style="display: block; line-height: 1; padding: 13px 10px;">Dashboard</span></li>
<li><span style="display: block; line-height: 1; padding: 13px 10px;"></span></li>
</ul>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion localstack/dashboard/web/views/infra.html
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ <h2>Settings</h2>
<header class="aui-page-header">
<div class="aui-page-header-inner">
<div class="aui-page-header-main">
<h1>Infrastructure Deployment Overview</h1>
<h1>Overview of Deployed Resources</h1>
</div>
</div>
</header>
Expand Down
4 changes: 2 additions & 2 deletions localstack/dashboard/web/views/infra.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
$scope.actions = {};
$scope.state = {};
$scope.settings = {
hideDisconnected: false,
hideDisconnected: false,
localEndpoints: true,
nameFilter: '(?!(segment-|aes-|.*zone-)).*'
nameFilter: '.*'
};

$scope.trim = function(string, maxLength) {
Expand Down
9 changes: 9 additions & 0 deletions tests/test_web_ui.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from localstack.dashboard import infra


def test_infra_graph_generation():
graph = infra.get_graph()
assert 'nodes' in graph
assert 'edges' in graph

# TODO add more tests/assertions

0 comments on commit b9cf1ce

Please sign in to comment.