-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,881 changed files
with
353,338 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
6 changes: 6 additions & 0 deletions
6
리눅스 에이전트/com_website/website/.idea/libraries/R_User_Library.xml
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file not shown.
Binary file not shown.
Empty file.
Binary file added
BIN
+120 Bytes
리눅스 에이전트/com_website/website/info/__pycache__/__init__.cpython-36.pyc
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from django.contrib import admin | ||
|
||
# Register your models here. |
Binary file not shown.
Binary file added
BIN
+1.67 KB
리눅스 에이전트/com_website/website/info/api/__pycache__/serializers.cpython-36.pyc
Binary file not shown.
Binary file added
BIN
+2.23 KB
리눅스 에이전트/com_website/website/info/api/__pycache__/urls.cpython-36.pyc
Binary file not shown.
Binary file added
BIN
+6.25 KB
리눅스 에이전트/com_website/website/info/api/__pycache__/views.cpython-36.pyc
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
from rest_framework.serializers import ModelSerializer | ||
from info.models import resource, process, kill, disk | ||
|
||
|
||
class processSerializer(ModelSerializer): | ||
#def __init__(self, *args, **kwargs): | ||
#many = kwargs.pop('many', True) | ||
#super(processSerializer, self).__init__(many=many, *args, **kwargs) | ||
class Meta: | ||
model = process | ||
fields = [ | ||
'pk', | ||
'user', | ||
'pid', | ||
'pname', | ||
'memory', | ||
'cpu', | ||
'time', | ||
] | ||
|
||
class resourceSerializer(ModelSerializer): | ||
class Meta: | ||
model = resource | ||
fields = [ | ||
'pk', | ||
'user', | ||
'cpu', | ||
'memory', | ||
'disk' | ||
] | ||
|
||
class killSerializer(ModelSerializer): | ||
class Meta: | ||
model = kill | ||
fields = [ | ||
'pk', | ||
'user', | ||
'pid', | ||
] | ||
|
||
class diskSerializer(ModelSerializer): | ||
class Meta: | ||
model = disk | ||
fields = [ | ||
'pk', | ||
'user', | ||
'full', | ||
'used', | ||
'rest', | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
from django.conf.urls import url | ||
from django.contrib import admin | ||
|
||
from .views import ( | ||
processListAPIView, | ||
processDetailAPIView, | ||
processUpdateAPIView, | ||
processDeleteAPIView, | ||
processCreateAPIView, | ||
processListCreateAPIView, | ||
|
||
resourceListAPIView, | ||
resourceDetailAPIView, | ||
resourceUpdateAPIView, | ||
resourceDeleteAPIView, | ||
resourceCreateAPIView, | ||
resourceListCreateAPIView, | ||
|
||
killListAPIView, | ||
killDetailAPIView, | ||
killUpdateAPIView, | ||
killDeleteAPIView, | ||
killCreateAPIView, | ||
killListCreateAPIView, | ||
|
||
diskListAPIView, | ||
diskDetailAPIView, | ||
diskUpdateAPIView, | ||
diskDeleteAPIView, | ||
diskCreateAPIView, | ||
diskListCreateAPIView, | ||
|
||
|
||
) | ||
|
||
|
||
urlpatterns = [ | ||
url(r'^process/$', processListAPIView.as_view(), name='processlist'), | ||
url(r'^process/(?P<pk>\d+)/$', processDetailAPIView.as_view(), name='processdetail'), | ||
url(r'^process/(?P<pk>\d+)/edit/$', processUpdateAPIView.as_view(), name='processupdate'), | ||
url(r'^process/(?P<user>\d+)/delete/$', processDeleteAPIView.as_view(), name='processdelete'), | ||
url(r'^process/create/$', processCreateAPIView.as_view(), name='processcreate'), | ||
url(r'^process/listcreate/$', processListCreateAPIView.as_view(), name='processlistcreate'), | ||
|
||
url(r'^resource/$', resourceListAPIView.as_view(), name='resourcelist'), | ||
url(r'^resource/(?P<pk>\d+)/$', resourceDetailAPIView.as_view(), name='resourcedetail'), | ||
url(r'^resource/(?P<pk>\d+)/edit/$', resourceUpdateAPIView.as_view(), name='resourceupdate'), | ||
url(r'^resource/(?P<user>\d+)/delete/$', resourceDeleteAPIView.as_view(), name='resourcedelete'), | ||
url(r'^resource/create/$', resourceCreateAPIView.as_view(), name='resourcecreate'), | ||
url(r'^resource/listcreate/$', resourceListCreateAPIView.as_view(), name='resourcelistcreate'), | ||
|
||
url(r'^kill/$', killListAPIView.as_view(), name='killlist'), | ||
url(r'^kill/(?P<pk>\d+)/$', killDetailAPIView.as_view(), name='killdetail'), | ||
url(r'^kill/(?P<pk>\d+)/edit/$', killUpdateAPIView.as_view(), name='killupdate'), | ||
url(r'^kill/(?P<user>\d+)/delete/$', killDeleteAPIView.as_view(), name='killdelete'), | ||
url(r'^kill/create/$', killCreateAPIView.as_view(), name='killcreate'), | ||
url(r'^kill/listcreate/$', killListCreateAPIView.as_view(), name='killlistcreate'), | ||
|
||
url(r'^disk/$', diskListAPIView.as_view(), name='disklist'), | ||
url(r'^disk/(?P<pk>\d+)/$', diskDetailAPIView.as_view(), name='diskdetail'), | ||
url(r'^disk/(?P<pk>\d+)/edit/$', diskUpdateAPIView.as_view(), name='diskupdate'), | ||
url(r'^disk/(?P<user>\d+)/delete/$', diskDeleteAPIView.as_view(), name='diskdelete'), | ||
url(r'^disk/create/$', diskCreateAPIView.as_view(), name='diskcreate'), | ||
url(r'^disk/listcreate/$', diskListCreateAPIView.as_view(), name='disklistcreate'), | ||
|
||
|
||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,118 @@ | ||
from rest_framework.generics import ListAPIView, RetrieveAPIView, DestroyAPIView, UpdateAPIView, CreateAPIView, ListCreateAPIView | ||
|
||
from info.models import process, resource, kill, disk | ||
from info.api.serializers import processSerializer, resourceSerializer, killSerializer, diskSerializer | ||
from rest_framework.fields import empty | ||
from rest_framework.response import Response | ||
from rest_framework.views import APIView | ||
from rest_framework import status | ||
from django.http import Http404 | ||
|
||
class processListAPIView(ListAPIView): | ||
queryset = process.objects.all() | ||
serializer_class = processSerializer | ||
|
||
class processDetailAPIView(RetrieveAPIView): | ||
queryset = process.objects.all() | ||
serializer_class = processSerializer | ||
|
||
class processUpdateAPIView(UpdateAPIView): | ||
queryset = process.objects.all() | ||
serializer_class = processSerializer | ||
|
||
class processDeleteAPIView(APIView): | ||
def delete(self, request, user, format=None): | ||
delprocess = process.objects.filter(user=user) | ||
delprocess.delete() | ||
return Response(status=status.HTTP_204_NO_CONTENT) | ||
|
||
class processCreateAPIView(CreateAPIView): | ||
queryset = process.objects.all() | ||
serializer_class = processSerializer | ||
def get_serializer(self, instance=None, data=empty, many=False, partial=False): | ||
return super(processCreateAPIView, self).get_serializer(instance=instance, data=data, many=True, partial=partial) | ||
|
||
class processListCreateAPIView(ListCreateAPIView): | ||
queryset = process.objects.all() | ||
serializer_class = processSerializer | ||
|
||
class resourceListAPIView(ListAPIView): | ||
queryset = resource.objects.all() | ||
serializer_class = resourceSerializer | ||
|
||
class resourceDetailAPIView(RetrieveAPIView): | ||
queryset = resource.objects.all() | ||
serializer_class = resourceSerializer | ||
|
||
class resourceUpdateAPIView(UpdateAPIView): | ||
queryset = resource.objects.all() | ||
serializer_class = resourceSerializer | ||
|
||
class resourceDeleteAPIView(APIView): | ||
def delete(self, request, user, format=None): | ||
delresource = resource.objects.filter(user=user) | ||
delresource.delete() | ||
return Response(status=status.HTTP_204_NO_CONTENT) | ||
|
||
|
||
class resourceCreateAPIView(CreateAPIView): | ||
queryset = resource.objects.all() | ||
serializer_class = resourceSerializer | ||
|
||
class resourceListCreateAPIView(ListCreateAPIView): | ||
queryset = resource.objects.all() | ||
serializer_class = resourceSerializer | ||
|
||
class killListAPIView(ListAPIView): | ||
queryset = kill.objects.all() | ||
serializer_class = killSerializer | ||
|
||
class killDetailAPIView(RetrieveAPIView): | ||
queryset = kill.objects.all() | ||
serializer_class = killSerializer | ||
|
||
class killUpdateAPIView(UpdateAPIView): | ||
queryset = kill.objects.all() | ||
serializer_class = killSerializer | ||
|
||
class killDeleteAPIView(APIView): | ||
def delete(self, request, user, format=None): | ||
delkill = kill.objects.filter(user=user) | ||
delkill.delete() | ||
return Response(status=status.HTTP_204_NO_CONTENT) | ||
|
||
class killCreateAPIView(CreateAPIView): | ||
queryset = kill.objects.all() | ||
serializer_class = killSerializer | ||
|
||
class killListCreateAPIView(ListCreateAPIView): | ||
queryset = kill.objects.all() | ||
serializer_class = killSerializer | ||
|
||
|
||
class diskListAPIView(ListAPIView): | ||
queryset = disk.objects.all() | ||
serializer_class = diskSerializer | ||
|
||
class diskDetailAPIView(RetrieveAPIView): | ||
queryset = disk.objects.all() | ||
serializer_class = diskSerializer | ||
|
||
class diskUpdateAPIView(UpdateAPIView): | ||
queryset = disk.objects.all() | ||
serializer_class = diskSerializer | ||
|
||
class diskDeleteAPIView(APIView): | ||
def delete(self, request, user, format=None): | ||
deldisk = disk.objects.filter(user=user) | ||
deldisk.delete() | ||
return Response(status=status.HTTP_204_NO_CONTENT) | ||
|
||
class diskCreateAPIView(CreateAPIView): | ||
queryset = disk.objects.all() | ||
serializer_class = diskSerializer | ||
|
||
class diskListCreateAPIView(ListCreateAPIView): | ||
queryset = disk.objects.all() | ||
serializer_class = diskSerializer | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from django.apps import AppConfig | ||
|
||
|
||
class Info1Config(AppConfig): | ||
name = 'info' |
47 changes: 47 additions & 0 deletions
47
리눅스 에이전트/com_website/website/info/migrations/0001_initial.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Generated by Django 2.1 on 2018-10-23 07:44 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
initial = True | ||
|
||
dependencies = [ | ||
('login', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.CreateModel( | ||
name='kill', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('pid', models.IntegerField()), | ||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='login.Account')), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='process', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('pid', models.IntegerField()), | ||
('pname', models.CharField(max_length=20)), | ||
('memory', models.IntegerField()), | ||
('cpu', models.IntegerField()), | ||
('disk', models.IntegerField()), | ||
('time', models.DateTimeField(auto_now=True)), | ||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='login.Account')), | ||
], | ||
), | ||
migrations.CreateModel( | ||
name='resource', | ||
fields=[ | ||
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), | ||
('cpu', models.IntegerField()), | ||
('memory', models.IntegerField()), | ||
('disk', models.IntegerField()), | ||
('user', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='login.Account')), | ||
], | ||
), | ||
] |
17 changes: 17 additions & 0 deletions
17
리눅스 에이전트/com_website/website/info/migrations/0002_remove_process_disk.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 2.1 on 2018-11-23 05:13 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('info', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='process', | ||
name='disk', | ||
), | ||
] |
23 changes: 23 additions & 0 deletions
23
리눅스 에이전트/com_website/website/info/migrations/0003_auto_20181123_0543.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Generated by Django 2.1 on 2018-11-23 05:43 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('info', '0002_remove_process_disk'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='process', | ||
name='cpu', | ||
field=models.FloatField(), | ||
), | ||
migrations.AlterField( | ||
model_name='process', | ||
name='memory', | ||
field=models.FloatField(), | ||
), | ||
] |
Oops, something went wrong.