Skip to content

Commit

Permalink
Update errorlogs.mako
Browse files Browse the repository at this point in the history
  • Loading branch information
sharkykh committed Aug 22, 2018
1 parent 05ab1ae commit 13f5c18
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 42 deletions.
29 changes: 15 additions & 14 deletions themes-default/slim/views/errorlogs.mako
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
<%inherit file="/layouts/main.mako"/>
<%!
from medusa import logger
from medusa import classes
from medusa import classes, logger
%>
<%block name="scripts">
<%
if logLevel == logger.WARNING:
page_header = 'Warning Logs'
else:
page_header = 'Error Logs'
%>
<script>
const { mapState } = window.Vuex;
window.app = {};
window.app = new Vue({
store,
router,
el: '#vue-wrap',
data() {
return {
header: '${page_header}'
};
}
// @TODO: Replace with Object destructuring (`...mapState`)
computed: Object.assign(mapState({
loggingLevels: state => state.config.logs.loggingLevels
}), {
header() {
const { loggingLevels, $route } = this;
if (Number($route.query.level) === loggingLevels.warning) {
return 'Warning Logs';
}
return 'Error Logs';
}
})
});
</script>
</%block>
Expand Down
29 changes: 15 additions & 14 deletions themes/dark/templates/errorlogs.mako
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
<%inherit file="/layouts/main.mako"/>
<%!
from medusa import logger
from medusa import classes
from medusa import classes, logger
%>
<%block name="scripts">
<%
if logLevel == logger.WARNING:
page_header = 'Warning Logs'
else:
page_header = 'Error Logs'
%>
<script>
const { mapState } = window.Vuex;
window.app = {};
window.app = new Vue({
store,
router,
el: '#vue-wrap',
data() {
return {
header: '${page_header}'
};
}
// @TODO: Replace with Object destructuring (`...mapState`)
computed: Object.assign(mapState({
loggingLevels: state => state.config.logs.loggingLevels
}), {
header() {
const { loggingLevels, $route } = this;
if (Number($route.query.level) === loggingLevels.warning) {
return 'Warning Logs';
}
return 'Error Logs';
}
})
});
</script>
</%block>
Expand Down
29 changes: 15 additions & 14 deletions themes/light/templates/errorlogs.mako
Original file line number Diff line number Diff line change
@@ -1,27 +1,28 @@
<%inherit file="/layouts/main.mako"/>
<%!
from medusa import logger
from medusa import classes
from medusa import classes, logger
%>
<%block name="scripts">
<%
if logLevel == logger.WARNING:
page_header = 'Warning Logs'
else:
page_header = 'Error Logs'
%>
<script>
const { mapState } = window.Vuex;
window.app = {};
window.app = new Vue({
store,
router,
el: '#vue-wrap',
data() {
return {
header: '${page_header}'
};
}
// @TODO: Replace with Object destructuring (`...mapState`)
computed: Object.assign(mapState({
loggingLevels: state => state.config.logs.loggingLevels
}), {
header() {
const { loggingLevels, $route } = this;
if (Number($route.query.level) === loggingLevels.warning) {
return 'Warning Logs';
}
return 'Error Logs';
}
})
});
</script>
</%block>
Expand Down

0 comments on commit 13f5c18

Please sign in to comment.