Skip to content

Commit bdfb9f6

Browse files
committed
refactor: more naming changes
1 parent 4a8feae commit bdfb9f6

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

plugins/goosebit_simple_stats/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
# gooseBit Plugin Example
1+
# gooseBit Simple Stats Plugin
22

33
A simple example plugin for testing and understanding gooseBit's plugin system.
44

5-
This example plugin sets up a page which shows software count and/or device count.
5+
This plugin sets up a page which shows software count and/or device count.
66

77
## Setup
88

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from pydantic import BaseModel
22

33

4-
class ExampleResponse(BaseModel):
4+
class SimpleStatsResponse(BaseModel):
55
software_count: int | None = None
66
device_count: int | None = None

plugins/goosebit_simple_stats/goosebit_simple_stats/api/v1/stats/routes.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from goosebit.auth import validate_user_permissions
99
from goosebit.db.models import Device, Software
1010

11-
from .responses import ExampleResponse
11+
from .responses import SimpleStatsResponse
1212

1313
router = APIRouter(prefix="/stats", tags=["stats"])
1414

@@ -17,11 +17,11 @@
1717
"",
1818
dependencies=[Security(validate_user_permissions, scopes=["stats.read"])],
1919
)
20-
async def stats_get(_: Request) -> ExampleResponse:
20+
async def stats_get(_: Request) -> SimpleStatsResponse:
2121
data = {}
2222
if SimpleStatsShow.DEVICE_COUNT in config.simple_stats_show:
2323
data["device_count"] = await Device.all().count()
2424
if SimpleStatsShow.SOFTWARE_COUNT in config.simple_stats_show:
2525
data["software_count"] = await Software.all().count()
2626

27-
return ExampleResponse(**data)
27+
return SimpleStatsResponse(**data)

plugins/goosebit_simple_stats/goosebit_simple_stats/ui/routes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@
2121
)
2222
@nav.route("Stats", permissions=["stats.read"])
2323
async def stats_ui(request: Request):
24-
return templates.TemplateResponse(request, "stats.html.jinja", context={"title": "Example"})
24+
return templates.TemplateResponse(request, "stats.html.jinja", context={"title": "Simple Stats"})

plugins/goosebit_simple_stats/goosebit_simple_stats/ui/templates/stats.html.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{% extends "nav.html.jinja" %}
22
{% block content %}
33
<div class="container-fluid">
4-
<div class="row p-2 d-flex justify-content-center" id="example-cards">
4+
<div class="row p-2 d-flex justify-content-center" id="stats-cards">
55
<div class="col-6" id="device-count-card" hidden>
66
<div class="card">
77
<div class="card-header">

poetry.lock

Lines changed: 6 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)