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")
|
task_logger = logging.getLogger("task")
|
||||||
|
|
||||||
app = Sanic()
|
app = Sanic()
|
||||||
|
app.static('/static', './static/')
|
||||||
|
|
||||||
jinja = SanicJinja2(app)
|
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>
|
<% extends "base.html" %>
|
||||||
<html>
|
|
||||||
<head>
|
<% block content %>
|
||||||
<title>YunoRunner for CI</title>
|
<section class="section">
|
||||||
<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">
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1 class="title">Tasks</h1>
|
<h1 class="title">Tasks</h1>
|
||||||
<div id="jobs">
|
<div id="jobs">
|
||||||
|
@ -35,8 +27,11 @@
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<script>
|
<% endblock %>
|
||||||
|
|
||||||
|
<% block javascript %>
|
||||||
|
<script>
|
||||||
(function() {
|
(function() {
|
||||||
var app = new Vue({
|
var app = new Vue({
|
||||||
el: '#jobs',
|
el: '#jobs',
|
||||||
|
@ -71,6 +66,5 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})()
|
})()
|
||||||
</script>
|
</script>
|
||||||
</body>
|
<% endblock %>
|
||||||
</html>
|
|
||||||
|
|
|
@ -1,19 +1,7 @@
|
||||||
<!doctype html>
|
<% extends "base.html" %>
|
||||||
<html>
|
|
||||||
<head>
|
<% block content %>
|
||||||
<title>YunoRunner for CI</title>
|
<section class="section" id="job">
|
||||||
<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">
|
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<h1 class="title">Job '{{job.name}}'</h1>
|
<h1 class="title">Job '{{job.name}}'</h1>
|
||||||
|
|
||||||
|
@ -31,8 +19,11 @@
|
||||||
<h2 class="subtitle">Excution log:</h2>
|
<h2 class="subtitle">Excution log:</h2>
|
||||||
<pre class="consoleOutput" v-html="logWithColors"></pre>
|
<pre class="consoleOutput" v-html="logWithColors"></pre>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
<style>
|
<% endblock %>
|
||||||
|
|
||||||
|
<% block javascript %>
|
||||||
|
<style>
|
||||||
.consoleOutput {
|
.consoleOutput {
|
||||||
max-height: 90vh;
|
max-height: 90vh;
|
||||||
background-color: #222;
|
background-color: #222;
|
||||||
|
@ -42,8 +33,8 @@
|
||||||
padding-bottom: 1.25rem;
|
padding-bottom: 1.25rem;
|
||||||
padding-left: 1.5rem;
|
padding-left: 1.5rem;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
(function() {
|
(function() {
|
||||||
/* ansi_up.js
|
/* ansi_up.js
|
||||||
* author : Dru Nelson
|
* author : Dru Nelson
|
||||||
|
@ -416,6 +407,5 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
})()
|
})()
|
||||||
</script>
|
</script>
|
||||||
</body>
|
<% endblock %>
|
||||||
</html>
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue