feat: add star repo shortcut to installer dialog
This commit is contained in:
@@ -31,6 +31,7 @@ GITHUB_TIMEOUT = 30.0
|
||||
CONFIRMATION_TIMEOUT = 120.0 # 2 minutes for user confirmation
|
||||
GITHUB_API = "https://api.github.com"
|
||||
GITHUB_RAW = "https://raw.githubusercontent.com"
|
||||
PROJECT_REPO_URL = "https://github.com/Fu-Jie/openwebui-extensions"
|
||||
SELF_EXCLUDE_HINT = "batch-install-plugins"
|
||||
SELF_EXCLUDE_TERMS = (
|
||||
SELF_EXCLUDE_HINT,
|
||||
@@ -313,6 +314,7 @@ SELECTION_DIALOG_TEXTS = {
|
||||
"selected_count": "{count} selected",
|
||||
"install_selected": "Install Selected",
|
||||
"cancel": "Cancel",
|
||||
"star_repo": "Star Repo",
|
||||
"version_label": "Version",
|
||||
"file_label": "File",
|
||||
"description_label": "Description",
|
||||
@@ -331,6 +333,7 @@ SELECTION_DIALOG_TEXTS = {
|
||||
"selected_count": "已选 {count} 项",
|
||||
"install_selected": "安装所选插件",
|
||||
"cancel": "取消",
|
||||
"star_repo": "Star 仓库",
|
||||
"version_label": "版本",
|
||||
"file_label": "文件",
|
||||
"description_label": "描述",
|
||||
@@ -349,6 +352,7 @@ SELECTION_DIALOG_TEXTS = {
|
||||
"selected_count": "已選 {count} 項",
|
||||
"install_selected": "安裝所選外掛",
|
||||
"cancel": "取消",
|
||||
"star_repo": "Star 倉庫",
|
||||
"version_label": "版本",
|
||||
"file_label": "檔案",
|
||||
"description_label": "描述",
|
||||
@@ -367,6 +371,7 @@ SELECTION_DIALOG_TEXTS = {
|
||||
"selected_count": "已選 {count} 項",
|
||||
"install_selected": "安裝所選外掛",
|
||||
"cancel": "取消",
|
||||
"star_repo": "Star 倉庫",
|
||||
"version_label": "版本",
|
||||
"file_label": "檔案",
|
||||
"description_label": "描述",
|
||||
@@ -385,6 +390,7 @@ SELECTION_DIALOG_TEXTS = {
|
||||
"selected_count": "{count}개 선택됨",
|
||||
"install_selected": "선택한 플러그인 설치",
|
||||
"cancel": "취소",
|
||||
"star_repo": "저장소 Star",
|
||||
"version_label": "버전",
|
||||
"file_label": "파일",
|
||||
"description_label": "설명",
|
||||
@@ -403,6 +409,7 @@ SELECTION_DIALOG_TEXTS = {
|
||||
"selected_count": "{count}件を選択",
|
||||
"install_selected": "選択したプラグインをインストール",
|
||||
"cancel": "キャンセル",
|
||||
"star_repo": "リポジトリにスター",
|
||||
"version_label": "バージョン",
|
||||
"file_label": "ファイル",
|
||||
"description_label": "説明",
|
||||
@@ -421,6 +428,7 @@ SELECTION_DIALOG_TEXTS = {
|
||||
"selected_count": "{count} sélectionnés",
|
||||
"install_selected": "Installer la sélection",
|
||||
"cancel": "Annuler",
|
||||
"star_repo": "Star le dépôt",
|
||||
"version_label": "Version",
|
||||
"file_label": "Fichier",
|
||||
"description_label": "Description",
|
||||
@@ -439,6 +447,7 @@ SELECTION_DIALOG_TEXTS = {
|
||||
"selected_count": "{count} ausgewählt",
|
||||
"install_selected": "Auswahl installieren",
|
||||
"cancel": "Abbrechen",
|
||||
"star_repo": "Repo mit Stern",
|
||||
"version_label": "Version",
|
||||
"file_label": "Datei",
|
||||
"description_label": "Beschreibung",
|
||||
@@ -457,6 +466,7 @@ SELECTION_DIALOG_TEXTS = {
|
||||
"selected_count": "{count} seleccionados",
|
||||
"install_selected": "Instalar seleccionados",
|
||||
"cancel": "Cancelar",
|
||||
"star_repo": "Dar estrella",
|
||||
"version_label": "Versión",
|
||||
"file_label": "Archivo",
|
||||
"description_label": "Descripción",
|
||||
@@ -475,6 +485,7 @@ SELECTION_DIALOG_TEXTS = {
|
||||
"selected_count": "{count} selezionati",
|
||||
"install_selected": "Installa selezionati",
|
||||
"cancel": "Annulla",
|
||||
"star_repo": "Metti una stella",
|
||||
"version_label": "Versione",
|
||||
"file_label": "File",
|
||||
"description_label": "Descrizione",
|
||||
@@ -493,6 +504,7 @@ SELECTION_DIALOG_TEXTS = {
|
||||
"selected_count": "Đã chọn {count}",
|
||||
"install_selected": "Cài đặt mục đã chọn",
|
||||
"cancel": "Hủy",
|
||||
"star_repo": "Star kho",
|
||||
"version_label": "Phiên bản",
|
||||
"file_label": "Tệp",
|
||||
"description_label": "Mô tả",
|
||||
@@ -1046,9 +1058,15 @@ def _build_selection_dialog_js(
|
||||
" overlay.innerHTML = `",
|
||||
" <div style=\"width:min(920px,100%);max-height:min(88vh,900px);overflow:hidden;border-radius:18px;background:#ffffff;box-shadow:0 30px 80px rgba(15,23,42,0.28);display:flex;flex-direction:column;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif\">",
|
||||
" <div style=\"padding:22px 24px 16px;border-bottom:1px solid #e5e7eb\">",
|
||||
" <div>",
|
||||
" <div style=\"font-size:22px;font-weight:700;color:#0f172a\">${escapeHtml(ui.title)}</div>",
|
||||
" <div style=\"margin-top:8px;font-size:14px;color:#475569\">${escapeHtml(ui.list_title)}</div>",
|
||||
" <div style=\"display:flex;justify-content:space-between;gap:14px;align-items:flex-start;flex-wrap:wrap\">",
|
||||
" <div>",
|
||||
" <div style=\"font-size:22px;font-weight:700;color:#0f172a\">${escapeHtml(ui.title)}</div>",
|
||||
" <div style=\"margin-top:8px;font-size:14px;color:#475569\">${escapeHtml(ui.list_title)}</div>",
|
||||
" </div>",
|
||||
" <a href=\"${escapeHtml(ui.project_repo_url)}\" target=\"_blank\" rel=\"noopener noreferrer\" title=\"${escapeHtml(ui.star_repo)}\" style=\"display:inline-flex;align-items:center;gap:8px;padding:8px 12px;border:1px solid #fde68a;border-radius:999px;background:#fffbeb;color:#92400e;font-size:13px;font-weight:700;text-decoration:none;box-shadow:0 1px 2px rgba(15,23,42,0.04)\">",
|
||||
" <svg width=\"15\" height=\"15\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-hidden=\"true\"><path d=\"M12 2.75l2.85 5.78 6.38.93-4.61 4.49 1.09 6.35L12 17.31l-5.71 2.99 1.09-6.35-4.61-4.49 6.38-.93L12 2.75z\"></path></svg>",
|
||||
" <span>${escapeHtml(ui.star_repo)}</span>",
|
||||
" </a>",
|
||||
" </div>",
|
||||
" <div id=\"batch-install-plugin-selector-hint\" style=\"margin-top:14px;padding:12px 14px;border-radius:12px;background:#f8fafc;color:#334155;font-size:13px;line-height:1.5;white-space:pre-wrap\"></div>",
|
||||
" </div>",
|
||||
@@ -1347,6 +1365,8 @@ async def _request_plugin_selection(
|
||||
"all_types": _selection_t(lang, "all_types"),
|
||||
"repo_filter": _selection_t(lang, "repo_filter"),
|
||||
"all_repos": _selection_t(lang, "all_repos"),
|
||||
"star_repo": _selection_t(lang, "star_repo"),
|
||||
"project_repo_url": PROJECT_REPO_URL,
|
||||
"search_label": _selection_t(lang, "search_label"),
|
||||
"search_placeholder": _selection_t(lang, "search_placeholder"),
|
||||
"no_results": _selection_t(lang, "no_results"),
|
||||
|
||||
Reference in New Issue
Block a user