Skip to content

Commit

Permalink
fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
subzdev committed Jan 10, 2022
1 parent 18affcf commit f7d61fc
Show file tree
Hide file tree
Showing 23 changed files with 14 additions and 1,368 deletions.
9 changes: 0 additions & 9 deletions api/tacticalrmm/autotasks/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,13 +92,8 @@ class AutomatedTask(BaseAuditModel):
# deprecated
timeout = models.PositiveIntegerField(blank=True, default=120)

<<<<<<< HEAD
# format -> {"actions": [{"type": "script", "script": 1, "name": "Script Name", "timeout": 90, "script_args": []}, {"type": "cmd", "command": "whoami", "timeout": 90}]}
actions = JSONField(default=list)
=======
# format -> {"actions": [{"type": "script", "pk": 1, "shell": "powershell", "timeout": 90, "script_args": []}, {"type": "cmd", "command": "whoami"}]}
actions = JSONField(default=dict)
>>>>>>> massive cleanup of files and restructure of integrations design
assigned_check = models.ForeignKey(
"checks.Check",
null=True,
Expand Down Expand Up @@ -366,13 +361,9 @@ def generate_nats_task_payload(self, editing=False):
"multiple_instances": self.task_instance_policy
if self.task_instance_policy
else 0,
<<<<<<< HEAD
"delete_expired_task_after": self.remove_if_not_scheduled
if self.expire_date
else False,
=======
"delete_expired_task_after": self.remove_if_not_scheduled,
>>>>>>> massive cleanup of files and restructure of integrations design
"start_when_available": self.run_asap_after_missed
if self.task_type != "runonce"
else True,
Expand Down
49 changes: 0 additions & 49 deletions api/tacticalrmm/autotasks/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ class TaskSerializer(serializers.ModelSerializer):
schedule = serializers.ReadOnlyField()
last_run = serializers.ReadOnlyField(source="last_run_as_timezone")
alert_template = serializers.SerializerMethodField()
<<<<<<< HEAD
run_time_date = serializers.DateTimeField(format="iso-8601", required=False)
expire_date = serializers.DateTimeField(
format="iso-8601", allow_null=True, required=False
Expand Down Expand Up @@ -83,14 +82,6 @@ def validate(self, data):
del data["monthly_weeks_of_month"]
if "assigned_check" in data:
del data["assigned_check"]
=======
run_time_date = serializers.DateTimeField(format="iso-8601")
expire_date = serializers.DateTimeField(format="iso-8601", allow_null=True)

def validate(self, data):

if "task_type" not in data:
>>>>>>> massive cleanup of files and restructure of integrations design
return data

# run_time_date required
Expand All @@ -104,104 +95,64 @@ def validate(self, data):

# daily task type validation
if data["task_type"] == "daily":
<<<<<<< HEAD
if "daily_interval" not in data or not data["daily_interval"]:
=======
if not data["daily_interval"]:
>>>>>>> massive cleanup of files and restructure of integrations design
raise serializers.ValidationError(
f"daily_interval is required for task_type '{data['task_type']}'"
)

# weekly task type validation
<<<<<<< HEAD
elif data["task_type"] == "weekly":
if "weekly_interval" not in data or not data["weekly_interval"]:
=======
if data["task_type"] == "weekly":
if not data["weekly_interval"]:
>>>>>>> massive cleanup of files and restructure of integrations design
raise serializers.ValidationError(
f"weekly_interval is required for task_type '{data['task_type']}'"
)

<<<<<<< HEAD
if "run_time_bit_weekdays" not in data or not data["run_time_bit_weekdays"]:
=======
if not data["run_time_bit_weekdays"]:
>>>>>>> massive cleanup of files and restructure of integrations design
raise serializers.ValidationError(
f"run_time_bit_weekdays is required for task_type '{data['task_type']}'"
)

# monthly task type validation
<<<<<<< HEAD
elif data["task_type"] == "monthly":
if (
"monthly_months_of_year" not in data
or not data["monthly_months_of_year"]
):
=======
if data["task_type"] == "monthly":
if not data["monthly_months_of_year"]:
>>>>>>> massive cleanup of files and restructure of integrations design
raise serializers.ValidationError(
f"monthly_months_of_year is required for task_type '{data['task_type']}'"
)

<<<<<<< HEAD
if "monthly_days_of_month" not in data or not data["monthly_days_of_month"]:
=======
if not data["monthly_days_of_month"]:
>>>>>>> massive cleanup of files and restructure of integrations design
raise serializers.ValidationError(
f"monthly_days_of_month is required for task_type '{data['task_type']}'"
)

# monthly day of week task type validation
<<<<<<< HEAD
elif data["task_type"] == "monthlydow":
if (
"monthly_months_of_year" not in data
or not data["monthly_months_of_year"]
):
=======
if data["task_type"] == "monthlydow":
if not data["monthly_months_of_year"]:
>>>>>>> massive cleanup of files and restructure of integrations design
raise serializers.ValidationError(
f"monthly_months_of_year is required for task_type '{data['task_type']}'"
)

<<<<<<< HEAD
if (
"monthly_weeks_of_month" not in data
or not data["monthly_weeks_of_month"]
):
=======
if not data["monthly_weeks_of_month"]:
>>>>>>> massive cleanup of files and restructure of integrations design
raise serializers.ValidationError(
f"monthly_weeks_of_month is required for task_type '{data['task_type']}'"
)

<<<<<<< HEAD
if "run_time_bit_weekdays" not in data or not data["run_time_bit_weekdays"]:
=======
if not data["run_time_bit_weekdays"]:
>>>>>>> massive cleanup of files and restructure of integrations design
raise serializers.ValidationError(
f"run_time_bit_weekdays is required for task_type '{data['task_type']}'"
)

# check failure task type validation
<<<<<<< HEAD
elif data["task_type"] == "checkfailure":
if "assigned_check" not in data or not data["assigned_check"]:
=======
if data["task_type"] == "checkfailure":
if not data["assigned_check"]:
>>>>>>> massive cleanup of files and restructure of integrations design
raise serializers.ValidationError(
f"assigned_check is required for task_type '{data['task_type']}'"
)
Expand Down
3 changes: 0 additions & 3 deletions api/tacticalrmm/integrations/meraki/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
path('<str:pk>/devices_summary/<str:timespan>/', views.GetDevicesSummary.as_view()),
path('<str:pk>/networks/uplinks/', views.GetNetworkUplinks.as_view()),
path('<str:pk>/top_clients/<str:timespan>/', views.GetTopClients.as_view()),
<<<<<<< HEAD
=======
path('<str:pk>/client/<str:mac>/', views.GetClient.as_view()),
>>>>>>> 5a541b0209a0de11b20c5d153af1efa9333fd4ab
path('<str:network_id>/applications/traffic/<str:timespan>/', views.GetNetworkApplicationTraffic.as_view()),
path('<str:network_id>/clients/traffic/<str:timespan>/', views.GetNetworkClientTraffic.as_view()),
path('<str:network_id>/clients/<str:client_mac>/policy/', views.GetClientPolicy.as_view()),
Expand Down
19 changes: 1 addition & 18 deletions api/tacticalrmm/integrations/meraki/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,6 @@

class GetOrganizations(APIView):
permission_classes = [IsAuthenticated]
<<<<<<< HEAD
<<<<<<< HEAD

=======

>>>>>>> 5a541b0209a0de11b20c5d153af1efa9333fd4ab
=======

>>>>>>> allow Meraki integration dashboard at client level as well as agent
def get(self, request, format=None):
integration = Integration.objects.get(name="Cisco Meraki")

Expand Down Expand Up @@ -126,8 +117,7 @@ def get(self, request, pk, timespan, format=None):

return Response(result)

<<<<<<< HEAD
=======

class GetClient(APIView):
permission_classes = [IsAuthenticated]

Expand All @@ -146,9 +136,7 @@ def get(self, request, pk, mac, format=None):
return Response(result)
except ValueError:
return Response()


>>>>>>> 5a541b0209a0de11b20c5d153af1efa9333fd4ab
class GetNetworkApplicationTraffic(APIView):
permission_classes = [IsAuthenticated]

Expand Down Expand Up @@ -215,11 +203,6 @@ def put(self, request, network_id, client_mac, format=None):
integration = Integration.objects.get(name="Cisco Meraki")

request_dict = {"devicePolicy": request.data['devicePolicy']}
<<<<<<< HEAD
print(request.data)
=======

>>>>>>> 5a541b0209a0de11b20c5d153af1efa9333fd4ab
payload = json.dumps(request_dict, indent=4)

result = requests.put(
Expand Down
7 changes: 0 additions & 7 deletions api/tacticalrmm/integrations/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,7 @@ class Integration(models.Model):
configuration = models.JSONField(null=True, blank=True)
data = models.JSONField(null=True, blank=True)
enabled = models.BooleanField(default=False)
<<<<<<< HEAD
<<<<<<< HEAD
=======
client_org_related = models.BooleanField(default=False)
>>>>>>> 5a541b0209a0de11b20c5d153af1efa9333fd4ab
=======
client_org_related = models.BooleanField(default=False)
>>>>>>> allow Meraki integration dashboard at client level as well as agent

def __str__(self):
return self.name
Expand Down
16 changes: 0 additions & 16 deletions api/tacticalrmm/integrations/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,9 @@
class GetIntegrationsSerializer(serializers.ModelSerializer):
class Meta:
model = Integration
<<<<<<< HEAD
<<<<<<< HEAD
fields = ('id', 'name', 'description', 'configuration', 'enabled')
=======
fields = ('id', 'name', 'description', 'configuration', 'enabled', 'client_org_related')
>>>>>>> 5a541b0209a0de11b20c5d153af1efa9333fd4ab
=======
fields = ('id', 'name', 'description', 'configuration', 'enabled', 'client_org_related')
>>>>>>> allow Meraki integration dashboard at client level as well as agent

class GetIntegrationSerializer(serializers.ModelSerializer):
class Meta:
model = Integration
<<<<<<< HEAD
<<<<<<< HEAD
fields = ('id', 'name', 'description', 'configuration', 'enabled')
=======
fields = ('id', 'name', 'description', 'configuration', 'enabled', 'client_org_related')
>>>>>>> 5a541b0209a0de11b20c5d153af1efa9333fd4ab
=======
fields = ('id', 'name', 'description', 'configuration', 'enabled', 'client_org_related')
>>>>>>> allow Meraki integration dashboard at client level as well as agent
16 changes: 1 addition & 15 deletions api/tacticalrmm/integrations/snipeit/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,13 +96,7 @@ def delete(self, request, asset_id, format=None):

result = requests.delete(
integration.base_url + "hardware/" + asset_id,
<<<<<<< HEAD
<<<<<<< HEAD
json=payload,
=======
>>>>>>> 5a541b0209a0de11b20c5d153af1efa9333fd4ab
=======
>>>>>>> checkin/checkout and delete asset

headers={
"Accept": "application/json",
"Content-Type": "application/json",
Expand Down Expand Up @@ -140,15 +134,7 @@ def post(self, request, asset_id, format=None):
payload = {
"id": asset_id,
"checkout_to_type": request.data['checkout_to_type'],
<<<<<<< HEAD
<<<<<<< HEAD
"assigned_user": 3,
=======
"assigned_user": request.data['assigned_user'],
>>>>>>> 5a541b0209a0de11b20c5d153af1efa9333fd4ab
=======
"assigned_user": request.data['assigned_user'],
>>>>>>> allow Meraki integration dashboard at client level as well as agent
"checkout_at": request.data['checkout_at'],
"expected_checkin": request.data['expected_checkin'],
"note": request.data['note']
Expand Down
4 changes: 0 additions & 4 deletions api/tacticalrmm/tacticalrmm/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,7 @@
# https://github.com/wh1te909/rmmagent
LATEST_AGENT_VER = "1.7.2"

<<<<<<< HEAD
MESH_VER = "0.9.66"
=======
MESH_VER = "0.9.65"
>>>>>>> massive cleanup of files and restructure of integrations design

NATS_SERVER_VER = "2.6.6"

Expand Down
Loading

0 comments on commit f7d61fc

Please sign in to comment.