diff options
author | Hongyuan Ma | 2018-07-17 12:33:54 +0000 |
---|---|---|
committer | Hongyuan Ma | 2018-07-17 12:33:54 +0000 |
commit | c77a2e119f687fa242543fb322510f5f4d56e804 (patch) | |
tree | 2947f25a4afd0951a8b6b4ca84df5599e4723cfa | |
parent | 752aa0ef69d7a78e4ce633e01141024a19e0dde3 (diff) |
add porject_path in setting_local
-rw-r--r-- | front-end/src/component/userinfo-card/index.css | 2 | ||||
-rw-r--r-- | front-end/src/component/userinfo-card/index.jsx | 10 | ||||
-rw-r--r-- | web/apps/test_records/views.py | 25 | ||||
-rw-r--r-- | web/db_tools/import_alias_data.py | 5 | ||||
-rw-r--r-- | web/pgperffarm/urls.py | 3 |
5 files changed, 35 insertions, 10 deletions
diff --git a/front-end/src/component/userinfo-card/index.css b/front-end/src/component/userinfo-card/index.css index 5493460..b34c9c0 100644 --- a/front-end/src/component/userinfo-card/index.css +++ b/front-end/src/component/userinfo-card/index.css @@ -1,5 +1,5 @@ .panel-blue{ - border-top: 3px solid #2497ba; + border-top: 3px solid #356fba; } .panel-default > .userinfo-panel-heading{ diff --git a/front-end/src/component/userinfo-card/index.jsx b/front-end/src/component/userinfo-card/index.jsx index ec5fbd3..5381538 100644 --- a/front-end/src/component/userinfo-card/index.jsx +++ b/front-end/src/component/userinfo-card/index.jsx @@ -21,7 +21,7 @@ class UserInfoCard extends React.Component { <i className="fa fa-user"></i> Your Info </h3> <span className="panel-report-num"> - report num: 4 + name: Maleic Acid </span> </div> @@ -33,10 +33,10 @@ class UserInfoCard extends React.Component { <div className="panel-body userinfo-panel-body"> <p><strong>{userinfo.username}</strong></p> <ul className="panel-body-ul"> - <li><i className="fa fa-desktop fa-fw"></i> {userinfo.machine_num} machine(s)</li> - <li><i className="fa fa-file fa-fw"></i> {userinfo.reports} report(s)</li> - <li><i className="fa fa-code-fork fa-fw"></i> {userinfo.branches} branch(es) involved</li> - <li><i className="fa fa-envelope-o fa-fw"></i> <a href={'mailto' + userinfo.email}></a>{userinfo.email}</li> + <li><i className="fa fa-desktop fa-fw"></i> {userinfo.machine_num}4 machine(s)</li> + <li><i className="fa fa-file fa-fw"></i> {userinfo.reports}5 report(s)</li> + <li><i className="fa fa-code-fork fa-fw"></i> {userinfo.branches}2 branch(es) involved</li> + <li><i className="fa fa-envelope-o fa-fw"></i> <a href="mailto:[email protected]">[email protected]</a></li> </ul> </div> <div className="panel-footer clearfix"> diff --git a/web/apps/test_records/views.py b/web/apps/test_records/views.py index 5d13ae6..a567976 100644 --- a/web/apps/test_records/views.py +++ b/web/apps/test_records/views.py @@ -43,6 +43,31 @@ class TestRecordListViewSet(mixins.ListModelMixin, viewsets.GenericViewSet): filter_backends = (django_filters.rest_framework.DjangoFilterBackend,) filter_class = TestRecordListFilter +class TestRecordListViewSet(mixins.ListModelMixin, viewsets.GenericViewSet): + """ + List test records + """ + + queryset = TestRecord.objects.all().order_by('add_time') + serializer_class = TestRecordListSerializer + pagination_class = StandardResultsSetPagination + filter_backends = (django_filters.rest_framework.DjangoFilterBackend,) + filter_class = TestRecordListFilter + +class TestStatusRecordListViewSet(mixins.ListModelMixin, viewsets.GenericViewSet): + """ + List test records + """ + + queryset = TestRecord.objects.all().order_by('add_time') + serializer_class = TestRecordListSerializer + pagination_class = StandardResultsSetPagination + filter_backends = (django_filters.rest_framework.DjangoFilterBackend,) + filter_class = TestRecordListFilter + + + + class TestRecordDetailViewSet(mixins.RetrieveModelMixin, viewsets.GenericViewSet): """ detail test records diff --git a/web/db_tools/import_alias_data.py b/web/db_tools/import_alias_data.py index f9cb103..05a1f9c 100644 --- a/web/db_tools/import_alias_data.py +++ b/web/db_tools/import_alias_data.py @@ -1,11 +1,10 @@ import sys import os - +from pgperffarm.settings import PORJECT_PATH # Use django's model independently pwd = os.path.dirname(os.path.realpath(__file__)) sys.path.append(pwd) -path = '/var/www/web/pgperffarm' -# path = 'D:\GitSpace\pgperffarm\web\pgperffarm' +path = PORJECT_PATH # path = 'D:\GitSpace\pgperffarm\web\pgperffarm' sys.path.append(path) os.environ.setdefault("DJANGO_SETTINGS_MODULE", "settings") diff --git a/web/pgperffarm/urls.py b/web/pgperffarm/urls.py index 9106332..2077330 100644 --- a/web/pgperffarm/urls.py +++ b/web/pgperffarm/urls.py @@ -22,7 +22,7 @@ from django.views.generic.base import RedirectView from rest_framework.documentation import include_docs_urls from rest_framework.routers import DefaultRouter from test_records.views import TestRecordListViewSet, TestRecordCreate, TestRecordDetailViewSet, \ - MachineHistoryRecordViewSet + MachineHistoryRecordViewSet, TestStatusRecordListViewSet from test_records.auth import MachineAuthToken # from test_records.view_base import TestListView @@ -35,6 +35,7 @@ from user_operation.views import UserMachineListViewSet, UserPortalInfoViewSet, router = DefaultRouter() router.register(r'records', TestRecordListViewSet, base_name="records") +router.register(r'status-records', TestStatusRecordListViewSet, base_name="status-records") router.register(r'detail', TestRecordDetailViewSet, base_name="detail") router.register(r'machine-records', MachineHistoryRecordViewSet, base_name="machine-records") router.register(r'machine-records-by-branch', UserMachineRecordByBranchListViewSet, base_name="machine-records-by-branch") |