Skip to content

Commit

Permalink
Release 0.17.1
Browse files Browse the repository at this point in the history
  • Loading branch information
wh1te909 committed Nov 7, 2023
2 parents 6db6eb7 + 5fed81c commit 9970911
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 7 deletions.
28 changes: 28 additions & 0 deletions api/tacticalrmm/ee/reporting/custom_filters.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from contextlib import suppress
from zoneinfo import ZoneInfo

import validators


def as_tz(date_obj, tz, format="%b %d, %I:%M %p"):
return date_obj.astimezone(ZoneInfo(tz)).strftime(format)


def local_ips(wmi_detail):
ret = []
with suppress(Exception):
ips = wmi_detail["network_config"]
for i in ips:
try:
addr = [x["IPAddress"] for x in i if "IPAddress" in x][0]
except:
continue

if addr is None:
continue

for ip in addr:
if validators.ipv4(ip):
ret.append(ip)

return ret
22 changes: 21 additions & 1 deletion api/tacticalrmm/ee/reporting/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,24 @@
For details, see: https://license.tacticalrmm.com/ee
"""

import datetime
import json
import re
from enum import Enum
from typing import Any, Dict, List, Literal, Optional, Tuple, Type, Union, cast
from zoneinfo import ZoneInfo

import yaml
from django.apps import apps
from jinja2 import Environment, FunctionLoader
from rest_framework.serializers import ValidationError
from tacticalrmm.utils import get_db_value
from weasyprint import CSS, HTML
from weasyprint.text.fonts import FontConfiguration

from tacticalrmm.utils import get_db_value

from .constants import REPORTING_MODELS
from .custom_filters import as_tz, local_ips
from .markdown.config import Markdown
from .models import ReportAsset, ReportDataQuery, ReportHTMLTemplate, ReportTemplate

Expand Down Expand Up @@ -57,9 +61,25 @@ def db_template_loader(template_name: str) -> Optional[str]:
loader=FunctionLoader(db_template_loader),
comment_start_string="{=",
comment_end_string="=}",
extensions=["jinja2.ext.do", "jinja2.ext.loopcontrols"],
)


custom_globals = {
"datetime": datetime,
"ZoneInfo": ZoneInfo,
"re": re,
}

custom_filters = {
"as_tz": as_tz,
"local_ips": local_ips,
}

env.globals.update(custom_globals)
env.filters.update(custom_filters)


def generate_pdf(*, html: str, css: str = "") -> bytes:
font_config = FontConfiguration()

Expand Down
4 changes: 2 additions & 2 deletions api/tacticalrmm/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ cffi==1.15.1
channels==4.0.0
channels_redis==4.1.0
cryptography==41.0.5
Django==4.2.6
Django==4.2.7
django-cors-headers==4.3.0
django-filter==23.3
django-ipware==5.0.0
Expand Down Expand Up @@ -41,7 +41,7 @@ zipp==3.17.0
pandas==2.1.2
kaleido==0.2.1
jinja2==3.1.2
markdown==3.5
markdown==3.5.1
plotly==5.18.0
weasyprint==60.1
ocxsect==0.1.5
6 changes: 3 additions & 3 deletions api/tacticalrmm/tacticalrmm/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
AUTH_USER_MODEL = "accounts.User"

# latest release
TRMM_VERSION = "0.17.0"
TRMM_VERSION = "0.17.1"

# https://github.com/amidaware/tacticalrmm-web
WEB_VERSION = "0.101.34"
WEB_VERSION = "0.101.35"

# bump this version everytime vue code is changed
# to alert user they need to manually refresh their browser
APP_VER = "0.0.186"
APP_VER = "0.0.187"

# https://github.com/amidaware/rmmagent
LATEST_AGENT_VER = "2.5.0"
Expand Down
2 changes: 1 addition & 1 deletion backup.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env bash

SCRIPT_VERSION="30"
SCRIPT_VERSION="31"

GREEN='\033[0;32m'
YELLOW='\033[1;33m'
Expand Down

0 comments on commit 9970911

Please sign in to comment.