Compare commits
6 commits
Author | SHA1 | Date | |
---|---|---|---|
f01fc2ac02 | |||
d175782f73 | |||
bdaf58b7b0 | |||
7f6d1546f2 | |||
e853474cdd | |||
455f667e88 |
7 changed files with 23 additions and 8 deletions
|
@ -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.get(ctx.db.data.core[app.name].versions, ctx.db.data.core[app.name].latestInstalled)
|
let version = ctx.db.data.core[app.name].versions[0]
|
||||||
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
|
||||||
|
|
|
@ -68,8 +68,10 @@ export function formatLog(data) {
|
||||||
|
|
||||||
delete rec.v;
|
delete rec.v;
|
||||||
|
|
||||||
|
let d = new Date(rec.time)
|
||||||
|
|
||||||
// Time.
|
// Time.
|
||||||
var time = '[' + rec.time.toISOString().replace('T', ' ').replace('Z', '') + ']'
|
var time = '[' + d.toISOString().replace('T', ' ').replace('Z', '') + ']'
|
||||||
time = stylize(time, 'none')
|
time = stylize(time, 'none')
|
||||||
|
|
||||||
delete rec.time;
|
delete rec.time;
|
||||||
|
|
15
api/util.mjs
15
api/util.mjs
|
@ -19,13 +19,20 @@ 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] = app.config
|
merge[app.name] = {
|
||||||
|
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 defaults(ctx.db.config, merge)
|
return merge
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getApp(ctx, name, action) {
|
export function getApp(ctx, name, action) {
|
||||||
|
@ -83,7 +90,7 @@ export function getStatus(ctx) {
|
||||||
active: active,
|
active: active,
|
||||||
latestInstalled: installed,
|
latestInstalled: installed,
|
||||||
updated: appDb.updater,
|
updated: appDb.updater,
|
||||||
running: app.running,
|
running: app.running || app.ctx.version,
|
||||||
updating: app.updating,
|
updating: app.updating,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ environment:
|
||||||
|
|
||||||
build_script:
|
build_script:
|
||||||
- sh: |
|
- sh: |
|
||||||
|
mkdir /lib64
|
||||||
ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
|
ln -s /lib/libc.musl-x86_64.so.1 /lib64/ld-linux-x86-64.so.2
|
||||||
chmod -R 777 /appveyor/projects
|
chmod -R 777 /appveyor/projects
|
||||||
npm install
|
npm install
|
||||||
|
@ -59,6 +60,9 @@ on_success:
|
||||||
-H "Authorization: token $deploytoken" \
|
-H "Authorization: token $deploytoken" \
|
||||||
-F "attachment=@${CURR_VER}_build-sc.7z" \
|
-F "attachment=@${CURR_VER}_build-sc.7z" \
|
||||||
https://git.nfp.is/api/v1/repos/$APPVEYOR_REPO_NAME/releases/$RELEASE_ID/assets
|
https://git.nfp.is/api/v1/repos/$APPVEYOR_REPO_NAME/releases/$RELEASE_ID/assets
|
||||||
|
|
||||||
|
echo "Deplying to production"
|
||||||
|
curl -X POST http://192.168.93.51:8881/update/manager | jq
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# on build failure
|
# on build failure
|
||||||
|
|
|
@ -26,7 +26,7 @@ const Header = {
|
||||||
m('div.seperator'),
|
m('div.seperator'),
|
||||||
m(m.route.Link, {
|
m(m.route.Link, {
|
||||||
href: '/log',
|
href: '/log',
|
||||||
class: path === '/log' ? 'active' : '',
|
class: path.startsWith('/log') ? 'active' : '',
|
||||||
}, 'Log'),
|
}, 'Log'),
|
||||||
m('div.seperator'),
|
m('div.seperator'),
|
||||||
m(m.route.Link, {
|
m(m.route.Link, {
|
||||||
|
|
|
@ -10,6 +10,8 @@ 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)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "sc-manager",
|
"name": "sc-manager",
|
||||||
"version": "2.0.0",
|
"version": "2.0.6",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|
Loading…
Reference in a new issue