Compare commits

...

2 Commits

Author SHA1 Message Date
b35e208b85 Add rainmeter skin 2025-12-16 20:36:30 +05:30
bae6bf7a03 Add django-rest-knox 2025-12-16 20:19:55 +05:30
5 changed files with 230 additions and 0 deletions

View File

@@ -38,6 +38,7 @@ INSTALLED_APPS = [
"django.contrib.messages",
"django.contrib.staticfiles",
"rest_framework",
"knox",
"notes",
"livereload",
]
@@ -132,6 +133,15 @@ REST_FRAMEWORK = {
"DEFAULT_PERMISSION_CLASSES": [
"rest_framework.permissions.IsAuthenticated",
],
"DEFAULT_AUTHENTICATION_CLASSES": [
"knox.auth.TokenAuthentication",
"rest_framework.authentication.BasicAuthentication",
"rest_framework.authentication.SessionAuthentication",
],
}
REST_KNOX = {
"TOKEN_TTL": None,
}
LOGIN_URL = "login"

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

View File

@@ -6,6 +6,7 @@ readme = "README.md"
requires-python = ">=3.13"
dependencies = [
"django>=5.2.8",
"django-rest-knox>=5.0.2",
"djangorestframework>=3.16.1",
]

View File

@@ -0,0 +1,204 @@
[Rainmeter]
; update once an hour=60 * 60 * 1000 / 10 (from MeasureNotes.UpdateRate)
Update=360000
DynamicWindowSize=1
LeftMouseUpAction = [#AppuntiServer#]
[Metadata]
Name=Appunti Notes
Author=Ceda EI
Information=https://gitlab.com/ceda_ei/appunti
License=AGPL-3.0
[Variables]
AppuntiServer=
AuthToken=
[MeasureNotes]
Measure=WebParser
URL=#AppuntiServer#/api/notes/
Header="Authorization: Token #AuthToken#"
RegExp=(?siU)^(.*)$
; low updateRate (like 1 or 2) causes WebParser to spam the webserver
; regardless of the high Rainmeter.Update value. Setting it to 10 and
; Rainmeter.Update to 360000 makes one request every hour.
UpdateRate=10
FinishAction=[!Update][!Update]
[MeasureNote1]
Measure=Plugin
Plugin=JsonParser.dll
Source=[MeasureNotes]
Query="[0].note"
IFMatch="^$"
IFMatchAction=[!HideMeterGroup Note1][!ShowMeterGroup NoNotes]
IFNotMatchAction=[!ShowMeterGroup Note1][!HideMeterGroup NoNotes]
[MeasureNote1.From]
Measure=Plugin
Plugin=JsonParser.dll
Source=[MeasureNotes]
Query="[0].from_user.visible_name"
[MeasureNote1.Created]
Measure=Plugin
Plugin=JsonParser.dll
Source=[MeasureNotes]
Query="[0].created_at"
[MeasureNote2]
Measure=Plugin
Plugin=JsonParser.dll
Source=[MeasureNotes]
Query="[1].note"
IFMatch="^$"
IFMatchAction=[!HideMeterGroup Note2]
IFNotMatchAction=[!ShowMeterGroup Note2]
[MeasureNote2.From]
Measure=Plugin
Plugin=JsonParser.dll
Source=[MeasureNotes]
Query="[1].from_user.visible_name"
[MeasureNote2.Created]
Measure=Plugin
Plugin=JsonParser.dll
Source=[MeasureNotes]
Query="[1].created_at"
[MoreNotes]
Measure=Plugin
Plugin=JsonParser.dll
Source=[MeasureNotes]
Query="[2].note"
IFMatch="^$"
IFMatchAction=[!HideMeterGroup MoreNotes]
IFNotMatchAction=[!ShowMeterGroup MoreNotes]
[MeterNote1.Back]
Meter=Shape
Shape=Rectangle 0,0,340,([MeterNote1.Created:YH] + 20),10,10 | Fill Color 212,242,216,255 | StrokeWidth 4 | Stroke Color 30,30,30,102
AntiAlias=1
DynamicVariables=1
Group=Note1
[MeterNote1]
Meter=String
FontFace=Comic Sans MS
FontSize=12
X=20
Y=20
W = 300
MeasureName=MeasureNote1
ClipString=2
Text=%1
AntiAlias=1
Group=Note1
[MeterNote1.From]
Meter=String
FontFace=Comic Sans MS
FontSize=12
X=320
Y=5R
W = 300
MeasureName=MeasureNote1.From
ClipString=2
Text=By: %1
StringAlign=Right
Group=Note1
[MeterNote1.Created]
Meter=String
FontFace=Comic Sans MS
FontSize=12
X=320
Y=5R
W = 300
MeasureName=MeasureNote1.Created
ClipString=2
Text=At: %1
StringAlign=Right
Group=Note1
[MeterNote2.Back]
Meter=Shape
Shape=Rectangle 360,0,340,([MeterNote2.Created:YH] + 20),10,10 | Fill Color 250,201,220,255 | StrokeWidth 4 | Stroke Color 30,30,30,102
DynamicVariables=1
Group=Note2
[MeterNote2]
Meter=String
FontFace=Comic Sans MS
FontSize=12
X=380
Y=20
W = 300
MeasureName=MeasureNote2
ClipString=2
Text=%1
AntiAlias=1
Group=Note2
[MeterNote2.From]
Meter=String
FontFace=Comic Sans MS
FontSize=12
X=680
Y=5R
W = 300
MeasureName=MeasureNote2.From
ClipString=2
Text=By: %1
StringAlign=Right
Group=Note2
[MeterNote2.Created]
Meter=String
FontFace=Comic Sans MS
FontSize=12
X=680
Y=5R
W = 300
MeasureName=MeasureNote2.Created
ClipString=2
Text=At: %1
StringAlign=Right
Group=Note2
[MeterMoreNotes.Back]
Meter=Shape
Shape=Rectangle 720,0,340,([MeterMoreNotes:YH] + 20),10,10 | Fill Color 164,214,247,255 | StrokeWidth 4 | Stroke Color 30,30,30,102
AntiAlias=1
DynamicVariables=1
Group=MoreNotes
[MeterMoreNotes]
Meter=String
FontFace=Comic Sans MS
FontSize=12
X=740
Y=20
W = 300
Text=Click to View More Notes
AntiAlias=1
Group=MoreNotes
[MeterNoNotes.Back]
Meter=Shape
Shape=Rectangle 0,0,340,([MeterNoNotes:YH] + 20),10,10 | Fill Color 255,243,114,255 | StrokeWidth 4 | Stroke Color 30,30,30,102
AntiAlias=1
DynamicVariables=1
Group=NoNotes
[MeterNoNotes]
Meter=String
FontFace=Comic Sans MS
FontSize=12
X=20
Y=20
W = 300
Text=No Notes
AntiAlias=1
Group=NoNotes

15
uv.lock generated
View File

@@ -8,6 +8,7 @@ version = "0.1.0"
source = { virtual = "." }
dependencies = [
{ name = "django" },
{ name = "django-rest-knox" },
{ name = "djangorestframework" },
]
@@ -22,6 +23,7 @@ dev = [
[package.metadata]
requires-dist = [
{ name = "django", specifier = ">=5.2.8" },
{ name = "django-rest-knox", specifier = ">=5.0.2" },
{ name = "djangorestframework", specifier = ">=3.16.1" },
]
@@ -114,6 +116,19 @@ wheels = [
{ url = "https://files.pythonhosted.org/packages/8c/cd/77566526193cb49e805bd33a6b982ba5a39f3a7f828dd6647a76bf977f3c/django_livereload_server-0.5.1-py2.py3-none-any.whl", hash = "sha256:e03bd65d1679ef1b4a5e22e2a77d11d3cfb0e3d21ae25afba49e280924ba6f58", size = 25920, upload-time = "2023-12-19T23:22:00.494Z" },
]
[[package]]
name = "django-rest-knox"
version = "5.0.2"
source = { registry = "https://pypi.org/simple" }
dependencies = [
{ name = "django" },
{ name = "djangorestframework" },
]
sdist = { url = "https://files.pythonhosted.org/packages/ba/7e/6ef520fbfa0cb902fe32c6f921426b1dcfa50cb2471a0ddca31ba770fa72/django_rest_knox-5.0.2.tar.gz", hash = "sha256:f283622bcf5d28a6a0203845c065d06c7432efa54399ae32070c61ac03af2d6f", size = 16292, upload-time = "2024-09-30T21:21:07.606Z" }
wheels = [
{ url = "https://files.pythonhosted.org/packages/13/29/09468c086fd19f34b00a9698ee9cc1864dfae8c171be140657b965577472/django_rest_knox-5.0.2-py3-none-any.whl", hash = "sha256:694da5d0ad6eb3edbfd7cdc8d69c089fc074e6b0e548e00ff2750bf2fdfadb6f", size = 14960, upload-time = "2024-09-30T21:21:04.896Z" },
]
[[package]]
name = "django-stubs"
version = "5.2.8"