Commit ebb4929a by Szabolcs Gelencser

Add favorite mark, display on detail page

parent 583f2684
......@@ -2,10 +2,11 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="1fbec8af-5a7c-40f9-b994-83ac07d1ae1d" name="Default" comment="">
<change beforePath="$PROJECT_DIR$/circle/dashboard/forms.py" afterPath="$PROJECT_DIR$/circle/dashboard/forms.py" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html" afterPath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change beforePath="$PROJECT_DIR$/circle/circle/db.sqlite3" afterPath="$PROJECT_DIR$/circle/circle/db.sqlite3" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/models.py" afterPath="$PROJECT_DIR$/circle/dashboard/models.py" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail.html" afterPath="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail.html" />
<change beforePath="$PROJECT_DIR$/circle/dashboard/views/vm.py" afterPath="$PROJECT_DIR$/circle/dashboard/views/vm.py" />
<change beforePath="$PROJECT_DIR$/circle/vm/operations.py" afterPath="$PROJECT_DIR$/circle/vm/operations.py" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
......@@ -35,73 +36,31 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="vm.py" pinned="false" current-in-tab="false">
<file leaf-file-name="vm.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/vm.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="51">
<caret line="364" column="27" lean-forward="false" selection-start-line="364" selection-start-column="6" selection-end-line="364" selection-end-column="27" />
<state relative-caret-position="54">
<caret line="1396" column="0" lean-forward="false" selection-start-line="1396" selection-start-column="0" selection-end-line="1396" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="network.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="248">
<caret line="27" column="37" lean-forward="false" selection-start-line="27" selection-start-column="37" selection-end-line="27" selection-end-column="37" />
<folding>
<marker date="1524213794390" expanded="false" signature="3495:3513" ph="..." />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="forms.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/dashboard/forms.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="78">
<caret line="864" column="40" lean-forward="true" selection-start-line="864" selection-start-column="40" selection-end-line="864" selection-end-column="40" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="operations.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/vm/operations.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="159">
<caret line="409" column="36" lean-forward="true" selection-start-line="409" selection-start-column="36" selection-end-line="409" selection-end-column="36" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="nova.py" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/circle/openstack_api/nova.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="202">
<caret line="1008" column="4" lean-forward="false" selection-start-line="1008" selection-start-column="4" selection-end-line="1008" selection-end-column="4" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="nova_policy.json" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/circle/os_policies/nova_policy.json">
<file leaf-file-name="index-vm.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/index-vm.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="185">
<caret line="51" column="4" lean-forward="true" selection-start-line="51" selection-start-column="4" selection-end-line="51" selection-end-column="30" />
<caret line="41" column="55" lean-forward="false" selection-start-line="41" selection-start-column="54" selection-end-line="41" selection-end-column="55" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="urls.py" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/dashboard/urls.py">
<file leaf-file-name="vm-detail.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="288">
<caret line="228" column="19" lean-forward="true" selection-start-line="228" selection-start-column="19" selection-end-line="228" selection-end-column="19" />
<state relative-caret-position="214">
<caret line="75" column="96" lean-forward="false" selection-start-line="75" selection-start-column="96" selection-end-line="75" selection-end-column="96" />
<folding />
</state>
</provider>
......@@ -119,11 +78,6 @@
</component>
<component name="FindInProjectRecents">
<findStrings>
<find>vm_opts</find>
<find>removeport</find>
<find>remove</find>
<find>port</find>
<find>VmPublicIpAddForm</find>
<find>f</find>
<find>forms.Choicefi</find>
<find>pools</find>
......@@ -145,10 +99,15 @@
<find>sleepoper</find>
<find>removeinterface</find>
<find>vm_op</find>
<find>interface</find>
<find>hidden</find>
<find>removeint</find>
<find>remove_in</find>
<find>instance_id</find>
<find>favor</find>
<find>interface</find>
<find>favouritev</find>
<find>v</find>
<find>favourite</find>
</findStrings>
<replaceStrings>
<replace>'ACTIVE'</replace>
......@@ -170,12 +129,10 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/circle/network/templates/network/vxlan-edit.html" />
<option value="$PROJECT_DIR$/circle/network/forms.py" />
<option value="$PROJECT_DIR$/circle/network/views.py" />
<option value="$PROJECT_DIR$/circle/network/templates/network/vxlan-create.html" />
<option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/resources.html" />
<option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail.html" />
<option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/home.html" />
<option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/console.html" />
<option value="$PROJECT_DIR$/circle/common/operations.py" />
......@@ -218,9 +175,11 @@
<option value="$PROJECT_DIR$/circle/network/models.py" />
<option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/_network-public-ip-add.html" />
<option value="$PROJECT_DIR$/circle/vm/operations.py" />
<option value="$PROJECT_DIR$/circle/dashboard/views/vm.py" />
<option value="$PROJECT_DIR$/circle/dashboard/forms.py" />
<option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html" />
<option value="$PROJECT_DIR$/circle/dashboard/models.py" />
<option value="$PROJECT_DIR$/circle/dashboard/views/vm.py" />
<option value="$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail.html" />
</list>
</option>
</component>
......@@ -310,7 +269,7 @@
<property name="settings.editor.selected.configurable" value="watcher.settings" />
<property name="NewWatcherDialog.advanced.open" value="true" />
<property name="DefaultHtmlFileTemplate" value="HTML File" />
<property name="SearchEverywhereHistoryKey" value="network&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-detail/network.html&#10;nova.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/os_policies/nova_policy.json&#10;operation&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;base&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/base.py&#10;indev&#9;null&#9;null&#10;vmdeta&#9;null&#9;null&#10;indexview&#9;null&#9;null&#10;operatio&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;vxlanc&#9;null&#9;null&#10;plain&#9;null&#9;null&#10;base.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/base.py&#10;local&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/local.py&#10;views.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/openstack_auth/views.py&#10;login.html&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/auth/login.html&#10;LoginVi&#9;null&#9;null&#10;indexv&#9;null&#9;null&#10;index-vm&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html&#10;index.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/views/index.py&#10;index&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index.html&#10;bas&#9;FILE&#9;file:///home/h3yduck/cloud/circle/openstack_api/base.py&#10;save&#9;null&#9;null&#10;plainc&#9;null&#9;null&#10;templatedet&#9;null&#9;null&#10;instancetemp&#9;null&#9;null&#10;instancetem&#9;null&#9;null&#10;url&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/urls.py&#10;vmcreate&#9;null&#9;null&#10;opera&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;operations&#9;FILE&#9;file:///home/h3yduck/cloud/circle/common/operations.py&#10;templat&#9;null&#9;null&#10;vmadd&#9;null&#9;null&#10;vmdetail&#9;null&#9;null&#10;addinterfa&#9;null&#9;null&#10;addin&#9;null&#9;null&#10;server&#9;null&#9;null&#10;Instance&#9;null&#9;null&#10;instance&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/models/instance.py&#10;operat&#9;null&#9;null&#10;ins&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/models/instance.py&#10;vmdetai&#9;null&#9;null&#10;operationvi&#9;null&#9;null&#10;ser&#9;null&#9;null&#10;server.&#9;FILE&#9;file:///home/h3yduck/.virtualenvs/cloud/local/lib/python2.7/site-packages/novaclient/v2/servers.py&#10;resources.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/request/templates/request/initials/resources.html&#10;vm-de&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-detail.html&#10;vxla&#9;null&#9;null&#10;urls&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/urls.py&#10;index-v&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vxlans.html&#10;create&#9;FILE&#9;file:///home/h3yduck/cloud/circle/network/templates/network/vxlan-create.html&#10;vxl&#9;null&#9;null" />
<property name="SearchEverywhereHistoryKey" value="vm-de&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-detail.html&#10;index-v&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html&#10;detailvi&#9;null&#9;null&#10;network&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/vm-detail/network.html&#10;nova.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/os_policies/nova_policy.json&#10;operation&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;base&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/base.py&#10;indev&#9;null&#9;null&#10;vmdeta&#9;null&#9;null&#10;indexview&#9;null&#9;null&#10;operatio&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;vxlanc&#9;null&#9;null&#10;plain&#9;null&#9;null&#10;base.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/base.py&#10;local&#9;FILE&#9;file:///home/h3yduck/cloud/circle/circle/settings/local.py&#10;views.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/openstack_auth/views.py&#10;login.html&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/auth/login.html&#10;LoginVi&#9;null&#9;null&#10;indexv&#9;null&#9;null&#10;index-vm&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index-vm.html&#10;index.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/views/index.py&#10;index&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/templates/dashboard/index.html&#10;bas&#9;FILE&#9;file:///home/h3yduck/cloud/circle/openstack_api/base.py&#10;save&#9;null&#9;null&#10;plainc&#9;null&#9;null&#10;templatedet&#9;null&#9;null&#10;instancetemp&#9;null&#9;null&#10;instancetem&#9;null&#9;null&#10;url&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/urls.py&#10;vmcreate&#9;null&#9;null&#10;opera&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/operations.py&#10;operations&#9;FILE&#9;file:///home/h3yduck/cloud/circle/common/operations.py&#10;templat&#9;null&#9;null&#10;vmadd&#9;null&#9;null&#10;vmdetail&#9;null&#9;null&#10;addinterfa&#9;null&#9;null&#10;addin&#9;null&#9;null&#10;server&#9;null&#9;null&#10;Instance&#9;null&#9;null&#10;instance&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/models/instance.py&#10;operat&#9;null&#9;null&#10;ins&#9;FILE&#9;file:///home/h3yduck/cloud/circle/vm/models/instance.py&#10;vmdetai&#9;null&#9;null&#10;operationvi&#9;null&#9;null&#10;ser&#9;null&#9;null&#10;server.&#9;FILE&#9;file:///home/h3yduck/.virtualenvs/cloud/local/lib/python2.7/site-packages/novaclient/v2/servers.py&#10;resources.&#9;FILE&#9;file:///home/h3yduck/cloud/circle/request/templates/request/initials/resources.html&#10;vxla&#9;null&#9;null&#10;urls&#9;FILE&#9;file:///home/h3yduck/cloud/circle/dashboard/urls.py&#10;create&#9;FILE&#9;file:///home/h3yduck/cloud/circle/network/templates/network/vxlan-create.html" />
</component>
<component name="RecentsManager">
<key name="CopyFile.RECENT_KEYS">
......@@ -456,13 +415,14 @@
</component>
<component name="ToolWindowManager">
<frame x="-2" y="-1" width="1370" height="751" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32980973" sideWeight="0.4978701" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.47568712" sideWeight="0.5037274" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.7097792" sideWeight="0.51283985" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32492113" sideWeight="0.50745475" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Python Console" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.43023255" sideWeight="0.43610224" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32769555" sideWeight="0.49574015" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.7097792" sideWeight="0.5067976" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.7097792" sideWeight="0.50981873" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.20015106" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Docker" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="false" weight="0.33" sideWeight="0.5" order="8" side_tool="false" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
......@@ -470,7 +430,7 @@
<window_info id="SciView" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.7097792" sideWeight="0.49320242" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.7097792" sideWeight="0.48716012" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
......@@ -561,7 +521,7 @@
</properties>
</breakpoint>
</default-breakpoints>
<option name="time" value="332" />
<option name="time" value="334" />
</breakpoint-manager>
<watches-manager />
</component>
......@@ -629,68 +589,53 @@ certifi.where()</expression-string>
</expressions>
<expressions id="evaluateExpression">
<expression>
<expression-string>self.get_op()</expression-string>
<expression-string>Favourite.objects.get(instance=vm_id, user=user_id)</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>openstack_api.neutron.tenant_floating_ip_list(self.request)</expression-string>
<expression-string>Favourite.objects.filter(instance=vm_id, user=user_id)</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>openstack_api.neutron.tenant_floating_ip_list(request)</expression-string>
<expression-string>Favourite.objects.filter(instance=vm_id, user=user_id).delete()</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>openstack_api.neutron.tenant_floating_ip_list()</expression-string>
<expression-string>self.get_op()</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>openstack_api.neutron.tar</expression-string>
<expression-string>openstack_api.neutron.tenant_floating_ip_list(self.request)</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>openstack_api.neutron.tenant_floating_ip_allocate(request, pool, request.user.project_id)</expression-string>
<expression-string>openstack_api.neutron.tenant_floating_ip_list(request)</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>self.request.POST</expression-string>
<expression-string>openstack_api.neutron.tenant_floating_ip_list()</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>self.request.GET</expression-string>
<expression-string>openstack_api.neutron.tar</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
<expression>
<expression-string>self.request</expression-string>
<expression-string>openstack_api.neutron.tenant_floating_ip_allocate(request, pool, request.user.project_id)</expression-string>
<language-id>Python</language-id>
<evaluation-mode>EXPRESSION</evaluation-mode>
</expression>
</expressions>
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/circle/templates/registration/login.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="391">
<caret line="23" column="10" lean-forward="true" selection-start-line="23" selection-start-column="10" selection-end-line="23" selection-end-column="10" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/openstack_auth/utils.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="236">
<caret line="155" column="54" lean-forward="false" selection-start-line="155" selection-start-column="40" selection-end-line="155" selection-end-column="54" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/openstack_auth/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="493">
......@@ -752,16 +697,6 @@ certifi.where()</expression-string>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/models.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="389">
<caret line="161" column="71" lean-forward="false" selection-start-line="161" selection-start-column="37" selection-end-line="161" selection-end-column="71" />
<folding>
<element signature="e#732#770#0" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/circle/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="306">
......@@ -873,6 +808,7 @@ certifi.where()</expression-string>
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221">
<caret line="13" column="0" lean-forward="false" selection-start-line="13" selection-start-column="0" selection-end-line="13" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
......@@ -1021,10 +957,36 @@ certifi.where()</expression-string>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/urls.py">
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="288">
<caret line="228" column="19" lean-forward="true" selection-start-line="228" selection-start-column="19" selection-end-line="228" selection-end-column="19" />
<state relative-caret-position="248">
<caret line="27" column="37" lean-forward="false" selection-start-line="27" selection-start-column="37" selection-end-line="27" selection-end-column="37" />
<folding>
<marker date="1524213794390" expanded="false" signature="3495:3513" ph="..." />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/forms.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="78">
<caret line="864" column="40" lean-forward="false" selection-start-line="864" selection-start-column="40" selection-end-line="864" selection-end-column="40" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/vm/operations.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="159">
<caret line="409" column="36" lean-forward="false" selection-start-line="409" selection-start-column="36" selection-end-line="409" selection-end-column="36" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/openstack_api/nova.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="202">
<caret line="1008" column="4" lean-forward="false" selection-start-line="1008" selection-start-column="4" selection-end-line="1008" selection-end-column="4" />
<folding />
</state>
</provider>
......@@ -1032,49 +994,47 @@ certifi.where()</expression-string>
<entry file="file://$PROJECT_DIR$/circle/circle/os_policies/nova_policy.json">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="185">
<caret line="51" column="4" lean-forward="true" selection-start-line="51" selection-start-column="4" selection-end-line="51" selection-end-column="30" />
<caret line="51" column="4" lean-forward="false" selection-start-line="51" selection-start-column="4" selection-end-line="51" selection-end-column="30" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/vm.py">
<entry file="file://$PROJECT_DIR$/circle/dashboard/urls.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="51">
<caret line="364" column="27" lean-forward="false" selection-start-line="364" selection-start-column="6" selection-end-line="364" selection-end-column="27" />
<state relative-caret-position="288">
<caret line="228" column="19" lean-forward="false" selection-start-line="228" selection-start-column="19" selection-end-line="228" selection-end-column="19" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/forms.py">
<entry file="file://$PROJECT_DIR$/circle/dashboard/models.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="78">
<caret line="864" column="40" lean-forward="true" selection-start-line="864" selection-start-column="40" selection-end-line="864" selection-end-column="40" />
<state relative-caret-position="299">
<caret line="91" column="17" lean-forward="false" selection-start-line="91" selection-start-column="17" selection-end-line="91" selection-end-column="17" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail/network.html">
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/index-vm.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="248">
<caret line="27" column="37" lean-forward="false" selection-start-line="27" selection-start-column="37" selection-end-line="27" selection-end-column="37" />
<folding>
<marker date="1524213794390" expanded="false" signature="3495:3513" ph="..." />
</folding>
<state relative-caret-position="185">
<caret line="41" column="55" lean-forward="false" selection-start-line="41" selection-start-column="54" selection-end-line="41" selection-end-column="55" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/vm/operations.py">
<entry file="file://$PROJECT_DIR$/circle/dashboard/templates/dashboard/vm-detail.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="159">
<caret line="409" column="36" lean-forward="true" selection-start-line="409" selection-start-column="36" selection-end-line="409" selection-end-column="36" />
<state relative-caret-position="214">
<caret line="75" column="96" lean-forward="false" selection-start-line="75" selection-start-column="96" selection-end-line="75" selection-end-column="96" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/circle/openstack_api/nova.py">
<entry file="file://$PROJECT_DIR$/circle/dashboard/views/vm.py">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="202">
<caret line="1008" column="4" lean-forward="false" selection-start-line="1008" selection-start-column="4" selection-end-line="1008" selection-end-column="4" />
<state relative-caret-position="54">
<caret line="1396" column="0" lean-forward="false" selection-start-line="1396" selection-start-column="0" selection-end-line="1396" selection-end-column="0" />
<folding />
</state>
</provider>
......
No preview for this file type
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-04-20 08:54
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0007_profile_network_limit'),
]
operations = [
migrations.AlterField(
model_name='favourite',
name='instance',
field=models.CharField(max_length=50),
),
migrations.AlterField(
model_name='favourite',
name='user',
field=models.CharField(max_length=50),
),
]
......@@ -82,8 +82,8 @@ class Message(TimeStampedModel, TimeFramedModel):
class Favourite(Model):
instance = ForeignKey("vm.Instance")
user = ForeignKey(User)
instance = CharField(max_length=50, blank=False)
user = CharField(max_length=50, blank=False)
class Notification(TimeStampedModel):
......
......@@ -73,7 +73,7 @@
{{ instance.name }}
</div>
<small>{{ instance.primary_host.get_fqdn }}</small>
<small class="dashboard-vm-favourite" style="line-height: 39.6px;" data-vm="{{ instance.pk }}">
<small class="dashboard-vm-favourite" style="line-height: 39.6px;" data-vm="{{ instance.id }}">
{% if fav %}
<i class="fa fa-star text-primary title-favourite" title="{% trans "Unfavourite" %}"></i>
{% else %}
......
......@@ -137,7 +137,7 @@ class VmDetailView(LoginRequiredMixin, GraphMixin, DetailView):
'op': {i.op: i for i in ops},
# 'connect_commands': user.profile.get_connect_commands(instance),
'hide_tutorial': hide_tutorial,
'fav': [], #instance.favourite_set.filter(user=user).exists(),
'fav': Favourite.objects.filter(user=user.id, instance=instance.id).exists(),
'instance': self.object
})
......@@ -1392,15 +1392,13 @@ def vm_activity(request, pk):
class FavouriteView(TemplateView):
def post(self, *args, **kwargs):
user = self.request.user
vm = Instance.objects.get(pk=self.request.POST.get("vm"))
if not vm.has_level(user, 'user'):
raise PermissionDenied()
user_id = self.request.user.id
vm_id = self.request.POST.get("vm")
try:
Favourite.objects.get(instance=vm, user=user).delete()
Favourite.objects.get(instance=vm_id, user=user_id).delete()
return HttpResponse("Deleted.")
except Favourite.DoesNotExist:
Favourite(instance=vm, user=user).save()
Favourite(instance=vm_id, user=user_id).save()
return HttpResponse("Added.")
#
#
......
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-04-20 08:54
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('request', '0005_auto_20180403_1342'),
]
operations = [
migrations.AlterModelOptions(
name='request',
options={},
),
]
# -*- coding: utf-8 -*-
# Generated by Django 1.11.6 on 2018-04-20 08:54
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('vm', '0010_auto_20180313_1628'),
]
operations = [
migrations.RemoveField(
model_name='node',
name='host',
),
migrations.RemoveField(
model_name='node',
name='tags',
),
migrations.RemoveField(
model_name='node',
name='traits',
),
migrations.RemoveField(
model_name='nodeactivity',
name='node',
),
migrations.RemoveField(
model_name='nodeactivity',
name='parent',
),
migrations.RemoveField(
model_name='nodeactivity',
name='user',
),
migrations.RemoveField(
model_name='instance',
name='node',
),
migrations.DeleteModel(
name='Node',
),
migrations.DeleteModel(
name='NodeActivity',
),
]
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