dmxdrake / metabase
在您的应用程序中嵌入 Metabase 仪表板和问题
0.4.3
2023-03-30 12:28 UTC
Requires
- php: ^8.1
- illuminate/support: *
- lcobucci/jwt: ^5.0.0
This package is not auto-updated.
Last update: 2024-09-29 00:18:40 UTC
README
Blade 组件,用于在您的网站中嵌入 metabase 仪表板或问题。有关 Metabase 的更多信息,请访问 Metabase 官方网站。
安装
composer require laravolt/metabase
将以下条目添加到 config/services.php
'metabase' => [ 'url' => env('METABASE_URL'), 'secret' => env('METABASE_SECRET'), ],
最后,更新您的 .env
文件
METABASE_URL=https://metabase.example.com METABASE_SECRET=secret
Metabase 密钥可以在 Metabase 设置页面中找到(只有管理员可以访问)。
有关更多信息,请访问 https://metabase.net.cn/docs/latest/administration-guide/13-embedding.html
使用方法
<!-- embed dashboard --> <x-metabase dashboard="1"></x-metabase> <!-- embed question --> <x-metabase question="2"></x-metabase> <!-- passing html attributes --> <x-metabase question="2" width="80%" height="500px"></x-metabase> <!-- passing metabase parameters --> @php($params = ['category' => 'php']) <x-metabase dashboard="1" :params="$params"></x-metabase> // BEWARE of the colon in ":params" (not "param") because we are passing array variable directly to the component <!-- passing additional metabase parameters --> <x-metabase dashboard="1" :params="$params" :bordered="false" titled theme="night"></x-metabase>
常见问题
此对象未启用嵌入。
解决方案: https://metabase.net.cn/learn/embedding/embedding-charts-and-dashboards
未找到。
仪表板或问题 ID 无效。
信息似乎已损坏或被篡改。
无效的秘密密钥。