improve index style

This commit is contained in:
Davide Alberani 2018-01-23 18:22:08 +01:00
parent 2c505fd03d
commit 86bfa4035e
2 changed files with 28 additions and 18 deletions

View file

@ -147,9 +147,11 @@ def run_job(id_=None, *args, **kwargs):
if change_fraction < min_change: if change_fraction < min_change:
return return
# send notification # send notification
diff = get_diff(id_) diff = get_diff(id_, {}).get('diff')
if not diff:
return
send_email(to=email, subject='%s page changed' % schedule.get('title'), send_email(to=email, subject='%s page changed' % schedule.get('title'),
body='changes:\n\n%s' % diff.get('diff')) body='changes:\n\n%s' % diff)
def safe_run_job(id_=None, *args, **kwargs): def safe_run_job(id_=None, *args, **kwargs):

40
dist/index.html vendored
View file

@ -3,18 +3,28 @@
{% block body %} {% block body %}
<div id="app"> <div id="app">
<div class="md-layout"> <div class="md-layout">
<div class="md-layout-item" md-card> <div class="md-layout-item">
<md-table id="schedules-table" v-model="schedules"> <md-card id="main-card">
<md-table-toolbar> <md-card-header>
<h1 class="md-title">Schedules <a href="schedule.html">add new</a></h1> <div class="md-title">
</md-table-toolbar> Card without hover effect
<md-table-row slot="md-table-row" slot-scope="{item}"> <md-button href="/schedule.html" class="md-icon-button md-primary">
<md-table-cell md-label="#" md-sort-by="id" md-numeric><a :href="'/schedule.html?id=' + item.id">${ item.id }</a></md-table-cell> <md-icon>add_circle_outline</md-icon>
<md-table-cell md-label="title" md-sort-by="title"><a :href="'/schedule.html?id=' + item.id">${ item.title }</a></md-table-cell> </md-button>
<md-table-cell md-label="url" md-sort-by="email"><a :href="item.url" target="_new">${ item.url }</a></md-table-cell> </div>
<md-table-cell md-label="history" md-sort-by="email"><a :href="'/history.html?id=' + item.id">history</a></md-table-cell> </md-card-header>
</md-table-row>
</md-table> <md-card-content>
<md-table id="schedules-table" v-model="schedules">
<md-table-row slot="md-table-row" slot-scope="{item}">
<md-table-cell md-label="#" md-sort-by="id" md-numeric><a :href="'/schedule.html?id=' + item.id">${ item.id }</a></md-table-cell>
<md-table-cell md-label="title" md-sort-by="title"><a :href="'/schedule.html?id=' + item.id">${ item.title }</a></md-table-cell>
<md-table-cell md-label="url" md-sort-by="email"><a :href="item.url" target="_new">${ item.url }</a></md-table-cell>
<md-table-cell md-label="history" md-sort-by="email"><a :href="'/history.html?id=' + item.id">history</a></md-table-cell>
</md-table-row>
</md-table>
</md-card-content>
</md-card>
</div> </div>
</div> </div>
</div> </div>
@ -38,7 +48,6 @@ var app = new Vue({
getSchedules: function() { getSchedules: function() {
self = this; self = this;
var data = axios.get('/api/schedules').then(function(response) { var data = axios.get('/api/schedules').then(function(response) {
console.log(response);
var schedules = []; var schedules = [];
_.forEach(response.data.schedules || {}, function(value, key) { _.forEach(response.data.schedules || {}, function(value, key) {
value.id = key; value.id = key;
@ -55,12 +64,11 @@ var app = new Vue({
body { body {
background-color: white; background-color: white;
padding: 6px;
} }
.md-table { .md-table {
width: 60%; height: 80%;
min-height: 400px;
max-height: 800px;
} }
</style> </style>