-
Notifications
You must be signed in to change notification settings - Fork 14k
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
A welcome page #198
Merged
Merged
A welcome page #198
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
var $ = window.$ = require('jquery'); | ||
var jQuery = window.jQuery = $; | ||
|
||
require('../stylesheets/dashed.css'); | ||
require('../stylesheets/welcome.css'); | ||
require('bootstrap'); | ||
require('datatables'); | ||
require('../node_modules/cal-heatmap/cal-heatmap.css'); | ||
|
||
var CalHeatMap = require('cal-heatmap'); | ||
|
||
function modelViewTable(selector, modelEndpoint, ordering) { | ||
// Builds a dataTable from a flask appbuilder api endpoint | ||
$.getJSON(modelEndpoint + '/api/read', function (data) { | ||
var tableData = jQuery.map(data.result, function (el, i) { | ||
var row = $.map(data.list_columns, function (col, i) { | ||
return el[col]; | ||
}); | ||
return [row]; | ||
}); | ||
var cols = jQuery.map(data.list_columns, function (col, i) { | ||
return { sTitle: data.label_columns[col] }; | ||
}); | ||
$(selector).DataTable({ | ||
aaData: tableData, | ||
aoColumns: cols, | ||
bPaginate: false, | ||
order: ordering, | ||
searching: false | ||
}); | ||
$('[data-toggle="tooltip"]').tooltip({ container: 'body' }); | ||
}); | ||
} | ||
|
||
$(document).ready(function () { | ||
var cal = new CalHeatMap(); | ||
cal.init({ | ||
start: new Date().setFullYear(new Date().getFullYear() - 1), | ||
range: 13, | ||
data: '/dashed/activity_per_day', | ||
domain: "month", | ||
subDomain: "day", | ||
itemName: "action", | ||
tooltip: true | ||
}); | ||
modelViewTable('#dash_table', '/dashboardmodelviewasync'); | ||
modelViewTable('#slice_table', '/sliceasync'); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,10 @@ body { | |
font-size: 100%; | ||
} | ||
|
||
.no-wrap { | ||
white-space: nowrap; | ||
} | ||
|
||
input.form-control { | ||
background-color: white; | ||
} | ||
|
@@ -68,6 +72,10 @@ form div { | |
} | ||
.navbar-brand a { | ||
color: white; | ||
text-decoration: none; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. thank god! that was annoying me 👍 |
||
} | ||
.navbar-brand a:hover { | ||
color: white; | ||
} | ||
|
||
.header span { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
.welcome .widget{ | ||
border-radius: 0; | ||
border: 1px solid #ccc; | ||
box-shadow: 2px 1px 5px -2px #aaa; | ||
background-color: #fff; | ||
} | ||
|
||
.welcome .widget .header { | ||
background-color: #f1f1f1; | ||
text-align: center; | ||
} | ||
|
||
.welcome .widget>div { | ||
padding: 3px; | ||
overflow: auto; | ||
max-height: 500px; | ||
} | ||
|
||
.table i { | ||
padding-top: 6px; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
"""log dt | ||
|
||
Revision ID: 1d2ddd543133 | ||
Revises: d2424a248d63 | ||
Create Date: 2016-03-25 14:35:44.642576 | ||
|
||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '1d2ddd543133' | ||
down_revision = 'd2424a248d63' | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
def upgrade(): | ||
op.add_column('logs', sa.Column('dt', sa.Date(), nullable=True)) | ||
|
||
|
||
def downgrade(): | ||
op.drop_column('logs', 'dt') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{% extends "dashed/basic.html" %} | ||
|
||
{% block head_js %} | ||
{{ super() }} | ||
<script src="/static/assets/javascripts/dist/welcome.entry.js"></script> | ||
{% endblock %} | ||
|
||
{% block title %}Welcome!{% endblock %} | ||
|
||
{% block body %} | ||
<div class="container welcome"> | ||
<div class="header"> | ||
<h3><i class='fa fa-star'></i> Welcome!</h3> | ||
</div> | ||
<hr/> | ||
<div id="cal-heatmap"></div> | ||
<hr/> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
<div class="widget"> | ||
<div class="header"><h4><i class="fa fa-dashboard"></i> Dashboards</h4></div> | ||
<div> | ||
<table id="dash_table" class="table"></table> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="col-md-6"> | ||
<div class="widget"> | ||
<div class="header"><h4><i class="fa fa-bar-chart"></i> Slices</h4></div> | ||
<div> | ||
<table id="slice_table" class="table"></table> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<hr/> | ||
{% endblock %} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just something to note: every time you give a DOM element an
id
, it creates a GLOBAL javascript variable with that id name. there are tons of instances of using#my_id
selectors in the code base so it's probably not worth changing at this point, but going forward it is better to useclass
es thanid
s for DOM elements and selections.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh I didn't know that... will avoid id moving forward, a unique class works just as well