From fd959513186f950be9276cc7a9ed3c3bb416c624 Mon Sep 17 00:00:00 2001 From: hashbro Date: Mon, 14 Sep 2026 02:52:35 +0800 Subject: [PATCH] fix: link old --- docs/deploy.md | 16 ++++++- .../views/admin/reports/analytics.blade.php | 43 +------------------ tests/Feature/AnalyticsReportTest.php | 9 ++-- 3 files changed, 23 insertions(+), 45 deletions(-) diff --git a/docs/deploy.md b/docs/deploy.md index 5042c70..053e1d6 100644 --- a/docs/deploy.md +++ b/docs/deploy.md @@ -5,7 +5,20 @@ apt-get update apt-get install -y libgmp-dev apt-get install -y p7zip-full apt-get install -y tesseract-ocr tesseract-ocr-eng tesseract-ocr-chi-sim -apt-get install -y imagemagick +apt-get install -y libheif-examples imagemagick +apt-get install -y libheif1 libheif-dev + +apt-get install -y cmake g++ libde265-dev libx265-dev libjpeg-dev libpng-dev +cd /tmp +curl -L -o libheif.tar.gz https://github.com/strukturag/libheif/releases/download/v1.19.7/libheif-1.19.7.tar.gz +tar xf libheif.tar.gz +cd libheif-1.19.7 +cmake -B build -DCMAKE_INSTALL_PREFIX=/usr/local +cmake --build build -j"$(nproc)" +cmake --install build +ldconfig +/usr/local/bin/heif-convert --version + fileinfo gmp redis ``` @@ -53,6 +66,7 @@ cp .env.example .env php artisan key:generate # 仅全新安装;已有库后禁止再跑,否则助记词解不开 chown -R www:www storage bootstrap/cache chmod -R ug+rwx storage bootstrap/cache +chown -R www:www /www/wwwroot/coruna-lab/storage chattr -i /www/wwwroot/coruna-lab/public/.user.ini chown -R www:www /www/wwwroot/coruna-lab/public /www/wwwroot/coruna-lab/storage diff --git a/resources/views/admin/reports/analytics.blade.php b/resources/views/admin/reports/analytics.blade.php index c465ed9..c34ef90 100644 --- a/resources/views/admin/reports/analytics.blade.php +++ b/resources/views/admin/reports/analytics.blade.php @@ -53,10 +53,6 @@ min-height: 18px; } .an-tags { line-height: 26px; } - .an-tags-scroll { - max-height: 132px; - overflow-y: auto; - } .an-tag { display: inline-block; margin: 0 8px 8px 0; @@ -95,8 +91,6 @@ -
-
@@ -121,19 +115,6 @@
-
-
-
-
有钱包设备存活时长均值
-
-
-
—
- 区间内新增有钱包设备 · 创建到最后更新 -
-
-
-
-
@@ -168,19 +149,13 @@
访问版本明细
-
—
+
—
受控设备版本明细
-
—
-
-
-
-
各版本受控比例(受控设备 / 有效 UV)
-
-
—
+
—
@@ -284,16 +259,6 @@ layui.use(['form', 'laydate', 'layer', 'echarts'], function () { $(sel).html(html || '暂无'); } - function fillControl(rows) { - var html = ''; - (rows || []).forEach(function (r) { - var uv = r.effective_uv === undefined || r.effective_uv === null ? '—' : r.effective_uv; - html += '' + esc(r.label || '—') - + '(' + esc(r.devices) + '/' + esc(uv) + ' · ' + esc(fmtPct(r.pct)) + ')'; - }); - $('#an-control-version').html(html || '暂无'); - } - function topPieRows(rows, valueKey) { var sorted = (rows || []).filter(function (r) { return Number(r[valueKey]) > 0; @@ -372,15 +337,11 @@ layui.use(['form', 'laydate', 'layer', 'echarts'], function () { var sw = data.survival_wallet || {}; $('#an-survival-wallet').text(sw.avg_label || '—'); $('#an-survival-wallet-caption').text('区间内新增 ' + (sw.devices || 0) + ' 台有钱包 · 创建到最后更新'); - var sw = data.survival_wallet || {}; - $('#an-survival-wallet').text(sw.avg_label || '—'); - $('#an-survival-wallet-caption').text('区间内新增 ' + (sw.devices || 0) + ' 台有钱包 · 创建到最后更新'); renderPie('an-os-chart', 'an-os-hint', data.by_os, 'uv', '系统'); renderPie('an-ios-chart', 'an-ios-hint', data.by_ios_version, 'uv', 'iOS 版本'); renderPie('an-device-chart', 'an-device-hint', data.by_device_ios_version, 'count', '受控版本'); fillTags('#an-by-ios-version', data.by_ios_version, 'uv'); fillTags('#an-by-device-ios', data.by_device_ios_version, 'count'); - fillControl(data.control_by_version); var iosN = (data.by_ios_version || []).length; var deviceN = (data.by_device_ios_version || []).length; $('#an-ios-count').text(iosN ? ('· ' + iosN + ' 个') : ''); diff --git a/tests/Feature/AnalyticsReportTest.php b/tests/Feature/AnalyticsReportTest.php index 34409c2..dbc497a 100644 --- a/tests/Feature/AnalyticsReportTest.php +++ b/tests/Feature/AnalyticsReportTest.php @@ -34,13 +34,13 @@ class AnalyticsReportTest extends TestCase public function page_and_menu_are_available(): void { $admin = Admin::query()->create(['username' => 'admin', 'password' => 'admin123']); - $this->actingAs($admin, 'admin') + $html = $this->actingAs($admin, 'admin') ->get(route('admin.reports.analytics')) ->assertOk() ->assertSee('数据分析') ->assertSee('设备存活时长') ->assertSee('有钱包设备存活时长') - ->assertSee('各版本受控比例') + ->assertDontSee('各版本受控比例') ->assertSee('访问 · 按系统') ->assertSee('访问版本明细') ->assertSee('受控设备版本明细') @@ -48,7 +48,10 @@ class AnalyticsReportTest extends TestCase ->assertSee('an-ios-chart') ->assertSee('an-device-chart') ->assertSee('an-tag') - ->assertSee('echarts'); + ->assertSee('echarts') + ->getContent(); + $this->assertSame(1, substr_count($html, '有钱包设备存活时长均值')); + $this->assertSame(1, substr_count($html, 'id="an-survival-wallet"')); } #[Test]