mirror of
https://github.com/tgbot-collection/YYeTsBot.git
synced 2025-11-25 03:15:05 +08:00
grafana fix, github actions cache
This commit is contained in:
@@ -3,3 +3,9 @@ certs/*
|
||||
data/*
|
||||
logs/*
|
||||
YYeTsFE/node_modules/*
|
||||
.github/*
|
||||
assets/*
|
||||
tools/*
|
||||
scripts/*
|
||||
conf/*
|
||||
tests/*
|
||||
2
.github/workflows/builder.yaml
vendored
2
.github/workflows/builder.yaml
vendored
@@ -51,7 +51,7 @@ jobs:
|
||||
push: true
|
||||
tags: bennythink/yyetsbot:latest
|
||||
cache-from: type=local,src=/tmp/.buildx-cache
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache-new
|
||||
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max
|
||||
|
||||
- name: Move cache
|
||||
run: |
|
||||
|
||||
13
API.md
13
API.md
@@ -2,20 +2,21 @@
|
||||
|
||||
## FE
|
||||
|
||||
- [ ] group为admin特殊显示,评论接口已返回group信息
|
||||
- [ ] 评论楼中楼
|
||||
- [x] group为admin特殊显示,评论接口已返回group信息
|
||||
- [x] 评论楼中楼
|
||||
- [x] 联合搜索,当本地数据库搜索不到数据时,会返回extra字段
|
||||
- [ ] 评论通知(浏览器通知)
|
||||
- [ ] 最新评论(id为-1)
|
||||
- [ ] 联合搜索,当本地数据库搜索不到数据时,会返回extra字段
|
||||
- [ ] 公告
|
||||
|
||||
# BE
|
||||
|
||||
- [ ] 添加资源API
|
||||
- [x] 联合搜索:字幕侠、new字幕组、追新番
|
||||
- [ ] 评论通知,需要新接口
|
||||
- [ ] grafana面板
|
||||
- [x] grafana面板
|
||||
- [ ] 豆瓣接口
|
||||
- [ ] 用户体系(添加邮箱,邮件支持,找回密码)
|
||||
- [ ] 评论通知,需要新接口
|
||||
- [ ] 添加资源API
|
||||
|
||||
# 资源
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
"type": "grafana",
|
||||
"id": "grafana",
|
||||
"name": "Grafana",
|
||||
"version": "7.3.4"
|
||||
"version": "7.5.9"
|
||||
},
|
||||
{
|
||||
"type": "panel",
|
||||
@@ -55,9 +55,7 @@
|
||||
"dashes": false,
|
||||
"datasource": "${DS_JSON}",
|
||||
"fieldConfig": {
|
||||
"defaults": {
|
||||
"custom": {}
|
||||
},
|
||||
"defaults": {},
|
||||
"overrides": []
|
||||
},
|
||||
"fill": 1,
|
||||
@@ -69,6 +67,113 @@
|
||||
"y": 0
|
||||
},
|
||||
"hiddenSeries": false,
|
||||
"id": 10,
|
||||
"legend": {
|
||||
"avg": false,
|
||||
"current": false,
|
||||
"max": false,
|
||||
"min": false,
|
||||
"show": true,
|
||||
"total": false,
|
||||
"values": false
|
||||
},
|
||||
"lines": true,
|
||||
"linewidth": 1,
|
||||
"nullPointMode": "null",
|
||||
"options": {
|
||||
"alertThreshold": true
|
||||
},
|
||||
"percentage": false,
|
||||
"pluginVersion": "7.5.9",
|
||||
"pointradius": 2,
|
||||
"points": false,
|
||||
"renderer": "flot",
|
||||
"seriesOverrides": [],
|
||||
"spaceLength": 10,
|
||||
"stack": false,
|
||||
"steppedLine": false,
|
||||
"targets": [
|
||||
{
|
||||
"data": "",
|
||||
"refId": "A",
|
||||
"target": "help",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"data": "",
|
||||
"hide": false,
|
||||
"refId": "B",
|
||||
"target": "database",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"data": "",
|
||||
"hide": false,
|
||||
"refId": "C",
|
||||
"target": "discuss",
|
||||
"type": "timeseries"
|
||||
}
|
||||
],
|
||||
"thresholds": [],
|
||||
"timeFrom": null,
|
||||
"timeRegions": [],
|
||||
"timeShift": null,
|
||||
"title": "Other",
|
||||
"tooltip": {
|
||||
"shared": true,
|
||||
"sort": 0,
|
||||
"value_type": "individual"
|
||||
},
|
||||
"type": "graph",
|
||||
"xaxis": {
|
||||
"buckets": null,
|
||||
"mode": "time",
|
||||
"name": null,
|
||||
"show": true,
|
||||
"values": []
|
||||
},
|
||||
"yaxes": [
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": true
|
||||
}
|
||||
],
|
||||
"yaxis": {
|
||||
"align": false,
|
||||
"alignLevel": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"aliasColors": {},
|
||||
"bars": false,
|
||||
"dashLength": 10,
|
||||
"dashes": false,
|
||||
"datasource": "${DS_JSON}",
|
||||
"fieldConfig": {
|
||||
"defaults": {},
|
||||
"overrides": []
|
||||
},
|
||||
"fill": 1,
|
||||
"fillGradient": 0,
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 0
|
||||
},
|
||||
"hiddenSeries": false,
|
||||
"id": 2,
|
||||
"legend": {
|
||||
"avg": false,
|
||||
@@ -86,7 +191,7 @@
|
||||
"alertThreshold": true
|
||||
},
|
||||
"percentage": false,
|
||||
"pluginVersion": "7.3.4",
|
||||
"pluginVersion": "7.5.9",
|
||||
"pointradius": 2,
|
||||
"points": false,
|
||||
"renderer": "flot",
|
||||
@@ -98,19 +203,42 @@
|
||||
{
|
||||
"data": "",
|
||||
"refId": "A",
|
||||
"target": "access",
|
||||
"target": "resource",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"data": "",
|
||||
"hide": false,
|
||||
"refId": "B",
|
||||
"target": "top",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"data": "",
|
||||
"hide": false,
|
||||
"refId": "C",
|
||||
"target": "home",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"data": "",
|
||||
"hide": false,
|
||||
"refId": "D",
|
||||
"target": "search",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"data": "",
|
||||
"refId": "C",
|
||||
"target": "resource",
|
||||
"hide": false,
|
||||
"refId": "E",
|
||||
"target": "backOld",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"data": "",
|
||||
"hide": false,
|
||||
"refId": "F",
|
||||
"target": "extra",
|
||||
"type": "timeseries"
|
||||
}
|
||||
],
|
||||
@@ -118,7 +246,235 @@
|
||||
"timeFrom": null,
|
||||
"timeRegions": [],
|
||||
"timeShift": null,
|
||||
"title": "Access Report",
|
||||
"title": "Resource",
|
||||
"tooltip": {
|
||||
"shared": true,
|
||||
"sort": 0,
|
||||
"value_type": "individual"
|
||||
},
|
||||
"type": "graph",
|
||||
"xaxis": {
|
||||
"buckets": null,
|
||||
"mode": "time",
|
||||
"name": null,
|
||||
"show": true,
|
||||
"values": []
|
||||
},
|
||||
"yaxes": [
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": true
|
||||
}
|
||||
],
|
||||
"yaxis": {
|
||||
"align": false,
|
||||
"alignLevel": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"aliasColors": {},
|
||||
"bars": false,
|
||||
"dashLength": 10,
|
||||
"dashes": false,
|
||||
"datasource": "${DS_JSON}",
|
||||
"fieldConfig": {
|
||||
"defaults": {},
|
||||
"overrides": []
|
||||
},
|
||||
"fill": 1,
|
||||
"fillGradient": 0,
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 0,
|
||||
"y": 8
|
||||
},
|
||||
"hiddenSeries": false,
|
||||
"id": 8,
|
||||
"legend": {
|
||||
"avg": false,
|
||||
"current": false,
|
||||
"max": false,
|
||||
"min": false,
|
||||
"show": true,
|
||||
"total": false,
|
||||
"values": false
|
||||
},
|
||||
"lines": true,
|
||||
"linewidth": 1,
|
||||
"nullPointMode": "null",
|
||||
"options": {
|
||||
"alertThreshold": true
|
||||
},
|
||||
"percentage": false,
|
||||
"pluginVersion": "7.5.9",
|
||||
"pointradius": 2,
|
||||
"points": false,
|
||||
"renderer": "flot",
|
||||
"seriesOverrides": [],
|
||||
"spaceLength": 10,
|
||||
"stack": false,
|
||||
"steppedLine": false,
|
||||
"targets": [
|
||||
{
|
||||
"data": "",
|
||||
"refId": "A",
|
||||
"target": "user",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"data": "",
|
||||
"hide": false,
|
||||
"refId": "B",
|
||||
"target": "share",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"data": "",
|
||||
"hide": false,
|
||||
"refId": "C",
|
||||
"target": "me",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"data": "",
|
||||
"hide": false,
|
||||
"refId": "D",
|
||||
"target": "comment",
|
||||
"type": "timeseries"
|
||||
}
|
||||
],
|
||||
"thresholds": [],
|
||||
"timeFrom": null,
|
||||
"timeRegions": [],
|
||||
"timeShift": null,
|
||||
"title": "User",
|
||||
"tooltip": {
|
||||
"shared": true,
|
||||
"sort": 0,
|
||||
"value_type": "individual"
|
||||
},
|
||||
"type": "graph",
|
||||
"xaxis": {
|
||||
"buckets": null,
|
||||
"mode": "time",
|
||||
"name": null,
|
||||
"show": true,
|
||||
"values": []
|
||||
},
|
||||
"yaxes": [
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": true
|
||||
},
|
||||
{
|
||||
"format": "short",
|
||||
"label": null,
|
||||
"logBase": 1,
|
||||
"max": null,
|
||||
"min": null,
|
||||
"show": true
|
||||
}
|
||||
],
|
||||
"yaxis": {
|
||||
"align": false,
|
||||
"alignLevel": null
|
||||
}
|
||||
},
|
||||
{
|
||||
"aliasColors": {},
|
||||
"bars": false,
|
||||
"dashLength": 10,
|
||||
"dashes": false,
|
||||
"datasource": "${DS_JSON}",
|
||||
"fieldConfig": {
|
||||
"defaults": {},
|
||||
"overrides": []
|
||||
},
|
||||
"fill": 1,
|
||||
"fillGradient": 0,
|
||||
"gridPos": {
|
||||
"h": 8,
|
||||
"w": 12,
|
||||
"x": 12,
|
||||
"y": 8
|
||||
},
|
||||
"hiddenSeries": false,
|
||||
"id": 6,
|
||||
"legend": {
|
||||
"avg": false,
|
||||
"current": false,
|
||||
"max": false,
|
||||
"min": false,
|
||||
"show": true,
|
||||
"total": false,
|
||||
"values": false
|
||||
},
|
||||
"lines": true,
|
||||
"linewidth": 1,
|
||||
"nullPointMode": "null",
|
||||
"options": {
|
||||
"alertThreshold": true
|
||||
},
|
||||
"percentage": false,
|
||||
"pluginVersion": "7.5.9",
|
||||
"pointradius": 2,
|
||||
"points": false,
|
||||
"renderer": "flot",
|
||||
"seriesOverrides": [],
|
||||
"spaceLength": 10,
|
||||
"stack": false,
|
||||
"steppedLine": false,
|
||||
"targets": [
|
||||
{
|
||||
"data": "",
|
||||
"refId": "A",
|
||||
"target": "multiDownload",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"data": "",
|
||||
"hide": false,
|
||||
"refId": "B",
|
||||
"target": "download",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"data": "",
|
||||
"hide": false,
|
||||
"refId": "C",
|
||||
"target": "favorite",
|
||||
"type": "timeseries"
|
||||
},
|
||||
{
|
||||
"data": "",
|
||||
"hide": false,
|
||||
"refId": "D",
|
||||
"target": "unFavorite",
|
||||
"type": "timeseries"
|
||||
}
|
||||
],
|
||||
"thresholds": [],
|
||||
"timeFrom": null,
|
||||
"timeRegions": [],
|
||||
"timeShift": null,
|
||||
"title": "Action",
|
||||
"tooltip": {
|
||||
"shared": true,
|
||||
"sort": 0,
|
||||
@@ -156,7 +512,7 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"schemaVersion": 26,
|
||||
"schemaVersion": 27,
|
||||
"style": "dark",
|
||||
"tags": [],
|
||||
"templating": {
|
||||
@@ -170,5 +526,5 @@
|
||||
"timezone": "",
|
||||
"title": "YYeTs",
|
||||
"uid": "zJOru_8Gz",
|
||||
"version": 2
|
||||
"version": 5
|
||||
}
|
||||
@@ -329,8 +329,8 @@ class CommentHandler(BaseHandler):
|
||||
class CommentChildHandler(CommentHandler):
|
||||
class_name = f"CommentChild{adapter}Resource"
|
||||
|
||||
from Mongo import CommentChildResource
|
||||
instance = CommentChildResource()
|
||||
# from Mongo import CommentChildResource
|
||||
# instance = CommentChildResource()
|
||||
|
||||
@run_on_executor()
|
||||
def get_comment(self):
|
||||
@@ -455,7 +455,8 @@ class GrafanaIndexHandler(BaseHandler):
|
||||
class GrafanaSearchHandler(BaseHandler):
|
||||
|
||||
def post(self):
|
||||
data = ["access", "search", "resource"]
|
||||
data = ["resource", "top", "home", "search", "extra", "discuss", "multiDownload", "download", "user", "share",
|
||||
"me", "database", "help", "backOld", "favorite", "unFavorite", "comment"]
|
||||
self.write(json.dumps(data))
|
||||
|
||||
|
||||
@@ -493,8 +494,9 @@ class GrafanaQueryHandler(BaseHandler):
|
||||
for target in targets:
|
||||
data_points = []
|
||||
result = self.instance.get_grafana_data(date_series)
|
||||
i: dict
|
||||
for i in result:
|
||||
datum = [i[target], self.time_str_int(i["date"]) * 1000]
|
||||
datum = [i[target], self.time_str_int(i["date"]) * 1000] if i.get(target) else []
|
||||
data_points.append(datum)
|
||||
temp = {
|
||||
"target": target,
|
||||
|
||||
Reference in New Issue
Block a user