mirror of https://github.com/jumpserver/jumpserver
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
942 B
55 lines
942 B
from django.views.generic import (
|
|
TemplateView, ListView
|
|
)
|
|
|
|
from django.urls import reverse_lazy
|
|
|
|
|
|
from django.views.generic.edit import (
|
|
CreateView, DeleteView, FormView, UpdateView
|
|
)
|
|
|
|
|
|
from django.views.generic.detail import (
|
|
DetailView
|
|
)
|
|
|
|
|
|
from .models import (
|
|
Asset, AssetGroup, IDC, AssetExtend
|
|
)
|
|
|
|
|
|
from .forms import (
|
|
AssetForm,
|
|
)
|
|
|
|
|
|
class AssetAddView(CreateView):
|
|
model = Asset
|
|
form_class = AssetForm
|
|
template_name = 'assets/asset_add.html'
|
|
success_url = reverse_lazy('assets:asset-list')
|
|
|
|
|
|
class AssetEdit():
|
|
pass
|
|
|
|
|
|
class AssetDeleteView(DeleteView):
|
|
model = Asset
|
|
success_url = reverse_lazy('assets:asset-list')
|
|
|
|
|
|
class AssetListView(ListView):
|
|
model = Asset
|
|
context_object_name = 'assets'
|
|
template_name = 'assets/asset_list.html'
|
|
|
|
|
|
class AssetDetailView(DetailView):
|
|
model = Asset
|
|
context_object_name = 'asset'
|
|
template_name = 'assets/asset_detail.html'
|
|
|