diff --git a/plugins/.gitignore b/plugins/.gitignore index 57df6617..e31e19fd 100644 --- a/plugins/.gitignore +++ b/plugins/.gitignore @@ -1,6 +1,7 @@ * !FlatShipping !LatestProducts +!Openai !Paypal !Social !Stripe diff --git a/plugins/Openai/Bootstrap.php b/plugins/Openai/Bootstrap.php new file mode 100644 index 00000000..33895cc1 --- /dev/null +++ b/plugins/Openai/Bootstrap.php @@ -0,0 +1,33 @@ + + * @created 2023-02-27 13:57:38 + * @modified 2023-02-27 13:57:38 + */ + +namespace Plugin\Openai; + +class Bootstrap +{ + public function boot() + { + add_hook_filter('admin.sidebar.home.prefix', function ($data) { + $data[] = 'openai'; + + return $data; + }); + + add_hook_filter('admin.sidebar.home_routes', function ($data) { + $data[] = [ + 'route' => 'openai', + 'title' => 'ChatGPT', + ]; + + return $data; + }); + } +} diff --git a/plugins/Openai/Controllers/OpenaiController.php b/plugins/Openai/Controllers/OpenaiController.php new file mode 100644 index 00000000..f0dd30ea --- /dev/null +++ b/plugins/Openai/Controllers/OpenaiController.php @@ -0,0 +1,28 @@ + + * @created 2023-02-27 16:13:08 + * @modified 2023-02-27 16:13:08 + */ + +namespace Plugin\Openai\Controllers; + +use Beike\Admin\Http\Controllers\Controller; + +class OpenaiController extends Controller +{ + public function index() + { + $plugin = app('plugin')->getPlugin('openai'); + $data = [ + 'name' => $plugin->getLocaleName(), + 'description' => $plugin->getLocaleDescription(), + ]; + + return view('Openai::admin.openai', $data); + } +} diff --git a/plugins/Openai/Lang/en/common.php b/plugins/Openai/Lang/en/common.php new file mode 100644 index 00000000..d98aef08 --- /dev/null +++ b/plugins/Openai/Lang/en/common.php @@ -0,0 +1,23 @@ + + * @created 2022-08-11 15:26:18 + * @modified 2022-08-11 15:26:18 + */ + +return [ + // Text + 'title' => 'OpenAI intelligent chat assistant', + 'sub_title' => 'Based on OpenAI GPT3.0 integrated development If you have any questions, please consult qq group 639108380', + 'no_question' => 'Please enter the search content in the box below', + 'enter_question' => 'Please enter a question', + 'loading' => 'loading...', + 'no_more' => 'no more', + 'qa_q' => 'ask', + 'qa_a' => 'answer', + 'number_free' => 'The remaining free times of the day', +]; diff --git a/plugins/Openai/Lang/zh_cn/common.php b/plugins/Openai/Lang/zh_cn/common.php new file mode 100644 index 00000000..4af3cf42 --- /dev/null +++ b/plugins/Openai/Lang/zh_cn/common.php @@ -0,0 +1,23 @@ + + * @created 2022-08-11 15:26:18 + * @modified 2022-08-11 15:26:18 + */ + +return [ + // Text + 'title' => 'OpenAI 智能聊天助手', + 'sub_title' => '基于OpenAI GPT3.0 集成开发 如有疑问详询qq群639108380', + 'no_question' => '请在下面输入框搜索内容', + 'enter_question' => '请输入问题', + 'loading' => '加载中...', + 'no_more' => '没有更多了', + 'qa_q' => '问', + 'qa_a' => '答', + 'number_free' => '当日剩余免费次数', +]; diff --git a/plugins/Openai/Lang/zh_hk/common.php b/plugins/Openai/Lang/zh_hk/common.php new file mode 100644 index 00000000..ebeb3b0a --- /dev/null +++ b/plugins/Openai/Lang/zh_hk/common.php @@ -0,0 +1,23 @@ + + * @created 2022-08-11 15:26:18 + * @modified 2022-08-11 15:26:18 + */ + +return [ + // Text + 'title' => 'OpenAI 智能聊天助手', + 'sub_title' => '基於OpenAI GPT3.0 集成開發 如有疑問詳詢qq群639108380', + 'no_question' => '請在下面輸入框搜索內容', + 'enter_question' => '請輸入問題', + 'loading' => '加載中...', + 'no_more' => '没有更多了', + 'qa_q' => '問', + 'qa_a' => '答', + 'number_free' => '當日剩餘免費次數', +]; diff --git a/plugins/Openai/Routes/admin.php b/plugins/Openai/Routes/admin.php new file mode 100644 index 00000000..0c7af15d --- /dev/null +++ b/plugins/Openai/Routes/admin.php @@ -0,0 +1,15 @@ + + * @created 2022-08-04 16:17:53 + * @modified 2022-08-04 16:17:53 + */ + +use Illuminate\Support\Facades\Route; +use Plugin\Openai\Controllers\OpenaiController; + +Route::get('/openai', [OpenaiController::class, 'index'])->name('openai'); diff --git a/plugins/Openai/Static/image/logo.png b/plugins/Openai/Static/image/logo.png new file mode 100644 index 00000000..d510068d Binary files /dev/null and b/plugins/Openai/Static/image/logo.png differ diff --git a/plugins/Openai/Views/admin/openai.blade.php b/plugins/Openai/Views/admin/openai.blade.php new file mode 100644 index 00000000..5a593da9 --- /dev/null +++ b/plugins/Openai/Views/admin/openai.blade.php @@ -0,0 +1,185 @@ +@extends('admin::layouts.master') + +@section('title', $name) + +@section('content') +