예제 #1
0
파일: views.py 프로젝트: binzyw/freenas
def network(request):

    tabs = appPool.hook_app_tabs('network', request)
    tabs = sorted(tabs, key=lambda y: y['order'] if 'order' in y else 0)
    return render(request, 'network/index.html', {
        'focus_form': request.GET.get('tab', 'network'),
        'hook_tabs': tabs,
    })
예제 #2
0
파일: views.py 프로젝트: xxz/freenas
def network(request):

    tabs = appPool.hook_app_tabs('network', request)
    tabs = sorted(tabs, key=lambda y: y['order'] if 'order' in y else 0)
    return render(request, 'network/index.html', {
        'focus_form': request.GET.get('tab', 'network'),
        'hook_tabs': tabs,
    })
예제 #3
0
파일: views.py 프로젝트: Blackwarg/freenas
def home(request):

    view = appPool.hook_app_index("storage", request)
    view = filter(None, view)
    if view:
        return view[0]

    tabs = appPool.hook_app_tabs("storage", request)
    return render(request, "storage/index.html", {"focused_tab": request.GET.get("tab", None), "hook_tabs": tabs})
예제 #4
0
파일: views.py 프로젝트: Arcko/freenas
def home(request):

    view = appPool.hook_app_index('storage', request)
    view = filter(None, view)
    if view:
        return view[0]

    tabs = appPool.hook_app_tabs('storage', request)
    return render(request, 'storage/index.html', {
        'focused_tab': request.GET.get("tab", 'storage.Volumes.View'),
        'hook_tabs': tabs,
    })
예제 #5
0
def home(request):

    view = appPool.hook_app_index('tasks', request)
    view = [_f for _f in view if _f]
    if view:
        return view[0]

    tabs = appPool.hook_app_tabs('tasks', request)
    return render(request, 'tasks/index.html', {
        'focused_tab': request.GET.get('tab', 'tasks.CronJob'),
        'hook_tabs': tabs,
    })
예제 #6
0
def home(request):

    view = appPool.hook_app_index('storage', request)
    view = filter(None, view)
    if view:
        return view[0]

    tabs = appPool.hook_app_tabs('storage', request)
    return render(request, 'storage/index.html', {
        'focused_tab': request.GET.get("tab", 'storage.Volumes.View'),
        'hook_tabs': tabs,
    })
예제 #7
0
def home(request):

    view = appPool.hook_app_index('tasks', request)
    view = filter(None, view)
    if view:
        return view[0]

    tabs = appPool.hook_app_tabs('tasks', request)
    return render(request, 'tasks/index.html', {
        'focused_tab': request.GET.get('tab', 'tasks.CronJob'),
        'hook_tabs': tabs,
    })
예제 #8
0
파일: views.py 프로젝트: Paccc/freenas
def network(request):

    try:
        globalconf = models.GlobalConfiguration.objects.order_by("-id")[0].id
    except IndexError:
        globalconf = models.GlobalConfiguration.objects.create().id

    tabs = appPool.hook_app_tabs('network', request)
    return render(request, 'network/index.html', {
        'focus_form': request.GET.get('tab', 'network'),
        'globalconf': globalconf,
        'hook_tabs': tabs,
    })
예제 #9
0
파일: views.py 프로젝트: noprobs/freenas
def network(request):

    try:
        globalconf = models.GlobalConfiguration.objects.order_by("-id")[0].id
    except IndexError:
        globalconf = models.GlobalConfiguration.objects.create().id

    tabs = appPool.hook_app_tabs('network', request)
    return render(request, 'network/index.html', {
        'focus_form': request.GET.get('tab', 'network'),
        'globalconf': globalconf,
        'hook_tabs': tabs,
    })
예제 #10
0
파일: views.py 프로젝트: scottman85/freenas
def home(request):

    if not utils.vm_enabled():
        return render(request, 'vm/disabled.html')

    view = appPool.hook_app_index('vm', request)
    view = list(filter(None, view))
    if view:
        return view[0]

    tabs = appPool.hook_app_tabs('vm', request)
    return render(request, 'vm/index.html', {
        'focused_tab': request.GET.get('tab', 'vm.VM'),
        'hook_tabs': tabs,
    })
예제 #11
0
파일: views.py 프로젝트: binzyw/freenas
def home(request):

    if not utils.vm_enabled():
        return render(request, 'vm/disabled.html')

    view = appPool.hook_app_index('vm', request)
    view = list(filter(None, view))
    if view:
        return view[0]

    tabs = appPool.hook_app_tabs('vm', request)
    return render(request, 'vm/index.html', {
        'focused_tab': request.GET.get('tab', 'vm.VM'),
        'hook_tabs': tabs,
    })
예제 #12
0
파일: views.py 프로젝트: razzfazz/freenas
def home(request):

    view = appPool.hook_app_index('storage', request)
    view = [_f for _f in view if _f]
    if view:
        return view[0]

    try:
        resilver = models.Resilver.objects.order_by('-id')[0]
    except Exception:
        resilver = models.Resilver.objects.create()

    tabs = appPool.hook_app_tabs('storage', request)
    return render(request, 'storage/index.html', {
        'focused_tab': request.GET.get("tab", 'storage.Volumes.View'),
        'hook_tabs': tabs,
        'resilver_edit_url': f'{resilver.get_edit_url()}?inline=true'
    })
예제 #13
0
def home(request):

    view = appPool.hook_app_index('storage', request)
    view = [_f for _f in view if _f]
    if view:
        return view[0]

    try:
        resilver = models.Resilver.objects.order_by('-id')[0]
    except Exception:
        resilver = models.Resilver.objects.create()

    tabs = appPool.hook_app_tabs('storage', request)
    return render(request, 'storage/index.html', {
        'focused_tab': request.GET.get("tab", 'storage.Volumes.View'),
        'hook_tabs': tabs,
        'resilver_edit_url': f'{resilver.get_edit_url()}?inline=true'
    })
예제 #14
0
def network(request):

    tabs = appPool.hook_app_tabs("network", request)
    tabs = sorted(tabs, key=lambda y: y["order"] if "order" in y else 0)
    return render(request, "network/index.html", {"focus_form": request.GET.get("tab", "network"), "hook_tabs": tabs})