mirror of
https://github.com/xfgryujk/blivechat.git
synced 2026-08-19 09:43:28 +08:00
插件、模板排序;说明支持显示空白字符
This commit is contained in:
@@ -118,17 +118,19 @@ class TemplatesHandler(api.base.ApiHandler):
|
||||
self.write({'templates': templates})
|
||||
|
||||
def _get_templates(self):
|
||||
template_ids = []
|
||||
entries = []
|
||||
try:
|
||||
with os.scandir(TEMPLATE_PATH) as it:
|
||||
for entry in it:
|
||||
if entry.is_dir() and os.path.isfile(os.path.join(entry.path, 'template.json')):
|
||||
template_ids.append(entry.name)
|
||||
entries.append((-entry.stat().st_mtime, entry.name))
|
||||
except OSError:
|
||||
logger.exception('Failed to discover templates:')
|
||||
return []
|
||||
if not template_ids:
|
||||
if not entries:
|
||||
return []
|
||||
entries.sort()
|
||||
template_ids = [entry[1] for entry in entries]
|
||||
|
||||
templates = []
|
||||
for template_id in template_ids:
|
||||
|
||||
@@ -193,7 +193,8 @@ export default {
|
||||
display: flex;
|
||||
flex-flow: row nowrap;
|
||||
gap: 1em;
|
||||
max-height: 300px;
|
||||
max-height: 200px;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.thumbnail {
|
||||
@@ -204,15 +205,12 @@ export default {
|
||||
|
||||
.description {
|
||||
flex: auto;
|
||||
overflow-y: auto;
|
||||
text-wrap: wrap;
|
||||
word-wrap: break-word;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 992px) {
|
||||
.description-line {
|
||||
flex-wrap: wrap;
|
||||
max-height: unset;
|
||||
}
|
||||
|
||||
.thumbnail {
|
||||
|
||||
@@ -168,6 +168,7 @@ export default {
|
||||
margin-block-end: 1em;
|
||||
flex: auto;
|
||||
overflow-y: auto;
|
||||
white-space: pre-wrap;
|
||||
}
|
||||
|
||||
.operations {
|
||||
|
||||
@@ -47,15 +47,16 @@ def shut_down():
|
||||
|
||||
|
||||
def _discover_plugin_ids():
|
||||
res = []
|
||||
entries = []
|
||||
try:
|
||||
with os.scandir(PLUGINS_PATH) as it:
|
||||
for entry in it:
|
||||
if entry.is_dir() and os.path.isfile(os.path.join(entry.path, 'plugin.json')):
|
||||
res.append(entry.name)
|
||||
entries.append((-entry.stat().st_mtime, entry.name))
|
||||
except OSError:
|
||||
logger.exception('Failed to discover plugins:')
|
||||
return res
|
||||
entries.sort()
|
||||
return [entry[1] for entry in entries]
|
||||
|
||||
|
||||
def _create_plugin(plugin_id):
|
||||
|
||||
Reference in New Issue
Block a user