Skip to content

Commit

Permalink
更名为adminset
Browse files Browse the repository at this point in the history
  • Loading branch information
guohongze committed Feb 15, 2017
1 parent dfdf92d commit 464c9ec
Show file tree
Hide file tree
Showing 57 changed files with 787 additions and 1,017 deletions.
2 changes: 1 addition & 1 deletion .idea/.name

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

902 changes: 294 additions & 608 deletions .idea/workspace.xml

Large diffs are not rendered by default.

24 changes: 0 additions & 24 deletions .idea/woss2.iml

This file was deleted.

File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions woss2/settings.py → adminset/settings.py
@@ -1,5 +1,5 @@
"""
Django settings for woss2 project.
Django settings for adminset project.
Generated by 'django-admin startproject' using Django 1.9.1.
Expand Down Expand Up @@ -53,7 +53,7 @@
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'woss2.urls'
ROOT_URLCONF = 'adminset.urls'

TEMPLATES = [
{
Expand All @@ -72,7 +72,7 @@
},
]

WSGI_APPLICATION = 'woss2.wsgi.application'
WSGI_APPLICATION = 'adminset.wsgi.application'


# Database
Expand Down
Binary file renamed woss2/settings.pyc → adminset/settings.pyc
Binary file not shown.
File renamed without changes.
Binary file renamed woss2/urls.pyc → adminset/urls.pyc
Binary file not shown.
File renamed without changes.
File renamed without changes.
4 changes: 2 additions & 2 deletions woss2/wsgi.py → adminset/wsgi.py
@@ -1,5 +1,5 @@
"""
WSGI config for woss2 project.
WSGI config for adminset project.
It exposes the WSGI callable as a module-level variable named ``application``.
Expand All @@ -11,6 +11,6 @@

from django.core.wsgi import get_wsgi_application

os.environ.setdefault("DJANGO_SETTINGS_MODULE", "woss2.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "adminset.settings")

application = get_wsgi_application()
Binary file added adminset/wsgi.pyc
Binary file not shown.
Binary file modified ansible/__pycache__/admin.cpython-35.pyc
Binary file not shown.
Binary file modified cmdb/__pycache__/admin.cpython-35.pyc
Binary file not shown.
Binary file modified cmdb/__pycache__/models.cpython-35.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion cmdb/admin.py
Expand Up @@ -14,7 +14,7 @@ class HostAdmin(admin.ModelAdmin):
'cpu_model',
'cpu_num',
'sn',
'identity',
#'identity',
]


Expand Down
Binary file modified cmdb/admin.pyc
Binary file not shown.
12 changes: 6 additions & 6 deletions cmdb/api.py
Expand Up @@ -28,12 +28,12 @@ def collect(request):
host = Host.objects.get(hostname=hostname)
except:
host = Host()
if req.POST.get('identity'):
identity = req.POST.get('identity')
try:
host = Host.objects.get(identity=identity)
except:
host = Host()
# if req.POST.get('identity'):
# identity = req.POST.get('identity')
# try:
# host = Host.objects.get(identity=identity)
# except:
# host = Host()
host.hostname = hostname
host.group = group
host.cpu_num = int(cpu_num)
Expand Down
Binary file modified cmdb/api.pyc
Binary file not shown.
19 changes: 19 additions & 0 deletions cmdb/migrations/0002_remove_host_identity.py
@@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# Generated by Django 1.9.8 on 2017-02-15 05:27
from __future__ import unicode_literals

from django.db import migrations


class Migration(migrations.Migration):

dependencies = [
('cmdb', '0001_initial'),
]

operations = [
migrations.RemoveField(
model_name='host',
name='identity',
),
]
Binary file added cmdb/migrations/0002_remove_host_identity.pyc
Binary file not shown.
2 changes: 1 addition & 1 deletion cmdb/models.py
Expand Up @@ -36,7 +36,7 @@ class Host(models.Model):
disk = models.CharField(max_length=255,null=True)
sn = models.CharField(max_length=60)
ip = models.GenericIPAddressField(max_length=15)
identity = models.CharField(max_length=32,null=True)
#identity = models.CharField(max_length=32,null=True)
idc = models.ForeignKey(Idc, verbose_name=u"所在机房",null=True)

def __unicode__(self):
Expand Down
Binary file modified cmdb/models.pyc
Binary file not shown.
7 changes: 5 additions & 2 deletions cmdb/urls.py
Expand Up @@ -6,8 +6,11 @@
app_name = 'cmdb'
urlpatterns = [
#url(r'^$', views.IndexView.as_view(), name='index'),
url(r'^$', views.cmdb, name='cmdb'),
url(r'^excel', views.excel, name='excel'),
url(r'^$', views.index, name='cmdb'),
url(r'^excel/', views.excel, name='excel'),
url(r'^asset_add/', views.asset_add, name='asset_add'),
url(r'^asset_del/', views.asset_del, name='asset_del'),
url(r'^asset_edit/', views.asset_edit, name='asset_edit'),
url(r'^login', views.login, name='login'),
url(r'^sync', views.hostsync, name='sync'),
url(r'^collect', api.collect, name='update_api'),
Expand Down
Binary file modified cmdb/urls.pyc
Binary file not shown.
19 changes: 16 additions & 3 deletions cmdb/views.py
Expand Up @@ -11,9 +11,10 @@
sys.setdefaultencoding('utf8')


def cmdb(request):
def index(request):
temp_name = "cmdb/cmdb-header.html"
host_list = Host.objects.all()
return render_to_response('bak/cmdb.html', locals())
return render_to_response('cmdb/index.html', locals())


def excel(request):
Expand Down Expand Up @@ -57,4 +58,16 @@ def hostsync(request):
host_item = m.hostname+" "+"ansible_host="+m.ip+" "+"host_name="+m.hostname+"\n"
ansible_file.write(host_item)
ansible_file.close()
return HttpResponse("ok")
return HttpResponse("ok")


def asset_add(request):
return HttpResponse("ok")


def asset_del(request):
pass


def asset_edit(request):
pass
Binary file modified cmdb/views.pyc
Binary file not shown.
Binary file modified db.sqlite3
Binary file not shown.
2 changes: 1 addition & 1 deletion manage.py
Expand Up @@ -3,7 +3,7 @@
import sys

if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "woss2.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "adminset.settings")

from django.core.management import execute_from_command_line

Expand Down
Binary file modified navi/__pycache__/admin.cpython-35.pyc
Binary file not shown.
Binary file modified navi/__pycache__/models.cpython-35.pyc
Binary file not shown.
Binary file modified navi/urls.pyc
Binary file not shown.
Binary file modified navi/views.pyc
Binary file not shown.
2 changes: 2 additions & 0 deletions static/layer/layer.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions static/layer/mobile/layer.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions static/layer/mobile/need/layer.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added static/layer/skin/default/icon-ext.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/layer/skin/default/icon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 464c9ec

Please sign in to comment.