mirror of
https://github.com/YunoHost/yunorunner.git
synced 2024-09-03 20:05:52 +02:00
[enh] split template and DRY using jinja2
This commit is contained in:
parent
10a1bb3ef3
commit
9e24d3e1f7
5 changed files with 476 additions and 475 deletions
1
run.py
1
run.py
|
@ -46,6 +46,7 @@ LOGGING_CONFIG_DEFAULTS["formatters"]["background"] = {
|
|||
task_logger = logging.getLogger("task")
|
||||
|
||||
app = Sanic()
|
||||
app.static('/static', './static/')
|
||||
|
||||
jinja = SanicJinja2(app)
|
||||
|
||||
|
|
0
static/js/app.js
Normal file
0
static/js/app.js
Normal file
16
templates/base.html
Normal file
16
templates/base.html
Normal file
|
@ -0,0 +1,16 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title><% block title %>YunoRunner for CI<% endblock %></title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css">
|
||||
<script defer src="https://use.fontawesome.com/releases/v5.1.0/js/all.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
|
||||
<script src="/static/js/app.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<% block content %><% endblock %>
|
||||
<% block javascript %><% endblock %>
|
||||
</body>
|
||||
</html>
|
|
@ -1,15 +1,7 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>YunoRunner for CI</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css">
|
||||
<script defer src="https://use.fontawesome.com/releases/v5.1.0/js/all.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
<section class="section">
|
||||
<% extends "base.html" %>
|
||||
|
||||
<% block content %>
|
||||
<section class="section">
|
||||
<div class="container">
|
||||
<h1 class="title">Tasks</h1>
|
||||
<div id="jobs">
|
||||
|
@ -35,8 +27,11 @@
|
|||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<script>
|
||||
</section>
|
||||
<% endblock %>
|
||||
|
||||
<% block javascript %>
|
||||
<script>
|
||||
(function() {
|
||||
var app = new Vue({
|
||||
el: '#jobs',
|
||||
|
@ -71,6 +66,5 @@
|
|||
}
|
||||
};
|
||||
})()
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</script>
|
||||
<% endblock %>
|
||||
|
|
|
@ -1,19 +1,7 @@
|
|||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<title>YunoRunner for CI</title>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css">
|
||||
<script defer src="https://use.fontawesome.com/releases/v5.1.0/js/all.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.3.1.min.js"
|
||||
integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8="
|
||||
crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.1/css/bulma.min.css"></script>
|
||||
</head>
|
||||
<body>
|
||||
<section class="section" id="job">
|
||||
<% extends "base.html" %>
|
||||
|
||||
<% block content %>
|
||||
<section class="section" id="job">
|
||||
<div class="container">
|
||||
<h1 class="title">Job '{{job.name}}'</h1>
|
||||
|
||||
|
@ -31,8 +19,11 @@
|
|||
<h2 class="subtitle">Excution log:</h2>
|
||||
<pre class="consoleOutput" v-html="logWithColors"></pre>
|
||||
</div>
|
||||
</section>
|
||||
<style>
|
||||
</section>
|
||||
<% endblock %>
|
||||
|
||||
<% block javascript %>
|
||||
<style>
|
||||
.consoleOutput {
|
||||
max-height: 90vh;
|
||||
background-color: #222;
|
||||
|
@ -42,8 +33,8 @@
|
|||
padding-bottom: 1.25rem;
|
||||
padding-left: 1.5rem;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
</style>
|
||||
<script>
|
||||
(function() {
|
||||
/* ansi_up.js
|
||||
* author : Dru Nelson
|
||||
|
@ -416,6 +407,5 @@
|
|||
}
|
||||
};
|
||||
})()
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
</script>
|
||||
<% endblock %>
|
||||
|
|
Loading…
Add table
Reference in a new issue