Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New design 🎉 and UX improvements! #984

Merged
merged 2 commits into from Apr 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 23 additions & 17 deletions rd_ui/app/app_layout.html
Expand Up @@ -5,12 +5,13 @@
<!--[if gt IE 8]><!--> <html class="no-js" ng-app="redash" ng-controller='MainCtrl'> <!--<![endif]-->
<head>
<base href="{{base_href}}">
<title ng-bind="'{{name}} | ' + pageTitle"></title>
<title ng-bind="pageTitle + '| {{name}}'"></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<!-- build:css /styles/main.css -->
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" href="/styles/superflat_redash.css">
<link rel="stylesheet" href="/bower_components/material-design-iconic-font/dist/css/material-design-iconic-font.css">
<link rel="stylesheet" href="/bower_components/codemirror/lib/codemirror.css">
<link rel="stylesheet" href="/bower_components/gridster/dist/jquery.gridster.css">
<link rel="stylesheet" href="/bower_components/pivottable/dist/pivot.css">
Expand All @@ -20,6 +21,7 @@
<link rel="stylesheet" href="/bower_components/font-awesome/css/font-awesome.css">
<link rel="stylesheet" href="/bower_components/codemirror/addon/hint/show-hint.css">
<link rel="stylesheet" href="/bower_components/leaflet/dist/leaflet.css">
<link rel="stylesheet" href="/bower_components/angular-resizable/src/angular-resizable.css">
<link rel="stylesheet" href="/styles/redash.css">
<!-- endbuild -->

Expand All @@ -34,24 +36,28 @@
{% block content %}
{% endblock %}

<div ng-view></div>
<div ng-if="showPermissionError" class="ng-cloak container" ng-cloak>
<section id="1">
<div ng-view></div>
<div ng-if="showPermissionError" class="ng-cloak container" ng-cloak>
<div class="row">
<div class="text-center">
<h1><span class="glyphicon glyphicon-lock"></span></h1>
<p class="text-muted">
You do not have permission to view the requested page.
</p>
</div>
<div class="text-center">
<h1><span class="zmdi zmdi-lock"></span></h1>
<p class="text-muted">
You do not have permission to view the requested page.
</p>
</div>
</div>
</div>
</div>

{% if not headless %}
{% raw %}
<div class="visible-print">
<hr>
Source: {{location}}
</div>
</section>


{% if not headless %}
{% raw %}
<div class="visible-print">
<hr>
Source: {{location}}
</div>
{% endraw %}
{% include 'footer.html' %}
{% endif %}
Expand Down
6 changes: 2 additions & 4 deletions rd_ui/app/embed.html
Expand Up @@ -10,7 +10,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">

<!-- build:css /styles/embed.css -->
<link rel="stylesheet" href="/bower_components/bootstrap/dist/css/bootstrap.css">
<link rel="stylesheet" href="/styles/superflat_redash.css">
<link rel="stylesheet" href="/bower_components/codemirror/lib/codemirror.css">
<link rel="stylesheet" href="/bower_components/gridster/dist/jquery.gridster.css">
<link rel="stylesheet" href="/bower_components/pivottable/dist/pivot.css">
Expand All @@ -28,9 +28,7 @@
<link rel="icon" type="image/png" sizes="16x16" href="/images/favicon-16x16.png">

<style>
body { padding:0; }
.col-lg-12, .row, .container, .panel { margin:0; padding:0; }
.container::after, .row::after { display:none; }
body { padding: 0; }
</style>
</head>
<body>
Expand Down
Binary file added rd_ui/app/fonts/glyphicons-halflings-regular.eot
Binary file not shown.
229 changes: 229 additions & 0 deletions rd_ui/app/fonts/glyphicons-halflings-regular.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rd_ui/app/fonts/glyphicons-halflings-regular.ttf
Binary file not shown.
Binary file added rd_ui/app/fonts/glyphicons-halflings-regular.woff
Binary file not shown.
Binary file not shown.
Binary file added rd_ui/app/fonts/roboto/Roboto-Bold-webfont.eot
Binary file not shown.
593 changes: 593 additions & 0 deletions rd_ui/app/fonts/roboto/Roboto-Bold-webfont.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rd_ui/app/fonts/roboto/Roboto-Bold-webfont.ttf
Binary file not shown.
Binary file added rd_ui/app/fonts/roboto/Roboto-Bold-webfont.woff
Binary file not shown.
Binary file added rd_ui/app/fonts/roboto/Roboto-Light-webfont.eot
Binary file not shown.
641 changes: 641 additions & 0 deletions rd_ui/app/fonts/roboto/Roboto-Light-webfont.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rd_ui/app/fonts/roboto/Roboto-Light-webfont.ttf
Binary file not shown.
Binary file not shown.
Binary file added rd_ui/app/fonts/roboto/Roboto-Medium-webfont.eot
Binary file not shown.
593 changes: 593 additions & 0 deletions rd_ui/app/fonts/roboto/Roboto-Medium-webfont.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rd_ui/app/fonts/roboto/Roboto-Medium-webfont.ttf
Binary file not shown.
Binary file added rd_ui/app/fonts/roboto/Roboto-Medium-webfont.woff
Binary file not shown.
Binary file added rd_ui/app/fonts/roboto/Roboto-Regular-webfont.eot
Binary file not shown.
621 changes: 621 additions & 0 deletions rd_ui/app/fonts/roboto/Roboto-Regular-webfont.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rd_ui/app/fonts/roboto/Roboto-Regular-webfont.ttf
Binary file not shown.
Binary file not shown.
Binary file added rd_ui/app/fonts/roboto/Roboto-Thin-webfont.eot
Binary file not shown.
631 changes: 631 additions & 0 deletions rd_ui/app/fonts/roboto/Roboto-Thin-webfont.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added rd_ui/app/fonts/roboto/Roboto-Thin-webfont.ttf
Binary file not shown.
Binary file added rd_ui/app/fonts/roboto/Roboto-Thin-webfont.woff
Binary file not shown.
Binary file added rd_ui/app/images/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
110 changes: 46 additions & 64 deletions rd_ui/app/login.html
@@ -1,83 +1,65 @@
{% extends "signed_out_layout.html" %}
{% block title %}Login{% endblock %}
{% block content %}

