Cleanup views

This commit is contained in:
Nico Schottelius 2021-05-25 19:55:33 +02:00
parent 745abc48ef
commit 485f08e25c
2 changed files with 9 additions and 29 deletions

View file

@ -25,35 +25,6 @@ router = routers.DefaultRouter()
# Beta endpoints
router.register(r'beta/vm', vmviews.NicoVMProductViewSet, basename='nicovmproduct')
# VM
# router.register(r'v1/vm/snapshot', vmviews.VMSnapshotProductViewSet, basename='vmsnapshotproduct')
# router.register(r'v1/vm/diskimage', vmviews.VMDiskImageProductViewSet, basename='vmdiskimageproduct')
# router.register(r'v1/vm/disk', vmviews.VMDiskProductViewSet, basename='vmdiskproduct')
# router.register(r'v1/vm/vm', vmviews.VMProductViewSet, basename='vmproduct')
# Services
# router.register(r'v1/service/matrix', serviceviews.MatrixServiceProductViewSet, basename='matrixserviceproduct')
# router.register(r'v1/service/generic', serviceviews.GenericServiceProductViewSet, basename='genericserviceproduct')
# Pay
# router.register(r'v1/my/bill', payviews.BillViewSet, basename='bill')
# router.register(r'v1/my/order', payviews.OrderViewSet, basename='order')
# router.register(r'v1/my/payment-method', payviews.PaymentMethodViewSet, basename='payment-method')
# admin/staff urls
# router.register(r'v1/admin/bill', payviews.AdminBillViewSet, basename='admin/bill')
# router.register(r'v1/admin/order', payviews.AdminOrderViewSet, basename='admin/order')
# router.register(r'v1/admin/vmhost', vmviews.VMHostViewSet)
# router.register(r'v1/admin/vmcluster', vmviews.VMClusterViewSet)
# User/Account
# router.register(r'v1/my/user', authviews.UserViewSet, basename='user')
# router.register(r'v1/admin/user', authviews.AdminUserViewSet, basename='useradmin')
# router.register(r'v1/user/register', authviews.AccountManagementViewSet, basename='user/register')
################################################################################
# v2

View file

@ -1,4 +1,13 @@
from django.views.generic.base import TemplateView
from uncloud_pay.selectors import get_balance_for_user
class UncloudIndex(TemplateView):
template_name = "uncloud/index.html"
def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
print(context)
if self.request.user.is_authenticated:
context['balance'] = get_balance_for_user(self.request.user)
return context