mirror of
https://github.com/coalaura/whiskr.git
synced 2025-12-02 20:22:52 +00:00
auto-update model list and show creation date
This commit is contained in:
@@ -1451,7 +1451,7 @@
|
||||
// render models
|
||||
fillSelect($model, data.models, (el, model) => {
|
||||
el.value = model.id;
|
||||
el.title = model.description;
|
||||
el.title = `${model.name} (${formatTimestamp(model.created)})\n---\n${model.description}`;
|
||||
el.textContent = model.name;
|
||||
|
||||
el.dataset.tags = (model.tags || []).join(",");
|
||||
|
||||
@@ -97,7 +97,6 @@
|
||||
// option label
|
||||
const _label = make("div", "label");
|
||||
|
||||
_label.title = option.label;
|
||||
_label.textContent = option.label;
|
||||
|
||||
_opt.appendChild(_label);
|
||||
|
||||
@@ -56,6 +56,10 @@ function formatMilliseconds(ms) {
|
||||
return `${Math.round(ms / 1000)}s`;
|
||||
}
|
||||
|
||||
function formatTimestamp(ts) {
|
||||
return new Date(ts * 1000).toLocaleDateString();
|
||||
}
|
||||
|
||||
function dataBlob(dataUrl) {
|
||||
const [header, data] = dataUrl.split(","),
|
||||
mime = header.match(/data:(.*?)(;|$)/)[1];
|
||||
|
||||
Reference in New Issue
Block a user