More changes and development fixes

This commit is contained in:
Jonatan Nilsson 2020-09-13 01:01:16 +00:00
parent 68decbf67d
commit 146a957684
6 changed files with 21 additions and 5 deletions

View file

@ -56,7 +56,7 @@ export async function update(ctx, data, cb) {
ctx.log.event.warn('Invalid update command for app ' + data.name)
return
}
await ctx.core.updateProgram(data.name)
await ctx.core.installLatestVersion(data.name)
}
/*

View file

@ -8,6 +8,8 @@ import onConnection from './routerio.mjs'
export function run(config, db, log, core, http, port) {
return new Promise(function(resolve, reject) {
core.startMonitor()
const __dirname = path.dirname(fileURLToPath(import.meta.url))
const staticRoot = path.join(__dirname,'../public')

View file

@ -6,9 +6,11 @@ const Log = Module({
init: function() {
this.connected = socket.connected
this.loglines = []
this.logUpdated = false
this.on('newlog', data => {
this.loglines.push(this.formatLine(data))
this.logUpdated = true
m.redraw()
})
@ -24,6 +26,7 @@ const Log = Module({
socket.emit('core.listenlogs', {})
socket.emit('core.getlastlogs', {}, (res) => {
this.loglines = res.map(this.formatLine)
this.logUpdated = true
m.redraw()
})
},
@ -43,7 +46,14 @@ const Log = Module({
view: function() {
return [
m('h1.header', 'Log'),
m('div#logger', [
m('div#logger', {
onupdate: (vnode) => {
if (this.logUpdated) {
vnode.dom.scrollTop = vnode.dom.scrollHeight
this.logUpdated = false
}
}
}, [
this.loglines.map((line, i) => {
return m('div', { key: i }, line)
}),

View file

@ -114,12 +114,12 @@ const Updater = Module({
m('div.filler'),
m(m.route.Link, {
hidden: !this.appRepository,
class: 'button' + (this.activeApp === 'app' ? ' active' : ''),
class: 'button ' + (this.activeApp === 'app' ? 'active' : 'inactive'),
href: '/updater/app',
}, 'Update App'),
m(m.route.Link, {
hidden: !this.manageRepository,
class: 'button' + (this.activeApp === 'manage' ? ' active' : ''),
class: 'button ' + (this.activeApp === 'manage' ? 'active' : 'inactive'),
href: '/updater/manage',
}, 'Update Manager'),
]),

View file

@ -1,5 +1,6 @@
{
"name": "service-core-manage",
"githubAuthToken": null,
"serviceName": "Service-Core Manager",
"description": "Manager for service core",
"port": 4270,

View file

@ -221,10 +221,13 @@ pre {
#update .actions .filler {
flex-grow: 2;
}
#update .actions .button.active {
#update .actions .button.inactive {
background: transparent;
color: #ffb843;
}
#update .actions .button.active {
}
@media only screen and (max-device-width: 590px) {
#update .actions .filler {