code quality
This commit is contained in:
		@ -21,4 +21,3 @@ export default AdminApp;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
window.App = AdminApp
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -17,5 +17,3 @@ export const PlayerApp = {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
export default App
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -37,7 +37,7 @@ export default class Builder {
 | 
			
		||||
    mount({content=null, title=null, el=null, reset=false, props=null}={}) {
 | 
			
		||||
        try {
 | 
			
		||||
            this.unmount()
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            let config = this.config
 | 
			
		||||
            if(el === null)
 | 
			
		||||
                el = config.el
 | 
			
		||||
@ -132,6 +132,3 @@ export default class Builder {
 | 
			
		||||
        return this.mount({ content: state.content, title: state.title })
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -28,4 +28,3 @@
 | 
			
		||||
        height: 35px;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -232,7 +232,7 @@ a.navbar-item.is-active {
 | 
			
		||||
        > div {
 | 
			
		||||
            height: 3.75em !important;
 | 
			
		||||
        }
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        > .media-left:not(:last-child) {
 | 
			
		||||
            margin-right: 0em;
 | 
			
		||||
        }
 | 
			
		||||
@ -325,4 +325,3 @@ aside {
 | 
			
		||||
    width: 100%;
 | 
			
		||||
    border: none;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -110,7 +110,7 @@ export default {
 | 
			
		||||
            index = Math.min(index, this.items.length-1)
 | 
			
		||||
            return this.items[index]
 | 
			
		||||
        },
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        selectedValue() {
 | 
			
		||||
            let value = this.itemValue(this.selected)
 | 
			
		||||
            if(!value && !this.mustExist)
 | 
			
		||||
@ -144,19 +144,19 @@ export default {
 | 
			
		||||
            this.cursor = -1;
 | 
			
		||||
            this.selectedIndex = -1;
 | 
			
		||||
        },
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        move(index=-1, relative=false) {
 | 
			
		||||
            if(relative)
 | 
			
		||||
                index += this.cursor
 | 
			
		||||
            this.cursor = Math.max(-1, Math.min(index, this.items.length-1))
 | 
			
		||||
        },
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
        select(index=-1, relative=false, active=null) {
 | 
			
		||||
            if(relative)
 | 
			
		||||
                index += this.selectedIndex
 | 
			
		||||
            else if(index == this.selectedIndex)
 | 
			
		||||
                return
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
            this.selectedIndex = Math.max(-1, Math.min(index, this.items.length-1))
 | 
			
		||||
            if(index >= 0) {
 | 
			
		||||
                this.inputValue = this.selectedLabel
 | 
			
		||||
@ -245,4 +245,3 @@ export default {
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -19,5 +19,3 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -16,5 +16,3 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,7 @@
 | 
			
		||||
            <APlaylist ref="pin" class="player-panel menu" v-show="panel == 'pin' && sets.pin.length"
 | 
			
		||||
                name="Pinned"
 | 
			
		||||
                :actions="['page']"
 | 
			
		||||
                :editable="true" :player="self" :set="sets.pin" @select="togglePlay('pin', $event.index)" 
 | 
			
		||||
                :editable="true" :player="self" :set="sets.pin" @select="togglePlay('pin', $event.index)"
 | 
			
		||||
                listClass="menu-list" itemClass="menu-item">
 | 
			
		||||
                <template v-slot:header="">
 | 
			
		||||
                    <p class="menu-label">
 | 
			
		||||
@ -15,7 +15,7 @@
 | 
			
		||||
            </APlaylist>
 | 
			
		||||
            <APlaylist ref="queue" class="player-panel menu" v-show="panel == 'queue' && sets.queue.length"
 | 
			
		||||
                :actions="['page']"
 | 
			
		||||
                :editable="true" :player="self" :set="sets.queue" @select="togglePlay('queue', $event.index)" 
 | 
			
		||||
                :editable="true" :player="self" :set="sets.queue" @select="togglePlay('queue', $event.index)"
 | 
			
		||||
                listClass="menu-list" itemClass="menu-item">
 | 
			
		||||
                <template v-slot:header="">
 | 
			
		||||
                    <p class="menu-label">
 | 
			
		||||
@ -283,5 +283,3 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -164,7 +164,7 @@ export default {
 | 
			
		||||
                          .findIndex(k => !isEqual(this.settings[k], this.savedSettings[k]))
 | 
			
		||||
            return k != -1
 | 
			
		||||
        },
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        separator: {
 | 
			
		||||
            set(value) {
 | 
			
		||||
                this.settings.playlist_editor_sep = value
 | 
			
		||||
@ -185,7 +185,7 @@ export default {
 | 
			
		||||
                return this.settings.playlist_editor_columns
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        items() {
 | 
			
		||||
            return this.set.items
 | 
			
		||||
        },
 | 
			
		||||
@ -204,7 +204,7 @@ export default {
 | 
			
		||||
                               break;
 | 
			
		||||
            }
 | 
			
		||||
        },
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        formatMove({from, to}) {
 | 
			
		||||
            const value = this.columns[from]
 | 
			
		||||
            this.settings.playlist_editor_columns.splice(from, 1)
 | 
			
		||||
@ -226,7 +226,7 @@ export default {
 | 
			
		||||
            set.move(from, to);
 | 
			
		||||
            this.updateInput()
 | 
			
		||||
        },
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
        updateList() {
 | 
			
		||||
            const items = this.toList(this.$refs.textarea.value)
 | 
			
		||||
            this.set.reset(items)
 | 
			
		||||
@ -299,7 +299,7 @@ export default {
 | 
			
		||||
                this.settings = settings
 | 
			
		||||
            this.savedSettings = cloneDeep(this.settings)
 | 
			
		||||
        },
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        /**
 | 
			
		||||
         * Load initial data
 | 
			
		||||
         */
 | 
			
		||||
 | 
			
		||||
@ -64,4 +64,3 @@ export default {
 | 
			
		||||
    },
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -65,7 +65,7 @@ const Component = {
 | 
			
		||||
            for(var row in this.items)
 | 
			
		||||
                cells.push({row})
 | 
			
		||||
        },
 | 
			
		||||
       
 | 
			
		||||
 | 
			
		||||
        rowSlots() {
 | 
			
		||||
            return Object.keys(this.$slots).filter(x => x.startsWith('row-'))
 | 
			
		||||
                                           .map(x => [x, x.slice(4)])
 | 
			
		||||
@ -94,7 +94,7 @@ const Component = {
 | 
			
		||||
         * Return row component at provided index
 | 
			
		||||
         */
 | 
			
		||||
        getRow(row) {
 | 
			
		||||
            const els = this.$el.querySelectorAll('tr')        
 | 
			
		||||
            const els = this.$el.querySelectorAll('tr')
 | 
			
		||||
            for(var el of els)
 | 
			
		||||
                if(el.__row && row == Number(el.dataset.row))
 | 
			
		||||
                    return el.__row
 | 
			
		||||
 | 
			
		||||
@ -38,4 +38,3 @@ export default {
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
</script>
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -15,7 +15,7 @@ export default {
 | 
			
		||||
    props: {
 | 
			
		||||
        apiUrl: String,
 | 
			
		||||
    },
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    data() {
 | 
			
		||||
        return {
 | 
			
		||||
            // current streamer
 | 
			
		||||
 | 
			
		||||
@ -24,4 +24,3 @@ export const admin = {
 | 
			
		||||
    ...base,
 | 
			
		||||
    AStatistics, AStreamer, APlaylistEditor
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -4,5 +4,3 @@ import App from './app.js'
 | 
			
		||||
export default App
 | 
			
		||||
 | 
			
		||||
window.App = App
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -46,7 +46,7 @@ window.aircox = {
 | 
			
		||||
                builder.config = config || window.App
 | 
			
		||||
            if(el)
 | 
			
		||||
                builder.config.el = el
 | 
			
		||||
            
 | 
			
		||||
 | 
			
		||||
            builder.title = document.title
 | 
			
		||||
            builder.mount({props})
 | 
			
		||||
 | 
			
		||||
@ -70,4 +70,3 @@ window.aircox = {
 | 
			
		||||
                item.style.display = null;
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -80,4 +80,3 @@ export default class Live {
 | 
			
		||||
        this.interval !== null && clearInterval(this.interval)
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -151,7 +151,7 @@ export default class Model {
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Return error for a specific attribute name if any 
 | 
			
		||||
     * Return error for a specific attribute name if any
 | 
			
		||||
     */
 | 
			
		||||
    error(attr=null) {
 | 
			
		||||
        return attr === null ? this.errors : this.errors && this.errors[attr]
 | 
			
		||||
@ -283,4 +283,3 @@ export class Set {
 | 
			
		||||
Set[Symbol.iterator] = function () {
 | 
			
		||||
    return this.items[Symbol.iterator]();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -7,5 +7,3 @@ export default class Sound extends Model {
 | 
			
		||||
 | 
			
		||||
    static getId(data) { return data.pk }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -96,5 +96,3 @@ export class Queue extends Source {
 | 
			
		||||
        }, true);
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -13,7 +13,7 @@ export default {
 | 
			
		||||
        ...(AdminApp.props || {}),
 | 
			
		||||
        apiUrl: String,
 | 
			
		||||
    },
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    data() {
 | 
			
		||||
        return {
 | 
			
		||||
            // current streamer
 | 
			
		||||
@ -28,7 +28,7 @@ export default {
 | 
			
		||||
 | 
			
		||||
    computed: {
 | 
			
		||||
        ...(AdminApp.computed || {}),
 | 
			
		||||
        
 | 
			
		||||
 | 
			
		||||
        sources() {
 | 
			
		||||
            var sources = this.streamer ? this.streamer.sources : [];
 | 
			
		||||
            return sources.filter(s => s.data)
 | 
			
		||||
@ -56,5 +56,3 @@ export default {
 | 
			
		||||
            clearInterval(this.fetchInterval)
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -16,7 +16,7 @@ export default {
 | 
			
		||||
    props: {
 | 
			
		||||
        apiUrl: String,
 | 
			
		||||
    },
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    data() {
 | 
			
		||||
        return {
 | 
			
		||||
            // current streamer
 | 
			
		||||
 | 
			
		||||
@ -3,5 +3,3 @@ import Model from './model'
 | 
			
		||||
export default class Track extends Model {
 | 
			
		||||
    static getId(data) { return data.pk }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -15,4 +15,3 @@ export function setEcoInterval(func, ...args) {
 | 
			
		||||
        !document.hidden && func(...args)
 | 
			
		||||
    }, ...args)
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -7,7 +7,7 @@ module.exports = defineConfig({
 | 
			
		||||
    publicPath: './',
 | 
			
		||||
    runtimeCompiler: true,
 | 
			
		||||
    filenameHashing: false,
 | 
			
		||||
    
 | 
			
		||||
 | 
			
		||||
    css: {
 | 
			
		||||
        extract: true,
 | 
			
		||||
        loaderOptions: {
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user