Skip to content

Commit

Permalink
log panel
Browse files Browse the repository at this point in the history
  • Loading branch information
jtvberg committed Dec 31, 2023
1 parent c8ba4f8 commit c557169
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 4 deletions.
3 changes: 2 additions & 1 deletion build/afterSign.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ exports.default = function (context) {
appBundleId: 'com.jtvberg.streamdock',
appPath: `${appDir}/${appName}.app`,
appleId: process.env.appleId,
appleIdPassword: process.env.appleIdPassword
appleIdPassword: process.env.appleIdPassword,
teamId: process.env.teamId
})
} else if (process.platform === 'win32') {
// VMP sign via EVS
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"start": "electron .",
"debug": "electron --inspect=7171 .",
"break": "electron --inspect-brk=7171 .",
"buildMacTest": "electron-builder -m --arm64",
"buildMac": "electron-builder -m --x64 --arm64",
"buildWin": "electron-builder -w",
"buildLinux": "electron-builder -l"
Expand Down Expand Up @@ -49,7 +50,6 @@
"mirror": "https://github.com/castlabs/electron-releases/releases/download/v"
},
"afterPack": "./build/afterPack.js",
"afterSign": "./build/afterSign.js",
"mac": {
"category": "public.app-category.video"
},
Expand Down
10 changes: 8 additions & 2 deletions public/css/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ button:active {
}

select,
input {
input,
.log {
font-size: 1rem;
font-family: monospace;
outline: none;
Expand All @@ -94,7 +95,12 @@ input {
height: 32px;
padding: 0px 5px;
color: var(--color-control-white);
background-color: var(--color-control-darkgray);;
background-color: var(--color-control-darkgray);
}

.log {
height: -webkit-fill-available;
resize: none;
}

select {
Expand Down
6 changes: 6 additions & 0 deletions public/css/search.css
Original file line number Diff line number Diff line change
Expand Up @@ -295,4 +295,10 @@
#next-page-btn:hover {
border-color: transparent;
color: var(--color-system-accent);
}

#advanced-log-text {
border-radius: 5px;
color: var(--color-control-white);
background-color: var(--color-control-darkgray);
}
5 changes: 5 additions & 0 deletions public/css/settings.css
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,11 @@
display: grid;
}

.settings-log {
display: grid;
grid-template-rows: max-content auto max-content;
}

.settings-label {
margin: auto 0px;
line-height: 1;
Expand Down
22 changes: 22 additions & 0 deletions public/js/renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ let headerTimeOut
let editMode = false

// Functions
const logOutput = log => {
const logTs = new Date().toLocaleString()
document.querySelector('#log-text').value += `${logTs}: ${log}\n`
}

// create stream element for stream bar, stream edit panel and append add new stream element
const loadStreams = () => {
$streamControls.replaceChildren([])
Expand Down Expand Up @@ -121,6 +126,8 @@ const applySettings = () => {

loadClearDataPanel()

loadLogPanel()

window.electronAPI.defaultAgent(getDefaultAgent())

window.electronAPI.headerHeight({ height: headerCollapsed, base: headerCollapsed })
Expand Down Expand Up @@ -166,6 +173,7 @@ const loadStreamBar = stream => {
ele.addEventListener('click', e => {
togglePanel(null, true)
window.electronAPI.openUrl(e.target.dataset.url)
logOutput(e.target.dataset.url)
})
ele.addEventListener('dblclick', e => e.stopPropagation())
frag.appendChild(ele)
Expand Down Expand Up @@ -475,6 +483,20 @@ const loadSettingsPanel = pref => {
}
}

// load log elements
const loadLogPanel = () => {
const frag = document.createDocumentFragment()
const ele = elementFromHtml(`<div class="settings-control settings-log" title="StreamDock Log" style="height: 100%;"></div>`)
const lbl = elementFromHtml(`<div>StreamDock Log</div>`)
const pane = elementFromHtml(`<textarea id="log-text" class="log"></textarea>`)
const desc = elementFromHtml(`<div class="text-muted">When things get weird...</div>`)
ele.appendChild(lbl)
ele.appendChild(pane)
ele.appendChild(desc)
frag.appendChild(ele)
$advancedLayout.appendChild(frag)
}

// load clear data elements
const loadClearDataPanel = () => {
let restart = true
Expand Down
1 change: 1 addition & 0 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ const showWin = () => {
windows.forEach(win => win.show())
headerView.webContents.executeJavaScript('localStorage.getItem("pref-resume");', true).then(response => {
if (response === 'true' && resumePlaying) {
console.log('play')
playVideo(streamView)
}
})
Expand Down

0 comments on commit c557169

Please sign in to comment.