mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-23 15:24:21 +00:00
Stefano Pigozzi
4a4824395a
* ✨ Start notebooks app * 🔧 Fix nullable fields for notebooks * 🔧 Display user-friendly name for `Notebook`s * 🔧 Allow filtering in the notebook admin page * 🗒 Improve README * 🗒 Improve README again * ⬆ Add bluelib to the dependencies of the frontend * 🧹 Prepare a good frontend base for development * ✨ Port and improve useStorageState Original: https://github.com/pds-nest/nest/blob/main/nest_frontend/hooks/useLocalStorageState.js * 🧹 Remove React logo * ⬆ Add `docker` to the dependencies * ⬆ Add `axios` to the dependencies * 🔨 Mark `src` as sources root * ✨ Add API routes to view Notebooks * 🔧 Use a router for the `by-project` route * 🐛 Fix deletion failing on `SophonViewSet` * 🔧 Abstract notebook methods * ✨ Create a base docker client * 🚧 Proof of concept for notebook starter * 📔 Document the contents of the Django apps * 🚧 Incomplete container implementation * 🚧 Working container implementation * 💥 Leftovers from an experiment * ✨ Correct implementation of the proxy configuration (Apache config file is still missing) * 💥 Improve code * 💥 Improve more things * 🔧 Remove duplicated `/project` in project app urls * ✨ Add basic Apache proxy config file * 🔧 User should have sudo access on the notebook * ✨ Implement the Internet access field (currently ignored) * 🧹 Cleanup code
61 lines
1.1 KiB
Python
61 lines
1.1 KiB
Python
from django.contrib import admin
|
|
|
|
from sophon.core.admin import SophonAdmin
|
|
from . import models
|
|
|
|
|
|
@admin.register(models.Notebook)
|
|
class NotebookAdmin(SophonAdmin):
|
|
list_display = (
|
|
"slug",
|
|
"name",
|
|
"project",
|
|
"locked_by",
|
|
"container_image",
|
|
"container_id",
|
|
"port",
|
|
)
|
|
|
|
list_filter = (
|
|
"container_image",
|
|
)
|
|
|
|
ordering = (
|
|
"slug",
|
|
)
|
|
|
|
fieldsets = (
|
|
(
|
|
None, {
|
|
"fields": (
|
|
"slug",
|
|
"name",
|
|
"project",
|
|
"locked_by",
|
|
),
|
|
},
|
|
),
|
|
(
|
|
"Docker", {
|
|
"fields": (
|
|
"container_image",
|
|
"container_id",
|
|
"internet_access",
|
|
),
|
|
},
|
|
),
|
|
(
|
|
"Proxy", {
|
|
"fields": (
|
|
"port",
|
|
),
|
|
},
|
|
),
|
|
(
|
|
"Jupyter", {
|
|
"fields": (
|
|
"jupyter_token",
|
|
),
|
|
},
|
|
),
|
|
)
|