Skip to content

Commit

Permalink
update resources to match DFPlayer code
Browse files Browse the repository at this point in the history
  • Loading branch information
vortigont committed Feb 2, 2024
1 parent 8cb97cb commit e9e1000
Show file tree
Hide file tree
Showing 6 changed files with 181 additions and 5 deletions.
Binary file modified data/index.html.gz
Binary file not shown.
Binary file modified data/js/ui_lamp.json.gz
Binary file not shown.
7 changes: 4 additions & 3 deletions resources/html/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<title>FireLamp</title>
<link rel="stylesheet" href="css/pure.css">
<link rel="stylesheet" href="css/lamp.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">
<link id="dyncss" rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
Expand Down Expand Up @@ -114,7 +115,7 @@
{{#if2 type == 1}}{{onevent "click", "on_submit", id, value}}{{/if2}}
{{#if2 type == 2}}{{onevent "click", "on_js", id, value}}{{/if2}}
{{#if2 type == 3}} onclick="location.href='{{value}}'" type="button"{{/if2}}
>{{label}}</button>
>{{#if2 fa}}<i class="{{fa}}">{{/if2}}</i>{{/if2}}{{label}}</button>
{{/if}}
{{#if type == "checkbox"}}
<div class="switch-block">
Expand All @@ -123,7 +124,7 @@
</div>
{{/if}}
{{#if html == "const"}}
<div id="{{id}}" class="pure-u-1 pure-button mr">{{label}}{{#if2 value}}<input type="hidden" name="{{id}}" value="{{value}}">{{/if2}}</div>
<div id="{{id}}" class="pure-u-1 pure-button mr">{{#if2 fa}}<i class="{{fa}}">{{/if2}}</i>{{/if2}}{{label}}{{#if2 value}}<input type="hidden" name="{{id}}" value="{{value}}">{{/if2}}</div>
{{/if}}
{{#if html == "comment"}}
<div id="{{id}}" class="comment">{{label}}</div>
Expand Down Expand Up @@ -174,7 +175,7 @@
{{/if}}

{{#if html == "img"}}
<div class = "image"><img id="{{id}}" src = {{value}}></div>
<div class = "image"><img id="{{id}}" src = {{value}}></div>
{{/if}}
{{#if html == "input" && type != "checkbox"}}
<span>{{label}}</span>
Expand Down
149 changes: 148 additions & 1 deletion resources/html/js/ui_lamp.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
"type":"interface",
"version":5,
"version":6,
"descr":"FireLamp UI objects",

"settings":{
"hub75":{
"section":"display_hub75",
Expand Down Expand Up @@ -329,13 +330,15 @@
"id":"display_hub75",
"html":"button",
"type":1,
"fa": "fas fa-circle-check",
"label":"Сохранить"
},
{
"id":"ui_page_settings",
"html":"button",
"color": "green",
"type":0,
"fa": "fas fa-door-open",
"label":"Выход"
}
]
Expand Down Expand Up @@ -515,12 +518,14 @@
"html": "button",
"type": 1,
"color": "green",
"fa": "fas fa-circle-check",
"label": "Сохранить"
},
{
"id": "ui_page_settings",
"html": "button",
"type": 0,
"fa": "fas fa-door-open",
"label": "Выход"
}
]
Expand Down Expand Up @@ -603,12 +608,14 @@
"html": "button",
"type": 1,
"color": "green",
"fa": "fas fa-circle-check",
"label": "Сохранить"
},
{
"id": "ui_page_settings",
"html": "button",
"type": 0,
"fa": "fas fa-door-open",
"label": "Выход"
}
]
Expand Down Expand Up @@ -694,6 +701,7 @@
"html": "button",
"type": 1,
"color": "green",
"fa": "fas fa-circle-check",
"label": "Сохранить"
}
]
Expand All @@ -715,11 +723,150 @@
"id": "ui_page_settings",
"html": "button",
"type": 0,
"fa": "fas fa-door-open",
"label": "Выход"
}
]
},
"dfplayer":{
"section":"set_dfplayer",
"main": true,
"label":"Параметры MP3 DFPlayer",
"block":[
{
"section": "set_dfplayer_device",
"label": "DFPlayer device",
"hidden": true,
"block":[
{
"section": "dfdev01",
"line": true,
"block": [
{
"id":"enabled",
"html":"input",
"label":"Enable DFPlayer",
"type":"checkbox"
},
{
"id":"driver",
"html":"select",
"value":0,
"label":"Chip model",
"section":"options",
"block":[
{
"value":0,
"label":"Generic DFPlayer"
},
{
"value":1,
"label":"No Ack models"
},
{
"value":2,
"label":"No checksum models"
}
]
}
]
},
{
"section": "dfdev02",
"line": true,
"block": [
{
"id": "rx",
"html":"input",
"value": -1,
"type": "number",
"label": "GPIO RX",
"min": -1,
"step": 1
},
{
"id": "timeout",
"html":"input",
"value": 900,
"type": "number",
"label": "Ack timeout, ms",
"min": 100,
"max": 2000,
"step": 50
},
{
"id": "tx",
"html":"input",
"value": -1,
"type": "number",
"label": "GPIO TX",
"min": -1,
"step": 1
}
]
},
{
"id": "set_dfplayer_device",
"html": "button",
"type": 1,
"color": "green",
"fa": "fas fa-circle-check",
"label": "Сохранить"
},
{
"id": "ui_page_settings",
"html": "button",
"type": 0,
"fa": "fas fa-door-open",
"label": "Выход"
}
]
},
{
"section": "set_dfplayer_opt",
"label": "Функции DFPlayer",
"hidden": true,
"block":[
{
"section": "dffunc01",
"line": true,
"block": [
{
"id":"eff_tracks",
"html":"input",
"label":"Effects sounds",
"type":"checkbox"
},
{
"id":"eff_tracks_loop",
"html":"input",
"label":"Loop Effects",
"type":"checkbox"
}
]
},
{
"id": "set_dfplayer_opt",
"html": "button",
"type": 1,
"color": "green",
"fa": "fas fa-circle-check",
"label": "Сохранить"
},
{
"id": "ui_page_settings",
"html": "button",
"type": 0,
"fa": "fas fa-door-open",
"label": "Выход"
}

]
}
]
}
},

"sections":{
"button_event":{
"section":"button_evt_save",
Expand Down
28 changes: 28 additions & 0 deletions resources/localupd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/usr/bin/env bash

compressor="gz"
compress_cmd=""
compress_args=""

updlocalarchive(){
local res=$1
echo "check: $res"
[ ! -f html/${res} ] && return
[ ! -f ../data/${res}.${compressor} ] || [ html/${res} -nt ../data/${res}.${compressor} ] && ${compress_cmd} ${compress_args} -c html/${res} > ../data/${res}.${compressor} && touch -r html/${res} ../data/${res}.${compressor}
}

compress_cmd=`which gzip`
if [ "x$compress_cmd" = "x" ]; then
echo "ERROR: gzip compressor not found!"
exit 1
fi
compress_args="-9"



echo "Update local resources"
lamp_files='index.html js/ui_lamp.json favicon.ico css/wp_dark.svg css/wp_light.svg'
for f in ${lamp_files}
do
updlocalarchive $f
done
2 changes: 1 addition & 1 deletion resources/respack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ if freshtag https://github.com/ajaxorg/ace/raw/master/doc/site/images/favicon.ic
curl -sL https://github.com/ajaxorg/ace/raw/master/doc/site/images/favicon.ico | ${compress_cmd} ${compress_args} > $ace_dst/ace.ico.${compressor}
fi

updlocalarchive extras/edit.htm
#updlocalarchive extras/edit.htm


mv -f newetags.txt $tags
Expand Down

0 comments on commit e9e1000

Please sign in to comment.