mirror of
https://github.com/owntone/owntone-server.git
synced 2025-11-08 21:24:57 -05:00
Use relative paths in web interface to ease reolcation or proxying
This commit is contained in:
@@ -4,11 +4,11 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=1.0">
|
||||
<title>forked-daapd-web 2</title>
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon.png?ver1.1">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
|
||||
<link rel="manifest" href="/site.webmanifest">
|
||||
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
|
||||
<link rel="apple-touch-icon" sizes="120x120" href="apple-touch-icon.png?ver1.1">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
|
||||
<link rel="manifest" href="site.webmanifest">
|
||||
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#5bbad5">
|
||||
<meta name="msapplication-TileColor" content="#da532c">
|
||||
<meta name="theme-color" content="#ffffff">
|
||||
</head>
|
||||
|
||||
@@ -81,7 +81,7 @@
|
||||
</div>
|
||||
<div class="level-item fd-expanded">
|
||||
<div class="fd-expanded">
|
||||
<p class="heading" :class="{ 'has-text-grey-light': !playing }">HTTP stream <a href="/stream.mp3"><span class="is-lowercase">(stream.mp3)</span></a></p>
|
||||
<p class="heading" :class="{ 'has-text-grey-light': !playing }">HTTP stream <a href="stream.mp3"><span class="is-lowercase">(stream.mp3)</span></a></p>
|
||||
<range-slider
|
||||
class="slider fd-has-action"
|
||||
min="0"
|
||||
@@ -174,7 +174,7 @@
|
||||
</div>
|
||||
<div class="level-item fd-expanded">
|
||||
<div class="fd-expanded">
|
||||
<p class="heading" :class="{ 'has-text-grey-light': !playing }">HTTP stream <a href="/stream.mp3"><span class="is-lowercase">(stream.mp3)</span></a></p>
|
||||
<p class="heading" :class="{ 'has-text-grey-light': !playing }">HTTP stream <a href="stream.mp3"><span class="is-lowercase">(stream.mp3)</span></a></p>
|
||||
<range-slider
|
||||
class="slider fd-has-action"
|
||||
min="0"
|
||||
|
||||
@@ -12,51 +12,51 @@ axios.interceptors.response.use(function (response) {
|
||||
|
||||
export default {
|
||||
config () {
|
||||
return axios.get('/api/config')
|
||||
return axios.get('./api/config')
|
||||
},
|
||||
|
||||
settings () {
|
||||
return axios.get('/api/settings')
|
||||
return axios.get('./api/settings')
|
||||
},
|
||||
|
||||
settings_update (categoryName, option) {
|
||||
return axios.put('/api/settings/' + categoryName + '/' + option.name, option)
|
||||
return axios.put('./api/settings/' + categoryName + '/' + option.name, option)
|
||||
},
|
||||
|
||||
library_stats () {
|
||||
return axios.get('/api/library')
|
||||
return axios.get('./api/library')
|
||||
},
|
||||
|
||||
library_update () {
|
||||
return axios.put('/api/update')
|
||||
return axios.put('./api/update')
|
||||
},
|
||||
|
||||
library_rescan () {
|
||||
return axios.put('/api/rescan')
|
||||
return axios.put('./api/rescan')
|
||||
},
|
||||
|
||||
library_count (expression) {
|
||||
return axios.get('/api/library/count?expression=' + expression)
|
||||
return axios.get('./api/library/count?expression=' + expression)
|
||||
},
|
||||
|
||||
queue () {
|
||||
return axios.get('/api/queue')
|
||||
return axios.get('./api/queue')
|
||||
},
|
||||
|
||||
queue_clear () {
|
||||
return axios.put('/api/queue/clear')
|
||||
return axios.put('./api/queue/clear')
|
||||
},
|
||||
|
||||
queue_remove (itemId) {
|
||||
return axios.delete('/api/queue/items/' + itemId)
|
||||
return axios.delete('./api/queue/items/' + itemId)
|
||||
},
|
||||
|
||||
queue_move (itemId, newPosition) {
|
||||
return axios.put('/api/queue/items/' + itemId + '?new_position=' + newPosition)
|
||||
return axios.put('./api/queue/items/' + itemId + '?new_position=' + newPosition)
|
||||
},
|
||||
|
||||
queue_add (uri) {
|
||||
return axios.post('/api/queue/items/add?uris=' + uri).then((response) => {
|
||||
return axios.post('./api/queue/items/add?uris=' + uri).then((response) => {
|
||||
store.dispatch('add_notification', { text: response.data.count + ' tracks appended to queue', type: 'info', timeout: 2000 })
|
||||
return Promise.resolve(response)
|
||||
})
|
||||
@@ -67,7 +67,7 @@ export default {
|
||||
if (store.getters.now_playing && store.getters.now_playing.id) {
|
||||
position = store.getters.now_playing.position + 1
|
||||
}
|
||||
return axios.post('/api/queue/items/add?uris=' + uri + '&position=' + position).then((response) => {
|
||||
return axios.post('./api/queue/items/add?uris=' + uri + '&position=' + position).then((response) => {
|
||||
store.dispatch('add_notification', { text: response.data.count + ' tracks appended to queue', type: 'info', timeout: 2000 })
|
||||
return Promise.resolve(response)
|
||||
})
|
||||
@@ -77,7 +77,7 @@ export default {
|
||||
var options = {}
|
||||
options.expression = expression
|
||||
|
||||
return axios.post('/api/queue/items/add', undefined, { params: options }).then((response) => {
|
||||
return axios.post('./api/queue/items/add', undefined, { params: options }).then((response) => {
|
||||
store.dispatch('add_notification', { text: response.data.count + ' tracks appended to queue', type: 'info', timeout: 2000 })
|
||||
return Promise.resolve(response)
|
||||
})
|
||||
@@ -91,21 +91,21 @@ export default {
|
||||
options.position = store.getters.now_playing.position + 1
|
||||
}
|
||||
|
||||
return axios.post('/api/queue/items/add', undefined, { params: options }).then((response) => {
|
||||
return axios.post('./api/queue/items/add', undefined, { params: options }).then((response) => {
|
||||
store.dispatch('add_notification', { text: response.data.count + ' tracks appended to queue', type: 'info', timeout: 2000 })
|
||||
return Promise.resolve(response)
|
||||
})
|
||||
},
|
||||
|
||||
queue_save_playlist (name) {
|
||||
return axios.post('/api/queue/save', undefined, { params: { name: name } }).then((response) => {
|
||||
return axios.post('./api/queue/save', undefined, { params: { name: name } }).then((response) => {
|
||||
store.dispatch('add_notification', { text: 'Queue saved to playlist "' + name + '"', type: 'info', timeout: 2000 })
|
||||
return Promise.resolve(response)
|
||||
})
|
||||
},
|
||||
|
||||
player_status () {
|
||||
return axios.get('/api/player')
|
||||
return axios.get('./api/player')
|
||||
},
|
||||
|
||||
player_play_uri (uris, shuffle, position = undefined) {
|
||||
@@ -116,7 +116,7 @@ export default {
|
||||
options.playback = 'start'
|
||||
options.playback_from_position = position
|
||||
|
||||
return axios.post('/api/queue/items/add', undefined, { params: options })
|
||||
return axios.post('./api/queue/items/add', undefined, { params: options })
|
||||
},
|
||||
|
||||
player_play_expression (expression, shuffle, position = undefined) {
|
||||
@@ -127,111 +127,111 @@ export default {
|
||||
options.playback = 'start'
|
||||
options.playback_from_position = position
|
||||
|
||||
return axios.post('/api/queue/items/add', undefined, { params: options })
|
||||
return axios.post('./api/queue/items/add', undefined, { params: options })
|
||||
},
|
||||
|
||||
player_play (options = {}) {
|
||||
return axios.put('/api/player/play', undefined, { params: options })
|
||||
return axios.put('./api/player/play', undefined, { params: options })
|
||||
},
|
||||
|
||||
player_playpos (position) {
|
||||
return axios.put('/api/player/play?position=' + position)
|
||||
return axios.put('./api/player/play?position=' + position)
|
||||
},
|
||||
|
||||
player_playid (itemId) {
|
||||
return axios.put('/api/player/play?item_id=' + itemId)
|
||||
return axios.put('./api/player/play?item_id=' + itemId)
|
||||
},
|
||||
|
||||
player_pause () {
|
||||
return axios.put('/api/player/pause')
|
||||
return axios.put('./api/player/pause')
|
||||
},
|
||||
|
||||
player_stop () {
|
||||
return axios.put('/api/player/stop')
|
||||
return axios.put('./api/player/stop')
|
||||
},
|
||||
|
||||
player_next () {
|
||||
return axios.put('/api/player/next')
|
||||
return axios.put('./api/player/next')
|
||||
},
|
||||
|
||||
player_previous () {
|
||||
return axios.put('/api/player/previous')
|
||||
return axios.put('./api/player/previous')
|
||||
},
|
||||
|
||||
player_shuffle (newState) {
|
||||
var shuffle = newState ? 'true' : 'false'
|
||||
return axios.put('/api/player/shuffle?state=' + shuffle)
|
||||
return axios.put('./api/player/shuffle?state=' + shuffle)
|
||||
},
|
||||
|
||||
player_consume (newState) {
|
||||
var consume = newState ? 'true' : 'false'
|
||||
return axios.put('/api/player/consume?state=' + consume)
|
||||
return axios.put('./api/player/consume?state=' + consume)
|
||||
},
|
||||
|
||||
player_repeat (newRepeatMode) {
|
||||
return axios.put('/api/player/repeat?state=' + newRepeatMode)
|
||||
return axios.put('./api/player/repeat?state=' + newRepeatMode)
|
||||
},
|
||||
|
||||
player_volume (volume) {
|
||||
return axios.put('/api/player/volume?volume=' + volume)
|
||||
return axios.put('./api/player/volume?volume=' + volume)
|
||||
},
|
||||
|
||||
player_output_volume (outputId, outputVolume) {
|
||||
return axios.put('/api/player/volume?volume=' + outputVolume + '&output_id=' + outputId)
|
||||
return axios.put('./api/player/volume?volume=' + outputVolume + '&output_id=' + outputId)
|
||||
},
|
||||
|
||||
player_seek_to_pos (newPosition) {
|
||||
return axios.put('/api/player/seek?position_ms=' + newPosition)
|
||||
return axios.put('./api/player/seek?position_ms=' + newPosition)
|
||||
},
|
||||
|
||||
player_seek (seekMs) {
|
||||
return axios.put('/api/player/seek?seek_ms=' + seekMs)
|
||||
return axios.put('./api/player/seek?seek_ms=' + seekMs)
|
||||
},
|
||||
|
||||
outputs () {
|
||||
return axios.get('/api/outputs')
|
||||
return axios.get('./api/outputs')
|
||||
},
|
||||
|
||||
output_update (outputId, output) {
|
||||
return axios.put('/api/outputs/' + outputId, output)
|
||||
return axios.put('./api/outputs/' + outputId, output)
|
||||
},
|
||||
|
||||
output_toggle (outputId) {
|
||||
return axios.put('/api/outputs/' + outputId + '/toggle')
|
||||
return axios.put('./api/outputs/' + outputId + '/toggle')
|
||||
},
|
||||
|
||||
library_artists (media_kind = undefined) {
|
||||
return axios.get('/api/library/artists', { params: { media_kind: media_kind } })
|
||||
return axios.get('./api/library/artists', { params: { media_kind: media_kind } })
|
||||
},
|
||||
|
||||
library_artist (artistId) {
|
||||
return axios.get('/api/library/artists/' + artistId)
|
||||
return axios.get('./api/library/artists/' + artistId)
|
||||
},
|
||||
|
||||
library_artist_albums (artistId) {
|
||||
return axios.get('/api/library/artists/' + artistId + '/albums')
|
||||
return axios.get('./api/library/artists/' + artistId + '/albums')
|
||||
},
|
||||
|
||||
library_albums (media_kind = undefined) {
|
||||
return axios.get('/api/library/albums', { params: { media_kind: media_kind } })
|
||||
return axios.get('./api/library/albums', { params: { media_kind: media_kind } })
|
||||
},
|
||||
|
||||
library_album (albumId) {
|
||||
return axios.get('/api/library/albums/' + albumId)
|
||||
return axios.get('./api/library/albums/' + albumId)
|
||||
},
|
||||
|
||||
library_album_tracks (albumId, filter = { limit: -1, offset: 0 }) {
|
||||
return axios.get('/api/library/albums/' + albumId + '/tracks', {
|
||||
return axios.get('./api/library/albums/' + albumId + '/tracks', {
|
||||
params: filter
|
||||
})
|
||||
},
|
||||
|
||||
library_album_track_update (albumId, attributes) {
|
||||
return axios.put('/api/library/albums/' + albumId + '/tracks', undefined, { params: attributes })
|
||||
return axios.put('./api/library/albums/' + albumId + '/tracks', undefined, { params: attributes })
|
||||
},
|
||||
|
||||
library_genres () {
|
||||
return axios.get('/api/library/genres')
|
||||
return axios.get('./api/library/genres')
|
||||
},
|
||||
|
||||
library_genre (genre) {
|
||||
@@ -240,7 +240,7 @@ export default {
|
||||
media_kind: 'music',
|
||||
expression: 'genre is "' + genre + '"'
|
||||
}
|
||||
return axios.get('/api/search', {
|
||||
return axios.get('./api/search', {
|
||||
params: genreParams
|
||||
})
|
||||
},
|
||||
@@ -251,7 +251,7 @@ export default {
|
||||
media_kind: 'music',
|
||||
expression: 'genre is "' + genre + '"'
|
||||
}
|
||||
return axios.get('/api/search', {
|
||||
return axios.get('./api/search', {
|
||||
params: genreParams
|
||||
})
|
||||
},
|
||||
@@ -262,7 +262,7 @@ export default {
|
||||
media_kind: 'music',
|
||||
expression: 'data_kind is url and song_length = 0'
|
||||
}
|
||||
return axios.get('/api/search', {
|
||||
return axios.get('./api/search', {
|
||||
params: params
|
||||
})
|
||||
},
|
||||
@@ -273,7 +273,7 @@ export default {
|
||||
type: 'tracks',
|
||||
expression: 'songartistid is "' + artist + '"'
|
||||
}
|
||||
return axios.get('/api/search', {
|
||||
return axios.get('./api/search', {
|
||||
params: artistParams
|
||||
})
|
||||
}
|
||||
@@ -284,7 +284,7 @@ export default {
|
||||
type: 'tracks',
|
||||
expression: 'media_kind is podcast and play_count = 0 ORDER BY time_added DESC'
|
||||
}
|
||||
return axios.get('/api/search', {
|
||||
return axios.get('./api/search', {
|
||||
params: episodesParams
|
||||
})
|
||||
},
|
||||
@@ -294,86 +294,86 @@ export default {
|
||||
type: 'tracks',
|
||||
expression: 'media_kind is podcast and songalbumid is "' + albumId + '" ORDER BY date_released DESC'
|
||||
}
|
||||
return axios.get('/api/search', {
|
||||
return axios.get('./api/search', {
|
||||
params: episodesParams
|
||||
})
|
||||
},
|
||||
|
||||
library_add (url) {
|
||||
return axios.post('/api/library/add', undefined, { params: { url: url } })
|
||||
return axios.post('./api/library/add', undefined, { params: { url: url } })
|
||||
},
|
||||
|
||||
library_playlist_delete (playlistId) {
|
||||
return axios.delete('/api/library/playlists/' + playlistId, undefined)
|
||||
return axios.delete('./api/library/playlists/' + playlistId, undefined)
|
||||
},
|
||||
|
||||
library_playlists () {
|
||||
return axios.get('/api/library/playlists')
|
||||
return axios.get('./api/library/playlists')
|
||||
},
|
||||
|
||||
library_playlist_folder (playlistId = 0) {
|
||||
return axios.get('/api/library/playlists/' + playlistId + '/playlists')
|
||||
return axios.get('./api/library/playlists/' + playlistId + '/playlists')
|
||||
},
|
||||
|
||||
library_playlist (playlistId) {
|
||||
return axios.get('/api/library/playlists/' + playlistId)
|
||||
return axios.get('./api/library/playlists/' + playlistId)
|
||||
},
|
||||
|
||||
library_playlist_tracks (playlistId) {
|
||||
return axios.get('/api/library/playlists/' + playlistId + '/tracks')
|
||||
return axios.get('./api/library/playlists/' + playlistId + '/tracks')
|
||||
},
|
||||
|
||||
library_track (trackId) {
|
||||
return axios.get('/api/library/tracks/' + trackId)
|
||||
return axios.get('./api/library/tracks/' + trackId)
|
||||
},
|
||||
|
||||
library_track_playlists (trackId) {
|
||||
return axios.get('/api/library/tracks/' + trackId + '/playlists')
|
||||
return axios.get('./api/library/tracks/' + trackId + '/playlists')
|
||||
},
|
||||
|
||||
library_track_update (trackId, attributes = {}) {
|
||||
return axios.put('/api/library/tracks/' + trackId, undefined, { params: attributes })
|
||||
return axios.put('./api/library/tracks/' + trackId, undefined, { params: attributes })
|
||||
},
|
||||
|
||||
library_files (directory = undefined) {
|
||||
var filesParams = { directory: directory }
|
||||
return axios.get('/api/library/files', {
|
||||
return axios.get('./api/library/files', {
|
||||
params: filesParams
|
||||
})
|
||||
},
|
||||
|
||||
search (searchParams) {
|
||||
return axios.get('/api/search', {
|
||||
return axios.get('./api/search', {
|
||||
params: searchParams
|
||||
})
|
||||
},
|
||||
|
||||
spotify () {
|
||||
return axios.get('/api/spotify')
|
||||
return axios.get('./api/spotify')
|
||||
},
|
||||
|
||||
spotify_login (credentials) {
|
||||
return axios.post('/api/spotify-login', credentials)
|
||||
return axios.post('./api/spotify-login', credentials)
|
||||
},
|
||||
|
||||
lastfm () {
|
||||
return axios.get('/api/lastfm')
|
||||
return axios.get('./api/lastfm')
|
||||
},
|
||||
|
||||
lastfm_login (credentials) {
|
||||
return axios.post('/api/lastfm-login', credentials)
|
||||
return axios.post('./api/lastfm-login', credentials)
|
||||
},
|
||||
|
||||
lastfm_logout (credentials) {
|
||||
return axios.get('/api/lastfm-logout')
|
||||
return axios.get('./api/lastfm-logout')
|
||||
},
|
||||
|
||||
pairing () {
|
||||
return axios.get('/api/pairing')
|
||||
return axios.get('./api/pairing')
|
||||
},
|
||||
|
||||
pairing_kickoff (pairingReq) {
|
||||
return axios.post('/api/pairing', pairingReq)
|
||||
return axios.post('./api/pairing', pairingReq)
|
||||
},
|
||||
|
||||
artwork_url_append_size_params (artworkUrl, maxwidth = 600, maxheight = 600) {
|
||||
|
||||
@@ -10,6 +10,9 @@ module.exports = {
|
||||
|
||||
assetsDir: 'player',
|
||||
|
||||
// Relative public path
|
||||
publicPath: './',
|
||||
|
||||
// Do not add hashes to the generated js/css filenames, would otherwise
|
||||
// require to adjust the Makefile in htdocs each time the web interface is
|
||||
// build
|
||||
|
||||
Reference in New Issue
Block a user