Compare commits

..

No commits in common. "master" and "v2.0.2" have entirely different histories.

4 changed files with 6 additions and 15 deletions

View file

@ -102,7 +102,7 @@ export async function listentoapp(ctx, data) {
if (!app) return if (!app) return
ctx.socket.join('app.' + data.name) ctx.socket.join('app.' + data.name)
let version = ctx.db.data.core[app.name].versions[0] let version = ctx.db.get(ctx.db.data.core[app.name].versions, ctx.db.data.core[app.name].latestInstalled)
ctx.socket.emit('app.updatelog', { ctx.socket.emit('app.updatelog', {
name: data.name, name: data.name,
log: version?.log || ctx.db.data.core[app.name].updater log: version?.log || ctx.db.data.core[app.name].updater

View file

@ -19,20 +19,13 @@ export function safeWrap(log, name, fn) {
export function getConfig(ctx) { export function getConfig(ctx) {
let merge = { let merge = {
applications: [], applications: []
name: ctx.db.config.name || '',
title: ctx.db.config.title || '',
} }
for (let app of ctx.core.applications) { for (let app of ctx.core.applications) {
merge[app.name] = { merge[app.name] = app.config
provider: app.config.provider || null,
url: app.config.url || null,
port: app.config.port || null,
scAllowStop: app.config.scAllowStop || null,
}
merge.applications.push(app.name) merge.applications.push(app.name)
} }
return merge return defaults(ctx.db.config, merge)
} }
export function getApp(ctx, name, action) { export function getApp(ctx, name, action) {
@ -90,7 +83,7 @@ export function getStatus(ctx) {
active: active, active: active,
latestInstalled: installed, latestInstalled: installed,
updated: appDb.updater, updated: appDb.updater,
running: app.running || app.ctx.version, running: app.running,
updating: app.updating, updating: app.updating,
} }
} }

View file

@ -10,8 +10,6 @@ const core = {
status: {}, status: {},
} }
window.core = core
socket.on('core.config', function(res) { socket.on('core.config', function(res) {
core.apps = [] core.apps = []
let keys = Object.keys(res) let keys = Object.keys(res)

View file

@ -1,6 +1,6 @@
{ {
"name": "sc-manager", "name": "sc-manager",
"version": "2.0.6", "version": "2.0.2",
"description": "", "description": "",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {