1
0
mirror of https://github.com/strongdm/comply synced 2024-11-21 15:14:54 +00:00

switch cron to 6-figure expressions. introduce hashes by tab.

This commit is contained in:
Justin McCarthy 2018-05-17 18:27:21 -07:00
parent 65c0a598ad
commit e04e5d7d89
No known key found for this signature in database
GPG Key ID: 900437410E142A48
4 changed files with 21 additions and 4 deletions

View File

@ -13,11 +13,24 @@ html lang=en
= javascript
document.addEventListener("DOMContentLoaded", function(event) {
document.querySelectorAll('.cron').forEach(function(el) {
el.innerHTML = prettyCron.toString(el.innerHTML)
el.innerHTML = prettyCron.toString((""+el.innerHTML).trim(),true) // 6-field expressions
})
if (window.location.hash != "") {
var hashComponents = window.location.hash.split('#')
if (hashComponents.length>1) {
var destination = hashComponents[1]
if (["overview","narratives","policies","procedures","standards"].indexOf(destination) >= 0) {
show(destination)
}
}
}
})
function show(name) {
if(history.replaceState) {
history.replaceState(null, null, '#'+name);
}
var items = document.getElementsByClassName('top-nav')
for (var i=0; i<items.length; i++) {
var item = items[i]
@ -221,4 +234,6 @@ html lang=en
p {{.Project.OrganizationName}} Confidential 2018
= javascript
// commented for development
show('overview')
if (window.location.hash=="") {
show('overview')
}

View File

@ -22,7 +22,7 @@ const websocketReloader = `<script>
ws.onclose = function(e) {
// reload!
if (connected) {
window.location=window.location
window.location.reload(true)
}
}
})()

View File

@ -98,6 +98,8 @@ func TriggerScheduled() error {
}
func trigger(procedure *model.Procedure) {
fmt.Printf("triggering procedure %s (cron expression: %s)\n", procedure.Name, procedure.Cron)
// TODO: don't hardcode GH
tp := model.GetPlugin(model.GitHub)
tp.Create(&model.Ticket{

View File

@ -13,7 +13,7 @@ html lang=en
= javascript
document.addEventListener("DOMContentLoaded", function(event) {
document.querySelectorAll('.cron').forEach(function(el) {
el.innerHTML = prettyCron.toString(el.innerHTML)
el.innerHTML = prettyCron.toString(el.innerHTML,true) // 6-field expressions
})
})