Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

CIRCLE / cloud

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 94
  • Merge Requests 10
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Open
Merge request !362 opened Mar 03, 2016 by Czémán Arnold@cemiarni 
  • Report abuse
Report abuse

Boot menu toggle button for vm-detail view

Issue: #439

Spectacle.wX3425

×

Check out, review, and merge locally

Step 1. Fetch and check out the branch for this merge request

git fetch origin
git checkout -b issue_439 origin/issue_439

Step 2. Review the changes locally

Step 3. Merge the branch and fix any conflicts that come up

git checkout master
git merge --no-ff issue_439

Step 4. Push the result of the merge to GitLab

git push origin master

Note that pushing to GitLab requires write access to this repository.

Tip: You can also checkout merge requests locally by following these guidelines.

  • Discussion 12
  • Commits 8
  • Pipelines 5
  • Changes 9
{{ resolvedDiscussionCount }}/{{ discussionCount }} {{ resolvedCountText }} resolved
  • Kálmán Viktor
    @kviktor started a discussion on an old version of the diff Mar 06, 2016
    Last updated by Bach Dániel Mar 06, 2016
    circle/dashboard/views/vm.py
    310 315 return self.get_object().get_absolute_url() + "#resources"
    311 316  
    312 317  
    318 class VmToggleBootMenuUpdate(SuperuserRequiredMixin, UpdateView):
    • Kálmán Viktor @kviktor commented Mar 06, 2016
      Owner

      Do an ACL check, it's not just for superusers

      Do an ACL check, it's not just for superusers
    • Bach Dániel @bachdaniel commented Mar 06, 2016
      Owner

      ➕ perm check ❗

      :heavy_plus_sign: perm check :exclamation:
    Please register or sign in to reply
  • Kálmán Viktor
    @kviktor started a discussion on an old version of the diff Mar 07, 2016
    circle/circle/settings/base.py
    185 185 "dashboard/dashboard.less",
    186 186 "network/network.less",
    • Kálmán Viktor @kviktor commented Mar 07, 2016
      Owner

      Move the bootstrap-toggle static files up (better safe than sorry!)

      Move the bootstrap-toggle static files up (better safe than sorry!)
    Please register or sign in to reply
  • Czémán Arnold @cemiarni

    Added 1 commit:

    • d6175317 - dashboard, vm: add boot menu toggle button for vm-detail view and add toggle_boot_menu permission
    Mar 18, 2016

    Added 1 commit:

    • d6175317 - dashboard, vm: add boot menu toggle button for vm-detail view and add toggle_boot_menu permission
    Added 1 commit: * d6175317 - dashboard, vm: add boot menu toggle button for vm-detail view and add toggle_boot_menu permission
    Toggle commit list
  • Czémán Arnold @cemiarni

    Added 1 commit:

    • dff04fba - dashboard, vm: add boot menu toggle button for vm-detail view and add toggle_boot_menu permission
    Mar 21, 2016

    Added 1 commit:

    • dff04fba - dashboard, vm: add boot menu toggle button for vm-detail view and add toggle_boot_menu permission
    Added 1 commit: * dff04fba - dashboard, vm: add boot menu toggle button for vm-detail view and add toggle_boot_menu permission
    Toggle commit list
  • Dudás Ádám
    @siliconbrain started a discussion on the diff Apr 25, 2016
    Last updated by Kálmán Viktor Aug 31, 2016
    circle/dashboard/static/dashboard/vm-details.js
    252 252 return e.preventDefault();
    253 253 });
    254 254  
    255 $("#id_boot_menu").change(function(){
    • Dudás Ádám @siliconbrain commented Apr 25, 2016
      Owner

      how about

      $("#id_boot_menu").change(function(ev){
        ev.target.parents("form").submit();
      });

      ?

      how about ```javascript $("#id_boot_menu").change(function(ev){ ev.target.parents("form").submit(); }); ``` ?
    • Kálmán Viktor @kviktor commented Aug 31, 2016
      Owner

      image

      (jk)

      ![image](/uploads/d6914de0eb66044b85632a9e5ca63496/image.png) (jk)
    Please register or sign in to reply
  • Czémán Arnold @cemiarni

    Added 1 commit:

    • d989daf2 - dashboard: remove redundant code
    Apr 25, 2016

    Added 1 commit:

    • d989daf2 - dashboard: remove redundant code
    Added 1 commit: * d989daf2 - dashboard: remove redundant code
    Toggle commit list
  • Czémán Arnold @cemiarni

    Status changed to closed

    Jun 15, 2016

    Status changed to closed

    Status changed to closed
    Toggle commit list
  • Czémán Arnold @cemiarni

    Status changed to reopened

    Jun 15, 2016

    Status changed to reopened

    Status changed to reopened
    Toggle commit list
  • Czémán Arnold @cemiarni

    Added 47 commits:

    • d989daf2...3cff165b - 45 commits from branch master
    • 01f0294e - Merge branch 'master' into issue_439
    • 5bf0da3b - vm: add ToggleBootMenuOperation and VmToggleBootMenuUpdate morph to VmOperationView
    Jul 18, 2016

    Added 47 commits:

    • d989daf2...3cff165b - 45 commits from branch master
    • 01f0294e - Merge branch 'master' into issue_439
    • 5bf0da3b - vm: add ToggleBootMenuOperation and VmToggleBootMenuUpdate morph to VmOperationView
    Added 47 commits: * d989daf2...3cff165b - 45 commits from branch `master` * 01f0294e - Merge branch 'master' into issue_439 * 5bf0da3b - vm: add ToggleBootMenuOperation and VmToggleBootMenuUpdate morph to VmOperationView
    Toggle commit list
  • Dudás Ádám
    @siliconbrain started a discussion on commit 5bf0da3b Jul 22, 2016
    circle/dashboard/views/vm.py
    612 592 *args, **kwargs)
    613 593
    614 594
    595 class VmToggleBootMenuUpdate(VmOperationView):
    596 op = 'toggle_bootmenu'
    597 icon = "save"
    598 show_in_toolbar = False
    599 wait_for_result = 0.5
    600
    601 def post(self, request, extra=None, *args, **kwargs):
    602 if extra is None:
    • Dudás Ádám @siliconbrain commented Jul 22, 2016
      Owner

      extra is unused

      `extra` is unused
    Please register or sign in to reply
  • Dudás Ádám
    @siliconbrain started a discussion on commit 5bf0da3b Jul 22, 2016
    circle/dashboard/views/vm.py
    612 592 *args, **kwargs)
    613 593
    614 594
    595 class VmToggleBootMenuUpdate(VmOperationView):
    596 op = 'toggle_bootmenu'
    597 icon = "save"
    • Dudás Ádám @siliconbrain commented Jul 22, 2016
      Owner

      select a better icon (eg. fa-cog, fa-cogs, fa-wrench)

      select a better icon (eg. fa-cog, fa-cogs, fa-wrench)
    Please register or sign in to reply
  • Dudás Ádám @siliconbrain commented Jul 22, 2016
    Owner

    add an entry to circle/dashboard/views/vm.py/vm_ops for the operation

    add an entry to `circle/dashboard/views/vm.py/vm_ops` for the operation
  • Kálmán Viktor
    @kviktor started a discussion on an old version of the diff Jul 22, 2016
    circle/dashboard/views/vm.py
    609 for f in form.errors:
    610 messages.error(request, "<strong>%s</strong>: %s" % (
    611 f, form.errors[f].as_text()
    612 ))
    613 if request.is_ajax(): # this is not too nice
    614 store = messages.get_messages(request)
    615 store.used = True
    616 return JsonResponse({'success': False,
    617 'messages': [unicode(m) for m in store]})
    618 else:
    619 return HttpResponseRedirect(instance.get_absolute_url() +
    620 "#resources")
    621 else:
    622 extra = form.cleaned_data
    623 return super(VmToggleBootMenuUpdate, self).post(request, extra,
    624 *args, **kwargs)
    • Kálmán Viktor @kviktor commented Jul 22, 2016
      Owner

      ~this code is almost the same as VmResourcesChangeView's, might be a good idea to make a mixin for it~

      see: !362 (comment 3997)

      Edited Aug 31, 2016 by Kálmán Viktor
      ~~~this code is almost the same as `VmResourcesChangeView`'s, might be a good idea to make a mixin for it~~~ see: https://git.ik.bme.hu/circle/cloud/merge_requests/362#note_3997
    Please register or sign in to reply
  • Czémán Arnold @cemiarni

    Added 1 commit:

    • 8d1075f7 - dashboard: small fix
    Jul 22, 2016

    Added 1 commit:

    • 8d1075f7 - dashboard: small fix
    Added 1 commit: * 8d1075f7 - dashboard: small fix
    Toggle commit list
  • Czémán Arnold @cemiarni

    Added 1 commit:

    • 1bb04667 - dashboard: remove unnecessary url entry
    Aug 29, 2016

    Added 1 commit:

    • 1bb04667 - dashboard: remove unnecessary url entry
    Added 1 commit: * 1bb04667 - dashboard: remove unnecessary url entry
    Toggle commit list
  • Kálmán Viktor
    @kviktor started a discussion on the diff Aug 31, 2016
    circle/vm/operations.py
    1403 1403
    1404 1404
    1405 1405 @register_operation
    1406 class ToggleBootMenuOperation(InstanceOperation):
    1407 id = 'toggle_bootmenu'
    1408 name = _("toggle boot menu")
    • Kálmán Viktor @kviktor commented Aug 31, 2016
      Owner

      With or without space?:D

      With or without space?:D
    Please register or sign in to reply
  • Kálmán Viktor
    @kviktor started a discussion on an old version of the diff Aug 31, 2016
    circle/dashboard/views/vm.py
    602 instance = get_object_or_404(Instance, pk=kwargs['pk'])
    603
    604 form = ToggleBootMenuForm(request.POST, instance=instance)
    605 if not form.is_valid():
    606 for f in form.errors:
    607 messages.error(request, "<strong>%s</strong>: %s" % (
    608 f, form.errors[f].as_text()
    609 ))
    610 if request.is_ajax(): # this is not too nice
    611 store = messages.get_messages(request)
    612 store.used = True
    613 return JsonResponse({'success': False,
    614 'messages': [unicode(m) for m in store]})
    615 else:
    616 return HttpResponseRedirect(instance.get_absolute_url() +
    617 "#resources")
    • Kálmán Viktor @kviktor commented Aug 31, 2016
      Owner

      Is it even possible to send this from as invalid (while using site as intended)?

      Edited Aug 31, 2016 by Kálmán Viktor
      Is it even possible to send this from as invalid (while using site as intended)?
    Please register or sign in to reply
  • Kálmán Viktor @kviktor commented Aug 31, 2016
    Owner

    Doesn't work without Javascript.

    Would be better imho to drop bootstrap-toggle (extra css and js file just for this button is kinda meh). A simple checkbox is enough, add a Save button and remove it with Javascript, this without JS there is a manual save button, with JS it's the same as now.

    Doesn't work without Javascript. Would be better imho to drop bootstrap-toggle (extra css and js file just for this button is kinda meh). A simple checkbox is enough, add a Save button and remove it with Javascript, this without JS there is a manual save button, with JS it's the same as now.
  • Czémán Arnold @cemiarni

    Added 1 commit:

    • 5b503e39 - dashboard, vm: rework boot menu toggling
    Aug 31, 2016

    Added 1 commit:

    • 5b503e39 - dashboard, vm: rework boot menu toggling
    Added 1 commit: * 5b503e39 - dashboard, vm: rework boot menu toggling
    Toggle commit list
  • Czémán Arnold @cemiarni

    Added 1 commit:

    • a6c27803 - dashboard: fix toggle boot menu form permission problems, remove unecessary help…
    Sep 12, 2016

    Added 1 commit:

    • a6c27803 - dashboard: fix toggle boot menu form permission problems, remove unecessary help…
    Added 1 commit: * a6c27803 - dashboard: fix toggle boot menu form permission problems, remove unecessary help…
    Toggle commit list
  • Write
  • Preview
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment
Assignee
No assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View labels
4
4 participants
Reference: circle/cloud!362