mirror of
https://bitbucket.org/studiotem/jandl-taskmanager-app.git
synced 2026-10-21 22:39:34 +00:00
.
This commit is contained in:
1 parent
ef7ab9dd17
commit
1b7315617f
4 files changed
+105
-29
No files matched your search
@@ -12,35 +12,35 @@ export function getServerLinks(description) {
|
||||
const text = p.textContent.trim()
|
||||
|
||||
if (os === 'mac' && text.startsWith('smb://')) {
|
||||
links.add(`<a href="${text}" target="_blank" rel="noopener noreferrer">${text}</a>`)
|
||||
links.add(text)
|
||||
} else if (os === 'win' && text.startsWith('\\\\')) {
|
||||
links.add(`<a href="file://${text.replace(/\\/g, '/')}" target="_blank" rel="noopener noreferrer">${text}</a>`)
|
||||
links.add(`${text.replace(/\//g, '\\')}`)
|
||||
} else if (os === 'mac' && text.startsWith('\\\\')) {
|
||||
const smbLink = 'smb:' + text.replace(/\\/g, '/')
|
||||
links.add(`<a href="${smbLink}" target="_blank" rel="noopener noreferrer">${smbLink}</a>`)
|
||||
links.add(smbLink)
|
||||
} else if (os === 'win' && text.startsWith('smb://')) {
|
||||
const windowsLink = text.replace(/^smb:/, '').replace(/\//g, '\\')
|
||||
links.add(`<a href="file://${windowsLink}" target="_blank" rel="noopener noreferrer">${windowsLink}</a>`)
|
||||
links.add(`${windowsLink}`)
|
||||
}
|
||||
|
||||
const anchor = p.querySelector('a')
|
||||
if (anchor) {
|
||||
const href = anchor.getAttribute('href')
|
||||
if (os === 'mac' && href.startsWith('smb://')) {
|
||||
links.add(`<a href="${href}" target="_blank" rel="noopener noreferrer">${href}</a>`)
|
||||
links.add(href)
|
||||
} else if (os === 'win' && href.startsWith('\\\\')) {
|
||||
links.add(`<a href="file://${href.replace(/\\/g, '/')}" target="_blank" rel="noopener noreferrer">${href}</a>`)
|
||||
links.add(`${href.replace(/\//g, '\\')}`)
|
||||
} else if (os === 'mac' && href.startsWith('\\\\')) {
|
||||
const smbLink = 'smb:' + href.replace(/\\/g, '/')
|
||||
links.add(`<a href="${smbLink}" target="_blank" rel="noopener noreferrer">${smbLink}</a>`)
|
||||
links.add(smbLink)
|
||||
} else if (os === 'win' && href.startsWith('smb://')) {
|
||||
const windowsLink = href.replace(/^smb:/, '').replace(/\//g, '\\')
|
||||
links.add(`<a href="file://${windowsLink}" target="_blank" rel="noopener noreferrer">${windowsLink}</a>`)
|
||||
links.add(`${windowsLink}`)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
return Array.from(links).join('<br>')
|
||||
return Array.from(links)
|
||||
}
|
||||
|
||||
export function detectOS() {
|
||||
|
||||
Reference in new issue
Block a user