Updating UI to use the updated at.
This commit is contained in:
parent
06353409bc
commit
a54b582e0d
|
@ -17,13 +17,9 @@ let CLIENT = env.isTest() ? new Redis(getRedisOptions()) : null
|
||||||
function init() {
|
function init() {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
// testing uses a single in memory client
|
// testing uses a single in memory client
|
||||||
if (env.isTest()) {
|
if (env.isTest() || (CLIENT && CONNECTED)) {
|
||||||
return resolve(CLIENT)
|
return resolve(CLIENT)
|
||||||
}
|
}
|
||||||
// if a connection existed, close it and re-create it
|
|
||||||
if (CLIENT && CONNECTED) {
|
|
||||||
return CLIENT
|
|
||||||
}
|
|
||||||
const { opts, host, port } = getRedisOptions(CLUSTERED)
|
const { opts, host, port } = getRedisOptions(CLUSTERED)
|
||||||
if (CLUSTERED) {
|
if (CLUSTERED) {
|
||||||
CLIENT = new Redis.Cluster([{ host, port }], opts)
|
CLIENT = new Redis.Cluster([{ host, port }], opts)
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
import { gradient } from "actions"
|
import { gradient } from "actions"
|
||||||
import { auth } from "stores/portal"
|
import { auth } from "stores/portal"
|
||||||
import { AppStatus } from "constants"
|
import { AppStatus } from "constants"
|
||||||
|
import { processStringSync } from "@budibase/string-templates"
|
||||||
|
|
||||||
export let app
|
export let app
|
||||||
export let exportApp
|
export let exportApp
|
||||||
|
@ -62,7 +63,13 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="status">
|
<div class="status">
|
||||||
<Body size="S">
|
<Body size="S">
|
||||||
Updated {Math.floor(1 + Math.random() * 10)} months ago
|
{#if app.updatedAt}
|
||||||
|
{processStringSync("Updated {{ duration time 'millisecond' }} ago", {
|
||||||
|
time: (new Date().getTime() - new Date(app.updatedAt).getTime())
|
||||||
|
})}
|
||||||
|
{:else}
|
||||||
|
Never updated
|
||||||
|
{/if}
|
||||||
</Body>
|
</Body>
|
||||||
<StatusLight active={app.deployed} neutral={!app.deployed}>
|
<StatusLight active={app.deployed} neutral={!app.deployed}>
|
||||||
{#if app.deployed}Published{:else}Unpublished{/if}
|
{#if app.deployed}Published{:else}Unpublished{/if}
|
||||||
|
|
|
@ -190,6 +190,8 @@ exports.create = async function (ctx) {
|
||||||
url: url,
|
url: url,
|
||||||
template: ctx.request.body.template,
|
template: ctx.request.body.template,
|
||||||
instance: instance,
|
instance: instance,
|
||||||
|
updatedAt: new Date().toISOString(),
|
||||||
|
createdAt: new Date().toISOString(),
|
||||||
deployment: {
|
deployment: {
|
||||||
type: "cloud",
|
type: "cloud",
|
||||||
},
|
},
|
||||||
|
|
|
@ -8,7 +8,7 @@ let devAppClient, debounceClient
|
||||||
// reduces the performance hit
|
// reduces the performance hit
|
||||||
exports.init = async () => {
|
exports.init = async () => {
|
||||||
devAppClient = await new Client(utils.Databases.DEV_LOCKS).init()
|
devAppClient = await new Client(utils.Databases.DEV_LOCKS).init()
|
||||||
debounceClient = await new Client(utils.Databases).init()
|
debounceClient = await new Client(utils.Databases.DEBOUNCE).init()
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.doesUserHaveLock = async (devAppId, user) => {
|
exports.doesUserHaveLock = async (devAppId, user) => {
|
||||||
|
|
Loading…
Reference in New Issue