Skip to content

Commit

Permalink
偵錯模式下的版本號改為 commit hash
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoOwO committed Aug 12, 2018
1 parent b8e487d commit f3a9eca
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ app.get('/info', (req, res) => {
}
})

if (config.PokaPlayer.debug) app.get('/debug', (req, res) => {
res.send('true')
app.get('/debug', async(req, res) => {
res.send(config.PokaPlayer.debug ? (await git.raw(['rev-parse', '--short', 'HEAD'])).slice(0,-1) : 'false')
})

// get song
Expand Down
9 changes: 5 additions & 4 deletions js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -962,11 +962,12 @@ async function showSettings() {
let checkUpdate = await axios.get(`https://api.github.com/repos/gnehs/PokaPlayer/releases`);
let update = getInfo.data.version != checkUpdate.data[0].tag_name
? `新版本 <a href="${checkUpdate.data[0].html_url}" target="_blank">${checkUpdate.data[0].tag_name}</a> 已發佈,請立即更新 <a href="javascript:void(0)" data-upgrade>更新</a>`
: debug.data == true
? `<a href="javascript:void(0)" data-upgrade>與開發分支同步</a>`
:`您的 PokaPlayer 已是最新版本`
: debug.data == false
? `您的 PokaPlayer 已是最新版本`
: `<a href="javascript:void(0)" data-upgrade>與開發分支同步</a>`
let version = debug.data == false ? getInfo.data.version : debug.data
about = `PokaPlayer 是 Synology Audio Ststion 的新朋友! <a href="https://github.com/gnehs/PokaPlayer" target="_blank">GitHub</a>
<p><strong>版本</strong> ${getInfo.data.version} / <strong>開發者</strong> ${getInfo.data.author} / ${update}</p>`
<p><strong>版本</strong> ${version} / <strong>開發者</strong> ${getInfo.data.author} / ${update}</p>`
$("#about").html(about)


Expand Down

0 comments on commit f3a9eca

Please sign in to comment.