示例#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
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
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})