<div class="row">
{% with messages = get_flashed_messages() %}
{% if messages %}
{% for message in messages %}
<div class="alert alert-warning" role="alert">{{ message }}</div>
<div class="alert alert-danger" role="alert">{{ message }}</div>
{% endfor %}
{% endif %}
{% endwith %}
{% if show_google_openid %}
<div class="row">
<a href="{{ google_auth_url }}"><img src="/google_login.png" class="login-button"/></a>
</div>

<div class="main">
{% if show_google_openid %}

<div class="row">
<a href="{{ google_auth_url }}"><img src="/google_login.png" class="login-button"/></a>
</div>
<div class="login-or">
<hr class="hr-or">
<span class="span-or">or</span>
</div>
{% endif %}

<div class="login-or">
<hr class="hr-or">
<span class="span-or">or</span>
</div>
{% if show_saml_login %}
<div class="row">
<a href="/saml/login">SAML Login</a>
</div>

{% endif %}
<div class="login-or">
<hr class="hr-or">
<span class="span-or">or</span>
</div>
{% endif %}

{% if show_saml_login %}
{% if show_remote_user_login %}
<div class="row">
<a href="/remote_user/login">Remote User Login</a>
</div>

<div class="row">
<a href="/saml/login">SAML Login</a>
</div>
<div class="login-or">
<hr class="hr-or">
<span class="span-or">or</span>
</div>
{% endif %}

<div class="login-or">
<hr class="hr-or">
<span class="span-or">or</span>
<form role="form" method="post" name="login">
<div class="form-group">
<label for="inputEmail">Email</label>
<input type="text" class="form-control" id="inputEmail" name="email" value="{{email}}">
</div>

{% endif %}

{% if show_remote_user_login %}

<div class="row">
<a href="/remote_user/login">Remote User Login</a>
<div class="form-group">
<label for="inputPassword">Password</label>
<input type="password" class="form-control" id="inputPassword" name="password">
</div>

<div class="login-or">
<hr class="hr-or">
<span class="span-or">or</span>
<div class="checkbox pull-right">
<label>
<input type="checkbox" name="remember">
Remember me </label>
</div>

{% endif %}

<form role="form" method="post" name="login">
<div class="form-group">
<label for="inputEmail">Email</label>
<input type="text" class="form-control" id="inputEmail" name="email" value="{{email}}">
</div>
<div class="form-group">
<!--<a class="pull-right" href="#">Forgot password?</a>-->
<label for="inputPassword">Password</label>
<input type="password" class="form-control" id="inputPassword" name="password">
</div>
<div class="checkbox pull-right">
<label>
<input type="checkbox" name="remember">
Remember me </label>
</div>

<button type="submit" class="btn btn btn-primary">
Log In
</button>
</form>


</div>
<div class="main text-center">
<hr>
<a href="{{ url_for("redash.forgot_password", org_slug=org_slug) }}">I forgot my password</a>
</div>

</div>

