Skip to content

Commit 3c02a77

Browse files
authored
fix: remove toggles from settings page (#27)
* fix: add plugin metrics ua to query * fix: remove toggles from settings page * fix: phpstan action
1 parent 099b190 commit 3c02a77

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

.github/workflows/lint.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ jobs:
2525
- uses: actions/checkout@v4
2626
- uses: php-actions/composer@v6
2727
- uses: php-actions/phpstan@v3
28+
with:
29+
version: composer
2830

2931
commitlint:
3032
name: Commitlint

src/usr/local/emhttp/plugins/tailscale/include/Pages/Settings.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,6 @@ function requestErase(e) {
195195

196196
if ($.cookie('tailscale_view_mode') == 'advanced') {
197197
$('.advanced').show();
198-
$('.basic').hide();
199198
}
200199

201200
$('.advancedview').switchButton({
@@ -205,8 +204,11 @@ function requestErase(e) {
205204
checked: $.cookie('tailscale_view_mode') == 'advanced'
206205
});
207206
$('.advancedview').change(function(){
208-
$('.advanced').toggle('slow');
209-
$('.basic').toggle('slow');
207+
if($('.advancedview').is(':checked')) {
208+
$('.advanced').show('slow');
209+
} else {
210+
$('.advanced').hide('slow');
211+
}
210212
$.cookie('tailscale_view_mode', $('.advancedview').is(':checked') ? 'advanced' : 'basic', {expires:3650});
211213
});
212214
});

src/usr/local/emhttp/plugins/tailscale/include/Tailscale/Utils.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ public static function download_url(string $url): string
147147
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
148148
curl_setopt($ch, CURLOPT_REFERER, "");
149149
curl_setopt($ch, CURLOPT_FAILONERROR, true);
150+
curl_setopt($ch, CURLOPT_USERAGENT, 'plugin-metrics/1.0.0');
150151
$out = curl_exec($ch) ?: false;
151152
curl_close($ch);
152153
return strval($out);

0 commit comments

Comments
 (0)