예제 #1
0
파일: network.py 프로젝트: cc1-cloud/cc1
from django.conf.urls import url, patterns, include
from django.utils.translation import ugettext_lazy as _, ungettext

from wi.forms.network import AddPoolForm
from wi.forms.public_ip import AddPublicIPForm
from wi.forms.vm import MonitoringVMForm
from wi.utils.decorators import admin_cm_permission
from wi.utils.views import form_generic_id, direct_to_template, \
    simple_generic_id, form_generic, get_list_generic, generic_multiple_id


network_patterns = patterns('wi.views.admin_cm.network',
    url(r'^networks/$', 'cma_networks', name='cma_networks'),
    url(r'^ajax/cm/networks_get_table/(?P<user_id>\d+)/$', 'cma_networks_ajax_get_table', name='cma_networks_ajax_get_table'),
    url(r'^ajax/cm/network_details/(?P<network_id>\d+)/$', 'cma_networks_ajax_network_details', name='cma_networks_ajax_network_details'),
    url(r'^ajax/remove_network/(?P<id1>\d+)/$', admin_cm_permission(simple_generic_id),
        {'template_name':   'generic/simple.html',
         'success_msg':     (lambda desc: _('You have successfully released network <b>%(desc)s</b>.') % {'desc': desc}),
         'ask_msg':         (lambda desc: _('Do you want to release network <b>%(desc)s</b>?') % {'desc': desc}),
         'request_url':     'admin_cm/network/delete_user_network/',
         'id_key':          'network_id', },
        name='cma_ajax_remove_network'),

    url(r'^pools/$', admin_cm_permission(direct_to_template), {'template_name': 'admin_cm/pools.html'}, name='cma_pools'),
    url(r'^ajax/pools_table/$', 'cma_ajax_get_pool_table',
        name='cma_ajax_get_pool_table'),
    url(r'^ajax/add_pool/$', admin_cm_permission(form_generic),
        {'template_name':       'generic/form.html',
         'success_msg':         (lambda desc, data: _('You have successfully added a pool.') % {'desc': desc}),
         'confirmation':        _('Add'),
         'request_url_post':    'admin_cm/network/add/',
예제 #2
0
파일: user.py 프로젝트: cc1-cloud/cc1
@author Krzysztof Danielowski, Piotr Wojcik
@date 17.03.2011
"""

from django.conf.urls import url, patterns, include
from django.utils.translation import ugettext_lazy as _

from wi.forms.user import ChangeQuotaForm
from wi.utils.decorators import admin_cm_permission
from wi.utils.forms import PasswordForm
from wi.utils.views import form_generic_id, direct_to_template, simple_generic_id


user_patterns = patterns('wi.views.admin_cm.user',
    url(r'^users/$', admin_cm_permission(direct_to_template), {'template_name': 'admin_cm/users.html'}, name='cma_users'),
    url(r'^user_account/(?P<user_id>\d+)/$', 'cma_user_account', name='cma_user_account'),
    url(r'^ajax/get_user_data/(?P<user_id>\d+)/$', 'cma_ajax_get_user_data', name='cma_ajax_get_user_data'),
    url(r'^ajax/get_table_users/$', 'cma_ajax_get_table_users', name='cma_ajax_get_table_users'),
    url(r'^ajax/edit_quota/(?P<id1>\d+)/$', admin_cm_permission(form_generic_id),
        {'template_name':       'generic/form.html',
         'success_msg':         (lambda desc, data: _('You have successfully changed the user\'s quota.') % {'desc': desc}),
         'confirmation':        _('Save'),
         'form_class':          ChangeQuotaForm,
         'request_url_post':    'admin_cm/user/change_quota/',
         'request_url_get':     'admin_cm/user/get_quota/',
         'id_key':              'user_id'},
        name='cma_ajax_edit_quota'),
    url(r'^ajax/set_admin/(?P<id1>\d+)/$', admin_cm_permission(form_generic_id),
        {'template_name':       'generic/form.html',
         'success_msg':         (lambda desc, data: _('You have successfully promoted user <b>%(desc)s</b> to CM administrator.') % {'desc': desc}),
예제 #3
0
@author Krzysztof Danielowski, Piotr Wojcik
@date 17.03.2011
"""

from django.conf.urls import url, patterns, include
from django.utils.translation import ugettext_lazy as _

from wi.forms.template import TemplateForm
from wi.utils.decorators import admin_cm_permission
from wi.utils.views import form_generic_id, direct_to_template, simple_generic_id, form_generic

template_patterns = patterns(
    'wi.views.admin_cm.template',
    url(r'^templates/$',
        admin_cm_permission(direct_to_template),
        {'template_name': 'admin_cm/templates.html'},
        name='cma_templates'),
    url(r'^ajax/get_table_templates/$',
        'cma_ajax_get_table_templates',
        name='cma_ajax_get_table_templates'),
    url(r'^ajax/delete_template/(?P<id1>\d+)/$',
        admin_cm_permission(simple_generic_id), {
            'template_name':
            'generic/simple.html',
            'success_msg': (lambda desc: _(
                'You have successfully deleted template <b>%(desc)s</b>.') % {
                    'desc': desc
                }),
            'ask_msg': (lambda desc: _(
                'Do you want to delete template <b>%(desc)s</b>?') % {
예제 #4
0
파일: storage.py 프로젝트: cc1-cloud/cc1
"""@package src.wi.urls.admin_cm.storage

@author Krzysztof Danielowski, Piotr Wojcik
@date 17.03.2011
"""

from django.conf.urls import url, patterns, include
from django.utils.translation import ugettext_lazy as _

from wi.forms.storage import StorageForm
from wi.utils.decorators import admin_cm_permission
from wi.utils.views import direct_to_template, simple_generic_id, form_generic


storage_patterns = patterns('wi.views.admin_cm.storage',
    url(r'^storages/$', admin_cm_permission(direct_to_template), {'template_name': 'admin_cm/storages.html'}, name='cma_storages'),
    url(r'^ajax/get_table_storages/$', 'cma_ajax_get_table_storages', name='cma_ajax_get_table_storages'),
    url(r'^ajax/add_storage/$', admin_cm_permission(form_generic),
        {'template_name':       'generic/form.html',
         'success_msg':         (lambda desc, data: _('You have successfully created a storage.') % {'desc': desc}),
         'confirmation':        _('Create'),
         'request_url_post':    'admin_cm/storage/create/',
         'form_class':          StorageForm},
        name='cma_ajax_add_storage'),
    url(r'^ajax/lock_storage/(?P<id1>\d+)/$', admin_cm_permission(simple_generic_id),
        {'template_name':   'generic/simple.html',
         'success_msg':     (lambda desc: _('You have successfully locked storage <b>%(desc)s</b>.') % {'desc': desc}),
         'ask_msg':         (lambda desc: _('Do you want to lock storage <b>%(desc)s</b>?') % {'desc': desc}),
         'request_url':     'admin_cm/storage/lock/',
         'id_key':          'storage_id', },
        name='cma_ajax_lock_storage'),
예제 #5
0
"""@package src.wi.urls.admin_cm.storage_image

@author Krzysztof Danielowski, Piotr Wojcik
@date 17.03.2011
"""

from django.conf.urls import url, patterns, include
from django.utils.translation import ugettext_lazy as _

from wi.forms.storage_image import EditDiskForm
from wi.utils.decorators import admin_cm_permission
from wi.utils.views import form_generic_id, simple_generic_id, direct_to_template


disk_patterns = patterns('wi.views.admin_cm.storage_image',
    url(r'^disks/$', admin_cm_permission(direct_to_template), {'template_name': 'admin_cm/disks.html'}, name='cma_disks'),
    url(r'^ajax/get_table_disks/$', 'cma_ajax_get_table_disks', name='cma_ajax_get_table_disks'),
    url(r'^ajax/edit_disk/(?P<id1>\d+)/$', admin_cm_permission(form_generic_id),
        {'template_name':       'generic/form.html',
         'success_msg':         (lambda desc, data: _('You have successfully edited selected disk.') % {'desc': desc}),
         'confirmation':        _('Save'),
         'request_url_both':    {'disk_controllers': 'user/storage_image/get_disk_controllers/'},
         'request_url_post':    'admin_cm/storage_image/edit/',
         'request_url_get':     'admin_cm/storage_image/get_by_id/',
         'id_key':              'storage_image_id',
         'form_class':          EditDiskForm,
         },
        name='cma_ajax_edit_disk'),
    url(r'^ajax/delete_disk/(?P<id1>\d+)/$', admin_cm_permission(simple_generic_id),
        {'template_name':   'generic/simple.html',
         'success_msg':     (lambda desc: _('You have successfully deleted disk volume <b>%(desc)s</b>.') % {'desc': desc}),
예제 #6
0
파일: template.py 프로젝트: cc1-cloud/cc1
"""@package src.wi.urls.admin_cm.template

@author Krzysztof Danielowski, Piotr Wojcik
@date 17.03.2011
"""

from django.conf.urls import url, patterns, include
from django.utils.translation import ugettext_lazy as _

from wi.forms.template import TemplateForm
from wi.utils.decorators import admin_cm_permission
from wi.utils.views import form_generic_id, direct_to_template, simple_generic_id, form_generic


template_patterns = patterns('wi.views.admin_cm.template',
    url(r'^templates/$', admin_cm_permission(direct_to_template), {'template_name': 'admin_cm/templates.html'}, name='cma_templates'),
    url(r'^ajax/get_table_templates/$', 'cma_ajax_get_table_templates', name='cma_ajax_get_table_templates'),
    url(r'^ajax/delete_template/(?P<id1>\d+)/$', admin_cm_permission(simple_generic_id),
        {'template_name':   'generic/simple.html',
         'success_msg':     (lambda desc: _('You have successfully deleted template <b>%(desc)s</b>.') % {'desc': desc}),
         'ask_msg':         (lambda desc: _('Do you want to delete template <b>%(desc)s</b>?') % {'desc': desc}),
         'request_url':     'admin_cm/template/delete/',
         'id_key':          'template_id', },
        name='cma_ajax_delete_template'),
    url(r'^ajax/add_template/$', admin_cm_permission(form_generic),
        {'template_name':       'generic/form.html',
         'success_msg':         (lambda desc, data: _('You have successfully created a template.') % {'desc': desc}),
         'confirmation':        _('Create'),
         'request_url_post':     'admin_cm/template/add/',
         'form_class':           TemplateForm},
        name='cma_ajax_add_template'),
예제 #7
0
파일: node.py 프로젝트: cc1-cloud/cc1
@date 17.03.2011
"""

from django.conf.urls import url, patterns, include
from django.utils.translation import ungettext, ugettext_lazy as _

from common.states import image_access
from wi.forms.node import NodeForm, EditNodeForm
from wi.forms.vm import CreateVMOnNodeForm
from wi.utils.decorators import admin_cm_permission
from wi.utils.views import generic_multiple_id, form_generic_id, \
    direct_to_template, simple_generic_id, form_generic


node_patterns = patterns('wi.views.admin_cm.node',
    url(r'^nodes/$', admin_cm_permission(direct_to_template), {'template_name': 'admin_cm/nodes.html'}, name='cma_nodes'),
    url(r'^ajax/get_table_nodes/$', 'cma_ajax_get_table_nodes', name='cma_ajax_get_table_nodes'),
    url(r'^ajax/node_details/(?P<node_id>\d+)/$', 'cma_ajax_node_details', name='cma_ajax_node_details'),
    url(r'^ajax/delete_node/(?P<id1>\d+)/$', admin_cm_permission(simple_generic_id),
        {'template_name':   'generic/simple.html',
         'success_msg':     (lambda desc: _('You have successfully deleted node <b>%(desc)s</b>.') % {'desc': desc}),
         'ask_msg':         (lambda desc: _('Do you want to delete node <b>%(desc)s</b>?') % {'desc': desc}),
         'request_url':     'admin_cm/node/delete/',
         'id_key':          'node_id', },
        name='cma_ajax_delete_node'),

    url(r'^ajax/cm/lock_node/$', admin_cm_permission(generic_multiple_id),
        {'template_name':       'generic/simple.html',
         'success_msg':         (lambda desc, count: ungettext('You have successfully locked node <b>%(desc)s</b>.', 'You have successfully locked %(count)d nodes (<b>%(desc)s</b>).', count) % {'desc': desc, 'count': count}),
         'ask_msg':             (lambda desc, count: ungettext('Do you want to lock node <b>%(desc)s</b>?', 'Do you want to lock %(count)d nodes <b>%(desc)s</b>?', count) % {'desc': desc, 'count': count}),
         'request_url':         'admin_cm/node/lock/',
예제 #8
0
"""@package src.wi.urls.admin_cm.iso_image

@author Krzysztof Danielowski, Piotr Wojcik
@date 17.03.2011
"""

from django.conf.urls import url, patterns, include
from django.utils.translation import ugettext_lazy as _

from wi.forms.iso_image import EditISOForm
from wi.utils.decorators import admin_cm_permission
from wi.utils.views import form_generic_id, simple_generic_id, direct_to_template


iso_patterns = patterns('wi.views.admin_cm.iso_image',
    url(r'^iso/$', admin_cm_permission(direct_to_template), {'template_name': 'admin_cm/iso.html'}, name='cma_iso'),
    url(r'^ajax/get_table_iso/$', 'cma_ajax_get_table_iso', name='cma_ajax_get_table_iso'),
    url(r'^ajax/edit_iso/(?P<id1>\d+)/$', admin_cm_permission(form_generic_id),
        {'template_name':       'generic/form.html',
         'success_msg':         (lambda desc, data: _('You have successfully edited selected ISO image.') % {'desc': desc}),
         'confirmation':        _('Save'),
         'request_url_both':    {'disk_controllers': 'user/iso_image/get_disk_controllers/'},
         'request_url_post':    'admin_cm/iso_image/edit/',
         'request_url_get':     'admin_cm/iso_image/get_by_id/',
         'id_key':              'iso_image_id',
         'form_class':          EditISOForm,
         },
        name='cma_ajax_edit_iso'),
    url(r'^ajax/delete_iso/(?P<id1>\d+)/$', admin_cm_permission(simple_generic_id),
        {'template_name':   'generic/simple.html',
         'success_msg':     (lambda desc: _('You have successfully deleted ISO image <b>%(desc)s</b>.') % {'desc': desc}),
예제 #9
0
from wi.forms.vm import MonitoringVMForm
from wi.utils.decorators import admin_cm_permission
from wi.utils.views import form_generic_id, direct_to_template, \
    simple_generic_id, form_generic, get_list_generic, generic_multiple_id

network_patterns = patterns(
    'wi.views.admin_cm.network',
    url(r'^networks/$', 'cma_networks', name='cma_networks'),
    url(r'^ajax/cm/networks_get_table/(?P<user_id>\d+)/$',
        'cma_networks_ajax_get_table',
        name='cma_networks_ajax_get_table'),
    url(r'^ajax/cm/network_details/(?P<network_id>\d+)/$',
        'cma_networks_ajax_network_details',
        name='cma_networks_ajax_network_details'),
    url(r'^ajax/remove_network/(?P<id1>\d+)/$',
        admin_cm_permission(simple_generic_id), {
            'template_name':
            'generic/simple.html',
            'success_msg': (lambda desc: _(
                'You have successfully released network <b>%(desc)s</b>.') % {
                    'desc': desc
                }),
            'ask_msg': (lambda desc: _(
                'Do you want to release network <b>%(desc)s</b>?') % {
                    'desc': desc
                }),
            'request_url':
            'admin_cm/network/delete_user_network/',
            'id_key':
            'network_id',
        },
예제 #10
0
"""@package src.wi.urls.admin_cm.system_image

@author Krzysztof Danielowski, Piotr Wojcik
@date 17.03.2011
"""

from django.conf.urls import url, patterns, include
from django.utils.translation import ungettext, ugettext_lazy as _

from wi.forms.system_image import EditImageForm
from wi.utils.decorators import admin_cm_permission
from wi.utils.views import generic_multiple_id, form_generic_id, simple_generic_id, direct_to_template


image_patterns = patterns('wi.views.admin_cm.system_image',
    url(r'^images/$', admin_cm_permission(direct_to_template), {'template_name': 'admin_cm/images.html'}, name='cma_images'),
    url(r'^ajax/get_table_images/$', 'cma_ajax_get_table_images', name='cma_ajax_get_table_images'),
    url(r'^ajax/add_image/$', 'cma_ajax_add_image', name='cma_ajax_add_image'),
    url(r'^ajax/edit_image/(?P<id1>\d+)/$', admin_cm_permission(form_generic_id),
        {'template_name':       'generic/form.html',
         'success_msg':         (lambda desc, data: _('You have successfully edited selected image.') % {'desc': desc}),
         'confirmation':        _('Save'),
         'form_class':          EditImageForm,
         'request_url_post':    'admin_cm/system_image/edit/',
         'request_url_get':     'admin_cm/system_image/get_by_id/',
         'id_key':              'system_image_id',
         'request_url_both': {'disk_controllers': 'user/system_image/get_disk_controllers/',
                              'video_devices':  'user/system_image/get_video_devices/',
                              'network_devices': 'user/system_image/get_network_devices/'}
        },
        name='cma_ajax_edit_image'),
예제 #11
0
from wi.forms.vm import EditVMForm
from wi.utils.decorators import admin_cm_permission
from wi.utils.views import generic_multiple_id, simple_generic_id, form_generic_id

vm_patterns = patterns(
    'wi.views.admin_cm.vm',
    url(r'^vms/$', 'cma_vms', name='cma_vms'),
    url(r'^ajax/cm/vms_get_table/(?P<user_id>\d+)/$',
        'cma_vms_ajax_get_table',
        name='cma_vms_ajax_get_table'),
    url(r'^ajax/cm/vm_details/(?P<vm_id>\d+)/$',
        'cma_vms_ajax_vm_details',
        name='cma_vms_ajax_vm_details'),
    url(r'^ajax/cm/vm_destroy/$',
        admin_cm_permission(generic_multiple_id), {
            'template_name':
            'generic/simple.html',
            'success_msg': (lambda desc, count: ungettext(
                'You have successfully destroyed virtual machine <b>%(desc)s</b>.',
                'You have successfully destroyed %(count)d virtual machines (<b>%(desc)s</b>).',
                count) % {
                    'desc': desc,
                    'count': count
                }),
            'ask_msg': (lambda desc, count: ungettext(
                'Do you want to destroy virtual machine <b>%(desc)s</b>?',
                'Do you want to destroy %(count)d virtual machines <b>%(desc)s</b>?',
                count) % {
                    'desc': desc,
                    'count': count
예제 #12
0
파일: vm.py 프로젝트: cloudcache/cc1
"""

from django.conf.urls import url, patterns, include
from django.utils.translation import ungettext, ugettext_lazy as _

from wi.forms.vm import EditVMForm
from wi.utils.decorators import admin_cm_permission
from wi.utils.views import generic_multiple_id, simple_generic_id, \
    form_generic_id


vm_patterns = patterns('wi.views.admin_cm.vm',
    url(r'^vms/$', 'cma_vms', name='cma_vms'),
    url(r'^ajax/cm/vms_get_table/(?P<user_id>\d+)/$', 'cma_vms_ajax_get_table', name='cma_vms_ajax_get_table'),
    url(r'^ajax/cm/vm_details/(?P<vm_id>\d+)/$', 'cma_vms_ajax_vm_details', name='cma_vms_ajax_vm_details'),
    url(r'^ajax/cm/vm_destroy/$', admin_cm_permission(generic_multiple_id),
        {'template_name':       'generic/simple.html',
         'success_msg':         (lambda desc, count: ungettext('You have successfully destroyed virtual machine <b>%(desc)s</b>.', 'You have successfully destroyed %(count)d virtual machines (<b>%(desc)s</b>).', count) % {'desc': desc, 'count': count}),
         'ask_msg':             (lambda desc, count: ungettext('Do you want to destroy virtual machine <b>%(desc)s</b>?', 'Do you want to destroy %(count)d virtual machines <b>%(desc)s</b>?', count) % {'desc': desc, 'count': count}),
         'request_url':         'admin_cm/vm/destroy/',
         'id_key':              'vm_id_list'
         },
        name='cma_vms_ajax_destroy'),
    url(r'^ajax/cm/vm_erase/$', admin_cm_permission(generic_multiple_id),
        {'template_name':       'generic/simple.html',
         'success_msg':         (lambda desc, count: ungettext('You have successfully erased virtual machine <b>%(desc)s</b>.', 'You have successfully erased %(count)d virtuals machines (<b>%(desc)s</b>).', count) % {'desc': desc, 'count': count}),
         'ask_msg':             (lambda desc, count: ungettext('Do you want to erase virtual machine <b>%(desc)s</b>?', 'Do you want to erase %(count)d virtual machines <b>%(desc)s</b>?', count) % {'desc': desc, 'count': count}),
         'request_url':         'admin_cm/vm/erase/',
         'id_key':              'vm_id_list'
         },
        name='cma_vms_ajax_erase'),
예제 #13
0
@date 17.03.2011
"""

from django.conf.urls import url, patterns, include
from django.utils.translation import ungettext, ugettext_lazy as _

from wi.forms.vm import EditVMForm
from wi.utils.decorators import admin_cm_permission
from wi.utils.views import generic_multiple_id, form_generic_id


farm_patterns = patterns('wi.views.admin_cm.farm',
    url(r'^farms/$', 'cma_farms', name='cma_farms'),
    url(r'^ajax/cm/farms_get_table/(?P<user_id>\d+)/$', 'cma_farms_ajax_get_table', name='cma_farms_ajax_get_table'),
    url(r'^ajax/cm/farm_details/(?P<id1>\d+)/$', 'cma_farms_ajax_details', name='cma_farms_ajax_details'),
    url(r'^ajax/cm/farm_destroy/$', admin_cm_permission(generic_multiple_id),
        {'template_name':       'generic/simple.html',
         'success_msg':         (lambda desc, count: ungettext('You have successfully destroyed farm <b>%(desc)s</b>.', 'You have successfully destroyed %(count)d farms (<b>%(desc)s</b>).', count) % {'desc': desc, 'count': count}),
         'ask_msg':             (lambda desc, count: ungettext('Do you want to destroy farm <b>%(desc)s</b>?', 'Do you want to destroy %(count)d farms <b>%(desc)s</b>?', count) % {'desc': desc, 'count': count}),
         'request_url':         'admin_cm/farm/destroy/',
         'id_key':              'farm_ids', },
        name='cma_farms_ajax_destroy'),
    url(r'^ajax/cm/farm_erase/$', admin_cm_permission(generic_multiple_id),
        {'template_name':       'generic/simple.html',
         'success_msg':         (lambda desc, count: ungettext('You have successfully erased farm <b>%(desc)s</b>.', 'You have successfully erased %(count)d farms (<b>%(desc)s</b>).', count) % {'desc': desc, 'count': count}),
         'ask_msg':             (lambda desc, count: ungettext('Do you want to erase farm <b>%(desc)s</b>?', 'Do you want to erase %(count)d farms <b>%(desc)s</b>?', count) % {'desc': desc, 'count': count}),
         'request_url':         'admin_cm/farm/erase/',
         'id_key':              'farm_ids', },
        name='cma_farms_ajax_erase'),
    url(r'^ajax/cm/save_and_shutdown_farm/(?P<id1>\d+)/$', admin_cm_permission(form_generic_id),
        {'template_name':        'generic/form.html',
예제 #14
0
# @COPYRIGHT_end

"""@package src.wi.urls.admin_cm

@author Piotr Wójcik
@date 31.01.2014
"""

from django.conf.urls import patterns, url, include

from wi.utils.decorators import admin_cm_permission
from wi.utils.views import direct_to_template, simple_generic


urlpatterns = patterns('',
    url(r'^admin_cm/$', admin_cm_permission(direct_to_template), {'template_name': 'admin_cm/base.html'}, name='cma_admin'),
    url(r'^ajax/move_database/$', admin_cm_permission(simple_generic),
        {'template_name':   'generic/simple.html',
         'success_msg':     (lambda desc: _('You have successfully moved data to archival database.') % {'desc': desc}),
         'ask_msg':         (lambda desc: _('Do you want to move data to archival database?') % {'desc': desc}),
         'request_url':     'admin_cm/history/move/', },
        name='cma_ajax_move_database'),

    (r'', include('wi.urls.admin_cm.cm')),
    (r'', include('wi.urls.admin_cm.vm')),
    (r'', include('wi.urls.admin_cm.farm')),
    (r'', include('wi.urls.admin_cm.iso_image')),
    (r'', include('wi.urls.admin_cm.storage_image')),
    (r'', include('wi.urls.admin_cm.system_image')),
    (r'', include('wi.urls.admin_cm.network')),
    (r'', include('wi.urls.admin_cm.node')),