Browse Source

Chore/move chrome ext (#3085)

crazywoola 1 year ago
parent
commit
7f55ea0c53

+ 3 - 0
README.md

@@ -122,6 +122,9 @@ For those who'd like to contribute code, see our [Contribution Guide](https://gi
 
 
 At the same time, please consider supporting Dify by sharing it on social media and at events and conferences.
 At the same time, please consider supporting Dify by sharing it on social media and at events and conferences.
 
 
+### Projects made by community
+
+- [Chatbot Chrome Extension by @charli117](https://github.com/langgenius/chatbot-chrome-extension)
 
 
 ### Contributors
 ### Contributors
 
 

+ 0 - 33
third-party/chrome plug-in/README_CN.md

@@ -1,33 +0,0 @@
-## Chrome Dify ChatBot插件
-
-### 方式1:Chrome插件商店 * [点击访问](https://chrome.google.com/webstore/detail/dify-chatbot/ceehdapohffmjmkdcifjofadiaoeggaf/related?hl=zh-CN&authuser=0) *
- 
-### 方式2:本地开发者模式加载
-
-- 进入Chrome浏览器管理扩展程序,可直接访问 [chrome://extensions/](chrome://extensions/)
-- 选择开启 “开发者模式”,并点击 “加载已解压的扩展程序”
-
-![img-1.png](images/img-1.png)
-
-- 然后打开插件源文件所在根目录
-  - third-party
-    - chrome plug-in
-      - content.js          浮动按钮JS脚本
-      - favicon.png         插件图标
-      - manifest.json       插件描述文件
-      - options.css         插件配置页面样式文件
-      - options.html        插件配置静态HTML页面
-      - options.js          插件配置JS脚本
-
-### 插件导入完成后,后续配置无差异
-- 创建Dify应用配置,在应用概览中点击嵌入,切换到安装Chrome浏览器扩展视图,点击copy按钮获取ChatBot Url,如图:
-
-![img-2.png](images/img-2.png)
-- 点击保存,确认提示配置成功即可
-
-![img-3.png](images/img-3.png)
-
-- 保险起见重启浏览器确保所有分页刷新成功
-- Chrome打开任意页面均可正常加载DIfy机器人浮动栏,后续如需更换机器人只需要变更ChatBot Url即可
-
-![img-4.png](images/img-4.png)

+ 0 - 6
third-party/chrome plug-in/README_CN.txt

@@ -1,6 +0,0 @@
-## Chrome Dify ChatBot插件
-
-1、初始化设置Dify 应用配置,分别输入Dify根域名和应用Token,Token可以在Dify应用嵌入中获取;
-2、点击保存,确认提示配置成功即可;
-3、保险起见重启浏览器确保所有分页刷新成功;
-4、Chrome打开任意页面均可正常加载DIfy机器人浮动栏,后续如需更换机器人只需要变更Token即可;

File diff suppressed because it is too large
+ 0 - 168
third-party/chrome plug-in/content.js


BIN
third-party/chrome plug-in/favicon.png


BIN
third-party/chrome plug-in/images/128.png


BIN
third-party/chrome plug-in/images/16.png


BIN
third-party/chrome plug-in/images/32.png


BIN
third-party/chrome plug-in/images/48.png


BIN
third-party/chrome plug-in/images/favicon.ico


BIN
third-party/chrome plug-in/images/img-1.png


BIN
third-party/chrome plug-in/images/img-2.png


BIN
third-party/chrome plug-in/images/img-3.png


BIN
third-party/chrome plug-in/images/img-4.png


+ 0 - 29
third-party/chrome plug-in/manifest.json

@@ -1,29 +0,0 @@
-{
-  "manifest_version": 3,
-  "name": "Dify Chatbot",
-  "version": "1.5",
-  "description": "This is a chrome extension to inject a dify chatbot on any pages",
-  "content_scripts": [
-    {
-      "matches": ["<all_urls>"],
-      "js": ["content.js"]
-    }
-  ],
-  "permissions": ["webRequest", "storage"],
-  "action": {
-      "default_popup": "options.html",
-      "default_icon": {
-        "16": "images/16.png",
-        "32": "images/32.png",
-        "48": "images/48.png",
-        "128": "images/128.png"
-
-      }
-  },
-  "icons": {
-    "16": "images/16.png",
-    "32": "images/32.png",
-    "48": "images/48.png",
-    "128": "images/128.png"
-  }
-}

+ 0 - 19
third-party/chrome plug-in/options.css

@@ -1,19 +0,0 @@
-body {
-  background-color: #f2f2f2;
-  font-family: Arial, sans-serif;
-}
-
-h2 {
-  color: #333;
-}
-
-label {
-  display: block;
-  margin-top: 10px;
-  margin-bottom: 10px;
-}
-
-input[type="text"] {
-  width: 280px;
-  padding: 6px;
-}

+ 0 - 45
third-party/chrome plug-in/options.html

@@ -1,45 +0,0 @@
-<!DOCTYPE html>
-<html>
-
-<head>
-  <title>Dify Chatbot Extension</title>
-  <meta name="viewport" content="width=device-width, initial-scale=1.0">
-  <link href="./tailwind.css" rel="stylesheet">
-</head>
-
-<body class="bg-gray-100 py-4 px-4 w-128">
-  <div class="max-w-md mx-auto bg-white shadow-md rounded-lg p-4">
-    <h2 class="text-2xl font-semibold mb-4">Dify Chatbot Extension</h2>
-    <form>
-      <div class="mb-4 flex items-center">
-        <div class="w-1/4">
-          <label for="chatbot-url" class="block font-semibold text-gray-700">ChatBot URL</label>
-        </div>
-        <div class="w-3/4">
-          <input type="text" id="chatbot-url" name="base-url" value=""
-            class="w-full border border-gray-300 rounded px-3 py-2 focus:outline-none focus:border-blue-400"
-            placeholder="https://udify.app/chatbot/7CQBa5yyvYLSkZtx">
-        </div>
-      </div>
-
-      <div class="mb-4 flex items-center">
-        <div class="w-1/4"></div>
-        <div class="w-3/4">
-          <span id="error-tip" class="text-red-600"></span>
-        </div>
-      </div>
-
-      <div class="mb-4 flex items-center">
-        <div class="w-1/4"></div>
-        <div class="w-3/4">
-          <button id="save-button"
-            class="bg-blue-500 text-white py-2 px-4 rounded hover:bg-blue-600 focus:outline-none focus:bg-blue-600">Save</button>
-        </div>
-      </div>
-    </form>
-  </div>
-
-  <script src="options.js"></script>
-</body>
-
-</html>

+ 0 - 28
third-party/chrome plug-in/options.js

@@ -1,28 +0,0 @@
-
-document.getElementById('save-button').addEventListener('click', function (e) {
-  e.preventDefault();
-  const chatbotUrl = document.getElementById('chatbot-url').value;
-  const errorTip = document.getElementById('error-tip');
-
-  if (chatbotUrl.trim() === "") {
-      errorTip.textContent = "Dify ChatBot URL cannot be empty.";
-  } else {
-    errorTip.textContent = "";
-
-    chrome.storage.sync.set({
-      'chatbotUrl': chatbotUrl,
-    }, function () {
-      alert('Save Success!');
-    });
-  }
-});
-
-// Load parameters from chrome.storage when the page loads
-chrome.storage.sync.get(['chatbotUrl'], function (result) {
-  const chatbotUrlInput = document.getElementById('chatbot-url');
-
-  if (result.chatbotUrl) {
-    chatbotUrlInput.value = result.chatbotUrl;
-  }
-
-});

File diff suppressed because it is too large
+ 0 - 176015
third-party/chrome plug-in/tailwind.css