Skip to content

Commit

Permalink
Merge pull request #1558 from rern/UPDATE
Browse files Browse the repository at this point in the history
Update
  • Loading branch information
rern authored Jan 8, 2024
2 parents 9f33b52 + 0d5bb4e commit 75d3b27
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 74 deletions.
3 changes: 2 additions & 1 deletion install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ alias=r1

. /srv/http/bash/settings/addons.sh

# 20240107
# 20240108
if [[ -e /usr/bin/camilladsp ]]; then
rm -f $dirsystem/camilla.conf
mkdir -p $dircamilladsp/raw
if [[ $( camilladsp -V ) != 'CamillaDSP 2.0.0' ]]; then
systemctl stop camilladsp
rm -f /etc/default/camilladsp /usr/lib/systemd/system/camilladsp.service
pacman -Sy --needed --noconfirm camilladsp
readarray -t files <<< $( grep -rl enable_resampling $dircamilladsp )
for f in "${files[@]}"; do
Expand Down
3 changes: 2 additions & 1 deletion srv/http/assets/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ a {
min-width: 100px;
height: 100px;
}
.infobookmark .i-bookmark {
.infobookmark .i-bookmark,
#infoList .i-bookmark {
width: 100px !important;
font-size: 48px !important;
line-height: 72px;
Expand Down
42 changes: 24 additions & 18 deletions srv/http/assets/js/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ function info( json ) {
htmls.list += htmls.list.slice( -3 ) === 'tr>' ? td0 : '<td>';
break;
case 'hidden':
htmls.list += '<tr class="hide"><td>'+ label +'</td><td>';
htmls.list += '<tr class="hide"><td></td><td>';
break;
case 'radio':
htmls.list += '<tr><td>'+ label +'</td><td colspan="2">';
Expand All @@ -459,7 +459,8 @@ function info( json ) {
htmls.list += '<tr><td>';
break;
default:
htmls.list += '<tr><td>'+ label +'</td><td>';
htmls.list += htmls.list.slice( -3 ) === 'td>' ? '' : '<tr><td>'+ label +'</td>';
htmls.list += l[ 4 ] ? '<td colspan="'+ l[ 4 ] +'">' : '<td>';
}
switch ( type ) {
case 'checkbox':
Expand All @@ -471,33 +472,33 @@ function info( json ) {
case 'text':
var unit = typeof l[ 2 ] === 'object' ? false : l[ 2 ];
var updn = unit ? false : l[ 2 ];
htmls.list += '<input type="'+ type +'"'+ ( updn ? ' disabled' : '' ) +'></td>';
htmls.list += '<input type="'+ type +'"'+ ( updn ? ' disabled' : '' ) +'>';
if ( unit ) {
htmls.list += '<td>&nbsp;<gr>'+ unit +'</gr></td>';
htmls.list += l[ 3 ] === 'td' ? '' : '<td>&nbsp;<gr>'+ unit +'</gr>';
} else if ( updn ) {
I.updn.push( updn );
htmls.list += '<td>'+ ico( 'remove updn dn' ) + ico( 'plus-circle updn up' ) +'</td>';
htmls.list += '<td>'+ ico( 'remove updn dn' ) + ico( 'plus-circle updn up' );
}
htmls.list += '</tr>';
htmls.list += l[ 3 ] === 'td' ? '</td>' : '</tr>';
break;
case 'password':
htmls.list += '<input type="password"></td><td>'+ ico( 'eye' ) +'</td></tr>';
break;
case 'radio':
var isarray = $.isArray( l[ 2 ] );
var br = false;
var tr = false;
$.each( l[ 2 ], ( k, v ) => {
var k = isarray ? v : k;
if ( br ) htmls.list += '<tr><td></td><td colspan="2">';
if ( tr ) htmls.list += '<tr><td></td><td colspan="2">';
htmls.list += '<label><input type="radio" name="inforadio'+ i +'" value="'+ v +'">'+ k +'</label>';
if ( l[ 3 ] === 'br' ) {
br = true;
if ( l[ 3 ] === 'tr' ) {
tr = true;
htmls.list += '</td></tr>'; // 1:1 line
} else {
htmls.list += '&emsp;'; // same line
}
} );
htmls.list += br ? '' : '</td></tr>';
htmls.list += tr ? '' : '</td></tr>';
i++;
break;
case 'range':
Expand All @@ -509,14 +510,19 @@ function info( json ) {
+'</div></td></tr>';
break
case 'select':
htmls.list += '<select>'+ htmlOption( l[ 2 ] ) +'</select></td>';
htmls.list += l[ 3 ] ? '<td>&nbsp;<gr>'+ l[ 3 ] +'</gr></td</tr>' : '</tr>'; // unit
htmls.list += '<select>'+ htmlOption( l[ 2 ] ) +'</select>';
if ( l[ 3 ] ) {
htmls.list += l[ 3 ] === 'td' ? '</td>' : '<td>&nbsp;<gr>'+ l[ 3 ] +'</gr></td></tr>'; // unit
} else {
htmls.list += '</tr>';
}
break;
case 'textarea':
htmls.list += '<textarea></textarea></td></tr>';
break;
default: // generic string
htmls.list += l[ 2 ] +'</td></tr>'
htmls.list += l[ 2 ];
htmls.list += l[ 3 ] === 'td' ? '</td>' : '</td></tr>';
}
} );
if ( type !== 'range' ) htmls.list = '<table>'+ htmls.list +'</table>';
Expand Down Expand Up @@ -602,9 +608,9 @@ function info( json ) {
}
if ( I.updn.length ) {
I.updn.forEach( ( el, i ) => {
var $tr = $( '#infoList .updn' ).parent().eq( i ).parent()
var $updn = $tr.find( '.updn' );
var $num = $updn.parent().prev().find( 'input' );
var $td = $( '#infoList .updn' ).parent().eq( i );
var $updn = $td.find( '.updn' );
var $num = $td.prev().find( 'input' );
var step = el.step;
var v = 0;
var interval, timeout;
Expand All @@ -623,7 +629,7 @@ function info( json ) {
$updn.eq( 0 ).toggleClass( 'disabled', v === el.min );
$updn.eq( 1 ).toggleClass( 'disabled', v === el.max );
}
updnToggle( I.values[ $tr.index() ] );
updnToggle( +$num.val() );
$updn.on( 'click', function() {
if ( ! V.press ) numberset( $( this ).hasClass( 'up' ) );
} ).press( function( e ) {
Expand Down
7 changes: 3 additions & 4 deletions srv/http/assets/js/context.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,9 +287,9 @@ function tagEditor() {
}
list( query, function( values ) {
name[ 1 ] = 'Album Artist';
var label = [];
var list = [];
format.forEach( ( el, i ) => {
label.push( [ '<span class="taglabel gr hide">'+ name[ i ] +'</span> <i class="i-'+ el +' wh" data-mode="'+ el +'"></i>', 'text' ] );
list.push( [ '<span class="taglabel gr hide">'+ name[ i ] +'</span> <i class="i-'+ el +' wh" data-mode="'+ el +'"></i>', 'text' ] );
} );
if ( V.library ) {
var $img = V.librarytrack ? $( '.licoverimg img' ) : V.list.li.find( 'img' );
Expand All @@ -308,10 +308,9 @@ function tagEditor() {
info( {
icon : V.playlist ? 'info' : 'tag'
, title : V.playlist ? 'Track Info' : 'Tag Editor'
, width : 500
, message : message
, messagealign : 'left'
, list : label
, list : list
, footer : footer
, footeralign : 'left'
, boxwidth : 'max'
Expand Down
4 changes: 2 additions & 2 deletions srv/http/assets/js/function.js
Original file line number Diff line number Diff line change
Expand Up @@ -786,7 +786,7 @@ function infoUpdate( path ) {
icon : 'refresh-library'
, title : 'Library Database'
, message : path ? ico( 'folder' ) +' <wh>'+ path +'</wh>' : ''
, list : path ? '' : [ '', 'radio', { 'Only changed files' : '', 'Rebuild entire database': 'rescan' }, 'br' ]
, list : path ? '' : [ '', 'radio', { 'Only changed files' : '', 'Rebuild entire database': 'rescan' }, 'tr' ]
, beforeshow : () => {
if ( ! C ) {
$( '#infoList input' ).eq( 0 ).prop( 'disabled', true );
Expand Down Expand Up @@ -1017,7 +1017,7 @@ function playlistInsertTarget() {
+'<br>'+ V.pladd.album
+'<hr>'
+'Select where to add:'
, list : [ '', 'radio', { First : 1, Select: 'select', Last: 'last' }, 'br' ]
, list : [ '', 'radio', { First : 1, Select: 'select', Last: 'last' }, 'tr' ]
, values : 'last'
, beforeshow : () => {
$( '#infoList input' ).eq( 1 ).on( 'click', function() {
Expand Down
4 changes: 2 additions & 2 deletions srv/http/assets/js/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ $( '#settings' ).on( 'click', '.submenu', function() {
info( {
icon : 'multiraudio'
, title : 'Switch rAudio'
, list : [ '', 'radio', data.list, 'br' ]
, list : [ '', 'radio', data.list, 'tr' ]
, values : currentip
, beforeshow : () => {
$( '#infoList input' ).each( ( i, el ) => {
Expand Down Expand Up @@ -1314,7 +1314,7 @@ $( '#lib-mode-list' ).on( 'click', function( e ) {
if ( $img.length ) {
var icon = '<img src="'+ $img.attr( 'src' ) +'">'
} else {
var icon = ico( 'bookmark bookmark bl' )
var icon = ico( 'bookmark bl' )
+'<br><a class="bklabel">'+ name +'</a>'
}
info( {
Expand Down
2 changes: 1 addition & 1 deletion srv/http/assets/js/player.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ $( '#setting-replaygain' ).on( 'click', function() {
info( {
icon : SW.icon
, title : SW.title
, list : [ '', 'radio', { Auto: 'auto', Album: 'album', Track: 'track' }, 'br' ]
, list : [ '', 'radio', { Auto: 'auto', Album: 'album', Track: 'track' }, 'tr' ]
, footer : hardware ? '<label><input type="checkbox"><wh>Gain control by Mixer device</wh></label>' : ''
, values : S.replaygainconf
, checkchanged : S.replaygain
Expand Down
73 changes: 29 additions & 44 deletions srv/http/assets/js/system.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ $( '#setting-hddsleep' ).on( 'click', function() {
icon : SW.icon
, title : SW.title
, message : 'Timer:'
, list : [ '', 'radio', { '2 minutes': 24, '5 minutes': 60, '10 minutes': 120 }, 'br' ]
, list : [ '', 'radio', { '2 minutes': 24, '5 minutes': 60, '10 minutes': 120 }, 'tr' ]
, values : { APM: S.hddsleep } || default_v.hddsleep
, checkchanged : S.hddsleep
, cancel : switchCancel
Expand Down Expand Up @@ -952,55 +952,36 @@ function infoPowerbuttonAudiophonics() {
} );
}
function infoRelays() {
var values = S.relaysconf || default_v.relays;
var name = S.relaysnameconf || default_v.relaysname;
var pL = 0;
var option_name = '';
$.each( name, ( k, v ) => {
if ( v ) {
option_name += '<option value="'+ k +'">'+ v +'</option>';
pL++;
}
} );
var option_delay = htmlOption( [ ...Array(10).keys() ] );
var updn = ico( 'remove updn dn' ) + ico( 'plus-circle updn up' );
var td_name = '<td><select>'+ option_name +'</select></td>';
var tr_name = '<tr>'+ td_name + td_name +'</tr>';
var td_delay = '<td><input type="text" disabled>'+ updn +'</td>';
var tr_delay = '<tr>'+ td_delay + td_delay +'</tr>';
var list = '<tr><td>'+ ico( 'power grn' ) +' On <gr>(s)</gr></td><td>'+ ico( 'power red' ) +' Off <gr>(s)</gr></td></tr>';
for ( i = 0; i < pL; i++ ) {
list += tr_name;
if ( i < ( pL -1 ) ) list += tr_delay;
}
list += '<tr><td class="idle">'+ ico( 'stoptimer yl' ) +' Idle to Off <gr>(m)</gr></td><td><input type="text" disabled>'+ updn +'</td></tr>';
var values = S.relaysconf || default_v.relays;
var name = S.relaysnameconf || default_v.relaysname;
var names = {};
$.each( name, ( k, v ) => names[ v ] = k );
var step = { step: 1, min: 0, max: 10 }
var list = [
[ '', '', ico( 'power grn' ) +' On <gr>(s)</gr>', 'td', 2 ]
, [ '', '', ico( 'power red' ) +' Off <gr>(s)</gr>', '', 2 ]
];
for ( i = 0; i < 4; i++ ) list.push(
[ '', 'select', names, 'td', 2 ]
, [ '', 'select', names, '', 2 ]
, [ '', 'number', step, 'td' ]
, [ '', 'number', step ]
);
list[ 16 ] = [ '', '', ico( 'stoptimer yl' ) +' Idle to Off <gr>(m)</gr>', 'td', 2 ];
info( {
icon : SW.icon
, title : SW.title
, tablabel : [ 'Sequence', 'Name' ]
, tab : [ '', infoRelaysName ]
, list : '<table>'+ list +'</table>'
, list : list
, lableno : true
, values : values
, checkchanged : S.relays
, beforeshow : () => {
$( '#infoList td' ).css( 'text-align', 'left' );
$( '#infoList tr:last-child td:nth-child( 2 )' ).css( 'text-align', 'right' );
$( '#infoList .select2-container' ).attr( 'style', 'width: 180px !important' );
$( '#infoList input' ).css( 'width', '70px' );
$( '#infoList .idle' ).css( 'text-align', 'right' );
var min = 0;
var max = 10;
$( '#infoList .updn' ).on( 'touchend mouseup keyup', function() {
var $this = $( this );
var up = $this.hasClass( 'up' );
var $up = up ? $this : $this.next();
var $dn = up ? $this.prev() : $this;
var $num = $this.parent().prev().find( 'input' );
var val = +$num.val();
up ? val++ : val--;
$num.val( val );
$up.toggleClass( 'disabled', val === max );
$dn.toggleClass( 'disabled', val === min );
} );
$( '#infoList input' ).parent().css( 'width', '70px' );
}
, cancel : switchCancel
, ok : infoRelaysCmd
Expand Down Expand Up @@ -1044,15 +1025,19 @@ function infoRelaysName() {
var name = S.relaysnameconf || default_v.relaysname;
var values = [];
$.each( name, ( k, v ) => values.push( k, v ) );
var pin_name = '<tr><td><select>'+ htmlOption( Object.keys( board2bcm ) ) +'</select></td><td colspan="2"><input type="text"></td></tr>';
var list = '<tr><td>'+ ico( 'gpiopins bl' ) +' Pin</td><td>'+ ico( 'tag bl' ) +' Name</td></tr>';
for( i = 0; i < 4; i++ ) list += pin_name;
var list = [
[ '', '', ico( 'gpiopins bl' ) +' Pin', 'td' ]
, [ '', '', ico( 'tag bl' ) +' Name' ]
]
var pins = Object.keys( board2bcm )
for ( i = 0; i < 4; i++ ) list.push( [ '', 'select', pins, 'td' ], [ '', 'text', '' ] );
info( {
icon : SW.icon
, title : SW.title
, tablabel : [ 'Sequence', 'Name' ]
, tab : [ infoRelays, '' ]
, list : gpiosvg + '<br>&nbsp;<table>'+ list +'</table><br>'
, message : gpiosvg
, list : list
, values : values
, checkchanged : S.relays
, beforeshow : () => {
Expand Down
2 changes: 1 addition & 1 deletion srv/http/bash/cmd.sh
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ bookmarkadd )
bkfile="$dirbookmarks/${NAME//\//|}"
[[ -e $bkfile ]] && echo -1 && exit

echo $DIR > "$bkfile"
echo "$DIR" > "$bkfile"
if [[ -e $dirsystem/order.json ]]; then
order=$( jq '. + ["'$DIR'"]' $dirsystem/order.json )
echo "$order" > $dirsystem/order.json
Expand Down

0 comments on commit 75d3b27

Please sign in to comment.