<button type="submit" class="btn btn btn-primary">
Log In
</button>
</form>
<hr>
<a href="{{ url_for("redash.forgot_password", org_slug=org_slug) }}">I forgot my password</a>
{% endblock %}
2 changes: 1 addition & 1 deletion rd_ui/app/public.html
Expand Up @@ -5,7 +5,7 @@
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container">
<div class="navbar-header">
<a class="navbar-brand" href="{{base_href}}"><img src="{{logoUrl}}"/></a>
<a class="navbar-brand" href="{{base_href}}"><img src="{{logo_url}}"/></a>
</div>
</div>
</nav>
Expand Down
1 change: 1 addition & 0 deletions rd_ui/app/scripts/app.js
Expand Up @@ -17,6 +17,7 @@ angular.module('redash', [
'ui.select',
'naif.base64',
'ui.bootstrap.showErrors',
'angularResizable',
'ngSanitize'
]).config(['$routeProvider', '$locationProvider', '$compileProvider', 'growlProvider', 'uiSelectConfig', '$httpProvider',
function ($routeProvider, $locationProvider, $compileProvider, growlProvider, uiSelectConfig, $httpProvider) {
Expand Down
1 change: 0 additions & 1 deletion rd_ui/app/scripts/controllers/admin_controllers.js
Expand Up @@ -4,7 +4,6 @@
$scope.$parent.pageTitle = "System Status";

var refresh = function () {
$scope.refresh_time = moment().add('minutes', 1);
$http.get('/status.json').success(function (data) {
$scope.workers = data.workers;
delete data.workers;
Expand Down
31 changes: 16 additions & 15 deletions rd_ui/app/scripts/controllers/dashboard.js
Expand Up @@ -92,8 +92,10 @@
_.each($scope.dashboard.widgets, function(row) {
_.each(row, function(widget, i) {
var newWidget = newWidgets[widget.id];
if (newWidget && newWidget[0].visualization.query.latest_query_data_id != widget.visualization.query.latest_query_data_id) {
row[i] = new Widget(newWidget[0]);
if (newWidget.visualization) {
if (newWidget && newWidget[0].visualization.query.latest_query_data_id != widget.visualization.query.latest_query_data_id) {
row[i] = new Widget(newWidget[0]);
}
}
});
});
Expand Down Expand Up @@ -131,15 +133,17 @@
$scope.triggerRefresh = function() {
$scope.refreshEnabled = !$scope.refreshEnabled;

Events.record(currentUser, "autorefresh", "dashboard", dashboard.id, {'enable': $scope.refreshEnabled});
Events.record(currentUser, "autorefresh", "dashboard", $scope.dashboard.id, {'enable': $scope.refreshEnabled});

if ($scope.refreshEnabled) {
var refreshRate = _.min(_.map(_.flatten($scope.dashboard.widgets), function(widget) {
var schedule = widget.visualization.query.schedule;
if (schedule === null || schedule.match(/\d\d:\d\d/) !== null) {
return 60;
if (widget.visualization) {
var schedule = widget.visualization.query.schedule;
if (schedule === null || schedule.match(/\d\d:\d\d/) !== null) {
return 60;
}
return widget.visualization.query.schedule;
}
return widget.visualization.query.schedule;
}));

$scope.refreshRate = _.max([120, refreshRate * 2]) * 1000;
Expand All @@ -158,26 +162,23 @@
$modalInstance.close();
};

$scope.publicAccessEnabled = $scope.dashboard.public_url !== undefined;

$scope.toggleSharing = function() {
console.log("should enable?", $scope.publicAccessEnabled);
var url = 'api/dashboards/' + $scope.dashboard.id + '/share';
if ($scope.publicAccessEnabled) {
if ($scope.dashboard.publicAccessEnabled) {
// disable
$http.delete(url).success(function() {
$scope.publicAccessEnabled = false;
$scope.dashboard.publicAccessEnabled = false;
delete $scope.dashboard.public_url;
}).error(function() {
$scope.publicAccessEnabled = true;
$scope.dashboard.publicAccessEnabled = true;
// TODO: show message
})
} else {
$http.post(url).success(function(data) {
$scope.publicAccessEnabled = true;
$scope.dashboard.publicAccessEnabled = true;
$scope.dashboard.public_url = data.public_url;
}).error(function() {
$scope.publicAccessEnabled = false;
$scope.dashboard.publicAccessEnabled = false;
// TODO: show message
});
}
Expand Down
15 changes: 0 additions & 15 deletions rd_ui/app/scripts/controllers/data_sources.js
Expand Up @@ -5,21 +5,6 @@

$scope.dataSources = DataSource.query();

$scope.openDataSource = function(datasource) {
$location.path('/data_sources/' + datasource.id);
};

$scope.deleteDataSource = function(event, datasource) {
event.stopPropagation();
Events.record(currentUser, "delete", "datasource", datasource.id);
datasource.$delete(function(resource) {
growl.addSuccessMessage("Data source deleted successfully.");
this.$parent.dataSources = _.without(this.dataSources, resource);
}.bind(this), function(httpResponse) {
console.log("Failed to delete data source: ", httpResponse.status, httpResponse.statusText, httpResponse.data);
growl.addErrorMessage("Failed to delete data source.");
});
}
};

var DataSourceCtrl = function ($scope, $routeParams, $http, $location, Events, DataSource) {
Expand Down
11 changes: 0 additions & 11 deletions rd_ui/app/scripts/controllers/query_source.js
Expand Up @@ -97,7 +97,6 @@
}, function () {
growl.addErrorMessage("Error deleting visualization. Maybe it's used in a dashboard?");
});

}
};

Expand All @@ -108,16 +107,6 @@
$scope.$on('$destroy', function destroy() {
KeyboardShortcuts.unbind(shortcuts);
});

if (isNewQuery) {
// save new query when creating a visualization
var unbind = $scope.$watch('selectedTab == "add"', function(triggerSave) {
if (triggerSave) {
unbind();
$scope.saveQuery();
}
});
}
}

angular.module('redash.controllers').controller('QuerySourceCtrl', [
Expand Down