diff --git a/index.html b/index.html index 75b9930f..0a66e3bc 100644 --- a/index.html +++ b/index.html @@ -35,8 +35,10 @@

Host a GitHub Actions Marketplace in your own organi
- +
Dataset last updated:
+ diff --git a/script.js b/script.js index 9f91623c..d3fb04b7 100644 --- a/script.js +++ b/script.js @@ -21,7 +21,7 @@ function addActionPanel(mainElement, action) { var panel = document.createElement('div'); panel.className = "panel"; panel.id = action.repoName - panel.innerHTML = '
Repository:'+action.repoName+'
'; + panel.innerHTML = '
Repository:'+action.repoName+'
'; panel.innerHTML += '
Action:'+action.action.name+'
'; panel.innerHTML += '
Author:'+(action.action.author || "Not set") +'
'; panel.innerHTML += '
Description:
'+action.action.description+'
'; @@ -29,6 +29,19 @@ function addActionPanel(mainElement, action) { mainElement.appendChild(panel); } +function setLastUpdated(lastUpdated) { + var splitted = lastUpdated.split("_"); + var date = splitted[0]; + var time = splitted[1]; + + var splittedDate = date.split(/(?=(?:..)*$)/); + var splittedTime = time.split(/(?=(?:..)*$)/); + + var date = new Date(splittedDate[0]+splittedDate[1],splittedDate[2],splittedDate[3], splittedTime[0], splittedTime[1]); + + document.getElementById('lastUpdated').innerHTML = date.toLocaleString(); +} + function init() { loadFile(jsonFileToUrl, false, function(response) { console.log('found file with content' + response); @@ -40,7 +53,8 @@ function init() { var actionCountElement = document.getElementById('actionCount'); actionCountElement.innerHTML = json.actions.length; - + setLastUpdated(json.lastUpdated); + for(var index in json.actions) { var action = json.actions[index]; diff --git a/style.css b/style.css index bdb7c770..c15b32cb 100644 --- a/style.css +++ b/style.css @@ -155,4 +155,13 @@ article, aside, details, figcaption, figure, footer, header, hgroup, main, menu, .top { clear: both; +} + +#lastUpdatePanel { + margin-bottom: 5px; + clear: both; +} + +#lastUpdated { + margin-left: 5px; } \ No newline at end of file