35 lines
768 B
Python
35 lines
768 B
Python
|
# -*- coding: utf-8 -*-
|
||
|
from __future__ import unicode_literals
|
||
|
|
||
|
from django.http import HttpResponse
|
||
|
from django.shortcuts import render
|
||
|
import json
|
||
|
import requests
|
||
|
|
||
|
def get_metrics():
|
||
|
with open('conf.json') as conf:
|
||
|
api = json.load(conf)["api"]
|
||
|
print api
|
||
|
#try: res = requests.get(api + metrics)
|
||
|
return api
|
||
|
|
||
|
def panel(request):
|
||
|
with open('conf.json') as conf:
|
||
|
ws = json.load(conf)["ws"]
|
||
|
metrics = get_metrics()
|
||
|
return render(request, 'rbmd/index.html', {'ws' : ws, 'metrics' : metrics})
|
||
|
|
||
|
|
||
|
def get_status(request):
|
||
|
with open('conf.json') as conf:
|
||
|
status = json.load(conf)["status"]
|
||
|
#try: res = requests.get(status)
|
||
|
return HttpResponse(status)
|
||
|
|
||
|
def mount():
|
||
|
pass
|
||
|
|
||
|
def unmount():
|
||
|
pass
|
||
|
|