statistics: Better display on the front page
This commit is contained in:
parent
bc1bf0db1c
commit
9a1cf4e53b
12 changed files with 181 additions and 59 deletions
|
|
@ -27,6 +27,12 @@
|
|||
<a href="{{.URL}}" target="_blank" rel="noopener noreferrer">{{.URL}}</a><br>
|
||||
<small>
|
||||
{{ .Statistics.Bundles.Summary }}
|
||||
|
||||
{{ $edit := .Statistics.Bundles.LastEdit }}
|
||||
{{ if $edit.Valid }}
|
||||
<br />
|
||||
last edited {{ $edit.Time.Format "2006-01-02T15:04:05Z07:00" }}
|
||||
{{ end }}
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -310,7 +310,7 @@
|
|||
<code>{{ .Count }}</code>
|
||||
</td>
|
||||
<td>
|
||||
<code>{{ .LastEdit }}</code>
|
||||
<code class="date">{{ .LastEdit.Time.Format "2006-01-02T15:04:05Z07:00" }}</code>
|
||||
</td>
|
||||
<td>
|
||||
<code>{{ .MainBundle }}</code>
|
||||
|
|
|
|||
|
|
@ -16,13 +16,13 @@ var AssetsComponentsIndex = Assets{
|
|||
|
||||
// AssetsControlIndex contains assets for the 'ControlIndex' entrypoint.
|
||||
var AssetsControlIndex = Assets{
|
||||
Scripts: `<script type="module" src="/static/HomeHome.38d394c2.js"></script><script src="/static/HomeHome.38d394c2.js" nomodule="" defer></script><script type="module" src="/static/ControlIndex.cfbf936d.js"></script><script src="/static/ControlIndex.613b02c2.js" nomodule="" defer></script>`,
|
||||
Scripts: `<script type="module" src="/static/HomeHome.38d394c2.js"></script><script src="/static/HomeHome.38d394c2.js" nomodule="" defer></script><script type="module" src="/static/ControlIndex.6d1d8ee0.js"></script><script src="/static/ControlIndex.03d7b00f.js" nomodule="" defer></script>`,
|
||||
Styles: `<link rel="stylesheet" href="/static/HomeHome.a75f04fa.css"><link rel="stylesheet" href="/static/ControlIndex.6d59e220.css"><link rel="stylesheet" href="/static/ControlIndex.6d2ae968.css">`,
|
||||
}
|
||||
|
||||
// AssetsControlInstance contains assets for the 'ControlInstance' entrypoint.
|
||||
var AssetsControlInstance = Assets{
|
||||
Scripts: `<script nomodule="" defer src="/static/ControlIndex.613b02c2.js"></script><script type="module" src="/static/ControlIndex.cfbf936d.js"></script><script type="module" src="/static/HomeHome.38d394c2.js"></script><script src="/static/HomeHome.38d394c2.js" nomodule="" defer></script><script type="module" src="/static/ControlInstance.66b95713.js"></script><script src="/static/ControlInstance.9cc7166d.js" nomodule="" defer></script>`,
|
||||
Scripts: `<script nomodule="" defer src="/static/ControlIndex.03d7b00f.js"></script><script type="module" src="/static/ControlIndex.6d1d8ee0.js"></script><script type="module" src="/static/HomeHome.38d394c2.js"></script><script src="/static/HomeHome.38d394c2.js" nomodule="" defer></script><script type="module" src="/static/ControlInstance.66b95713.js"></script><script src="/static/ControlInstance.9cc7166d.js" nomodule="" defer></script>`,
|
||||
Styles: `<link rel="stylesheet" href="/static/HomeHome.a75f04fa.css"><link rel="stylesheet" href="/static/ControlIndex.6d59e220.css"><link rel="stylesheet" href="/static/ControlIndex.6d2ae968.css"><link rel="stylesheet" href="/static/ControlInstance.38d394c2.css">`,
|
||||
}
|
||||
|
||||
|
|
|
|||
1
internal/dis/component/control/static/dist/ControlIndex.03d7b00f.js
vendored
Normal file
1
internal/dis/component/control/static/dist/ControlIndex.03d7b00f.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
1
internal/dis/component/control/static/dist/ControlIndex.6d1d8ee0.js
vendored
Normal file
1
internal/dis/component/control/static/dist/ControlIndex.6d1d8ee0.js
vendored
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,7 +1,17 @@
|
|||
import dayjs from "dayjs"
|
||||
const types: Record<string, (element: HTMLElement) => HTMLElement | string> = {
|
||||
"date": (element) => {
|
||||
return dayjs(element.innerText).format('YYYY-MM-DD HH:mm:ss ([UTC]Z)')
|
||||
const value = dayjs(element.innerText);
|
||||
const text = value.format('YYYY-MM-DD HH:mm:ss ([UTC]Z)')
|
||||
|
||||
// if the date is the zero date, then it is assumed to be invalid
|
||||
if (value.unix() === 0) {
|
||||
const code = document.createElement('code')
|
||||
code.style.color = 'gray'
|
||||
code.append(text)
|
||||
return code
|
||||
}
|
||||
return text
|
||||
},
|
||||
"path": (element) => {
|
||||
const text = element.innerText.split("/");
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue