Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: 【首页】首页优化调整 --story=120740565 #4325

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bkmonitor/bkmonitor/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
from .config import GlobalConfig # noqa
from .fta import * # noqa
from .healthz import * # noqa
from .home import * # noqa
from .metric_list_cache import * # noqa
from .report import * # noqa
from .statistics import * # noqa
Expand Down
37 changes: 37 additions & 0 deletions bkmonitor/bkmonitor/models/home.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
from django.db import models
from django.utils.translation import ugettext_lazy as _lazy


class FunctionAccessRecord(models.Model):
"""
功能访问记录
"""

username = models.CharField(max_length=64, verbose_name="用户名")
function = models.CharField(max_length=64, verbose_name="功能类型")
function_instance = models.CharField(max_length=64, verbose_name="功能实例")
access_time = models.DateTimeField(auto_now=True, verbose_name="访问时间")

class Meta:
db_table = "function_access_record"
unique_together = ("username", "function", "function_instance")
index_together = ("username", "function")
verbose_name = _lazy("功能访问记录")
verbose_name_plural = _lazy("功能访问记录")
ordering = ["-access_time"]


class HomeAlarmGraphConfig(models.Model):
"""
首页告警图配置
"""

username = models.CharField(max_length=64, verbose_name="用户名", db_index=True)
index = models.IntegerField(verbose_name="排序")
bk_biz_id = models.IntegerField(verbose_name="业务ID")
config = models.JSONField(verbose_name="配置", default=list)

class Meta:
db_table = "home_alarm_graph_config"
verbose_name = _lazy("首页告警图配置")
verbose_name_plural = _lazy("首页告警图配置")