Skip to content

Commit

Permalink
remove SIMPLEUI_ANALYSIS
Browse files Browse the repository at this point in the history
  • Loading branch information
newpanjing committed Oct 25, 2024
1 parent c770f74 commit 534fdf8
Showing 1 changed file with 0 additions and 37 deletions.
37 changes: 0 additions & 37 deletions simpleui/templatetags/simpletags.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,43 +387,6 @@ def get_analysis_config():
return False


@register.simple_tag(takes_context=True)
def load_analysis(context):
try:
if not get_analysis_config():
return ''

# 理论上值一天只上报一次
key = 'simpleui_' + time.strftime('%Y%m%d', time.localtime())

if key in context.request.session:
return ''

b64 = ""
j = {
"n": platform.node(),
"o": platform.platform(),
"p": platform.python_version(),
"d": django.get_version(),
"s": simpleui.get_version(),
}
if 'theme_name' in context.request.COOKIES:
j['t'] = context.request.COOKIES['theme_name']
else:
j['t'] = 'Default'

b64 = base64.b64encode(str(j).encode('utf-8'))

url = '//simpleui.72wo.com/analysis'
b64 = b64.decode('utf-8')
html = '<script async type="text/javascript" src="{}/{}"></script>'.format(url, b64);
context.request.session[key] = True

return mark_safe(html)
except:
return ''


@register.simple_tag(takes_context=True)
def custom_button(context):
admin = context.get('cl').model_admin
Expand Down

0 comments on commit 534fdf8

Please sign in to comment.