LANraragi_cn/templates/plugins.html.tt2
2022-08-16 00:10:20 +08:00

210 lines
7.2 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<head>
<title>[% title %] - 插件配置</title>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link type="image/png" rel="icon" href="/favicon.ico" />
<link rel="stylesheet" type="text/css" href="/css/lrr.css?[% version%]" />
<link rel="stylesheet" type="text/css" href="/css/config.css" />
<link rel="stylesheet" type="text/css" href="/css/vendor/fontawesome-all.min.css" />
<link rel="stylesheet" type="text/css" href="/css/vendor/jquery.fileupload.css" />
<link rel="stylesheet" type="text/css" href="/css/vendor/allcollapsible.min.css" />
<link rel="stylesheet" type="text/css" href="/css/vendor/ReactToastify.min.css" />
<link rel="stylesheet" type="text/css" href="/css/vendor/sweetalert2.min.css" />
[% csshead %]
<script src="/js/vendor/jquery.min.js" type="text/JAVASCRIPT"></script>
<script src="/js/vendor/preact.umd.js" type="text/JAVASCRIPT"></script>
<script src="/js/vendor/hooks.umd.js" type="text/JAVASCRIPT"></script>
<script src="/js/vendor/compat.umd.js" type="text/JAVASCRIPT"></script>
<script>window.React=window.preactCompat;window.react=window.preactCompat;</script>
<script src="/js/vendor/clsx.min.js" type="text/JAVASCRIPT"></script>
<script src="/js/vendor/react-toastify.umd.js" type="text/JAVASCRIPT"></script>
<script src="/js/vendor/jquery.ui.widget.js" type="text/JAVASCRIPT"></script>
<script src="/js/vendor/jquery.fileupload.js" type="text/JAVASCRIPT"></script>
<script src="/js/vendor/allcollapsible.min.js" type="text/JAVASCRIPT"></script>
<script src="/js/vendor/sweetalert2.min.js" type="text/JAVASCRIPT"></script>
<script src="/js/common.js?[% version%]" type="text/JAVASCRIPT"></script>
<script src="/js/server.js?[% version%]" type="text/JAVASCRIPT"></script>
<script src="/js/plugins.js?[% version%]" type="text/JAVASCRIPT"></script>
</head>
<body>
<div class="ido" style="text-align:center;">
<h1 class="ih" style="text-align:center">插件配置</h1>
<br /> 切换该选项,在元数据插件上启用/禁用 Auto-Plugin。
<br /> 如果在这里切换插件,它们将自动用于新档案。
<br /> 如果它们具有配置变量,则也可以在此处进行设置。
<br /> 您也可以在此处触发脚本。 触发脚本将事先保存您的插件设置。
<br />
<form name="editPluginForm" id="editPluginForm" enctype="multipart/form-data" method="post">
<div class="left-column" style="width:49%">
<ul class="collapsible extensible with-right-caret">
<li class="option-flyout">
<div class="collapsible-title caret-right">
<i class="fa fa-plug" aria-hidden="true"></i> 登录插件
</div>
<div class="collapsible-body">
[% INCLUDE pluginlist plugins = logins %]
</div>
</li>
<li class="option-flyout">
<div class="collapsible-title caret-right">
<i class="fas fa-cloud-download-alt" aria-hidden="true"></i> 下载器
</div>
<div class="collapsible-body">
[% INCLUDE pluginlist plugins = downloaders %]
</div>
</li>
<li class="option-flyout">
<div class="collapsible-title caret-right">
<i class="fa fa-scroll" aria-hidden="true"></i> 脚本
</div>
<div class="collapsible-body">
[% INCLUDE pluginlist plugins = scripts %]
</div>
</li>
</ul>
</div>
<div class="right-column" style="width:50%">
<ul class="collapsible extensible with-right-caret">
<li class="option-flyout">
<div class="collapsible-title caret-right">
<i class="fa fa-digital-tachograph" aria-hidden="true"></i> 元数据插件
</div>
<div class="collapsible-body">
[% INCLUDE pluginlist plugins = metadata %]
</div>
</li>
</ul>
</div>
<br />
<h1 style="text-align:center">
<span class="script-running" style="display:none">
<i aria-hidden="true" class="fa fa-3x fa-atom fa-spin"></i> <br>
一个脚本正在运行...
</span>
<input id='save' class='stdbtn' type='button' value='保存插件配置' />
<span id="plugin-upload" class='stdbtn fileinput-button'
style="margin-bottom: -10px; font-weight:normal">
<span style="position:absolute; top:5px; left:25%">上传插件</span>
<input type='file' name='file' multiple id='fileupload'>
</span>
<input id='return' class='stdbtn' type='button' value='返回资料库' />
</h1>
</form>
</div>
[% INCLUDE footer %]
</body>
</html>
[% BLOCK pluginlist %]
[% FOREACH plugin IN plugins %]
<span style="display:inline-block; text-align: left; width:80%; border-bottom-width: 1px;border-bottom-style: solid">
[% IF plugin.icon %]
<img height=20 width=20 src="[% plugin.icon %]" />
[% ELSE %]
<i class="fa fa-puzzle-piece" style="font-size:20px"></i>
[% END %]
<h2 class="ih" style="display:inline"> [% plugin.name %] v.[% plugin.version %]</h2>
<h1 class="ih" style="display:inline"> by [% plugin.author %] </h1>
<div style="float:right; text-align: right;">
[% IF plugin.type == "metadata" %]
<h1 class="ih" style="display:inline"> 自动运行: </h1>
<input id="[% plugin.namespace %]" name="[% plugin.namespace %]" class="fa" type="checkbox" [% IF plugin.enabled
%] checked [% END %]>
<br />
[% END %]
[% IF plugin.login_from %]
<i class="fa fa-plug" aria-hidden="true"></i> 该插件依赖登录插件 "[% plugin.login_from %]".
[% END %]
</div>
<br />
[% IF plugin.type == "download" %]
<pre title="此插件将在与该正则表达式匹配的URL上触发"> [% plugin.url_regex %]</pre>
[% END %]
[% plugin.description %]
<br />
[% IF plugin.type == "script" %]
<table>
<tbody>
[% IF plugin.oneshot_arg %]
<tr>
<td style="vertical-align:middle">
<b> [% plugin.oneshot_arg %] : </b>
</td>
<td>
<input style="max-width:200px" size="20" id="[% plugin.namespace %]_ARG" />
<br />
</td>
</tr>
[% END %]
<tr>
<td colspan="2">
<input class='stdbtn' type='button' onclick="Server.triggerScript('[% plugin.namespace %]');"
value='触发脚本' />
</td>
</tr>
</tbody>
</table>
[% END %]
[% IF plugin.parameters && plugin.parameters.size %]
<div class="collapsible-title" style="padding: 5px 0 0 5px">
<a>
<i class="fas fa-sliders-h fa-2x" style="margin-right: 4px" aria-hidden="true"></i>
<b style="vertical-align: super;">插件设置</b>
</a>
</div>
<div class="collapsible-body" style="padding:5px 0 0 0">
<table>
<tbody>
[% FOREACH param IN plugin.parameters %]
<tr>
<td style="vertical-align:middle">
<b> [% param.desc %] : </b>
</td>
<td>
<input style="max-width:200px" size="20" name="[% plugin.namespace %]_CFG_[% loop.count %]"
type=[% SWITCH param.type %] # time for some real-ass typage [% CASE 'string' %] "text"
value="[% param.value %]" class="stdinput" [% CASE 'bool' %] "checkbox" value="1" class="fa"
[% IF param.value %] checked [% END %] [% CASE 'int' %] "number" value="[% param.value %]"
class="stdinput" [% CASE %] # default (ayy lmao) "color" [% END %] />
<br />
</td>
</tr>
[% END %]
</tbody>
</table>
</div>
[% END %]
<br />
</span>
<br />
<br />
[% END %]
[% END %]