-
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.
Merge branch 'develop' into feature/aethel-detail
- Loading branch information
Showing
13 changed files
with
190 additions
and
78 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,6 +1,18 @@ | ||
import logging | ||
import os | ||
from django.conf import settings | ||
from django.apps import AppConfig | ||
|
||
from .models import load_dataset | ||
from parseport.logger import logger | ||
|
||
|
||
class AethelDbConfig(AppConfig): | ||
default_auto_field = "django.db.models.BigAutoField" | ||
name = "aethel_db" | ||
|
||
def ready(self): | ||
if os.path.exists(settings.DATASET_PATH): | ||
load_dataset() | ||
else: | ||
logger.critical("Æthel dataset not found.") |
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
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 |
---|---|---|
@@ -1,3 +1,12 @@ | ||
from django.db import models | ||
from typing import Optional | ||
|
||
# Create your models here. | ||
from django.conf import settings | ||
|
||
from aethel import ProofBank | ||
|
||
dataset: Optional[ProofBank] = None | ||
|
||
|
||
def load_dataset(): | ||
global dataset | ||
dataset = ProofBank.load_data(settings.DATASET_PATH) |
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
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
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
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,13 @@ | ||
from rest_framework.views import APIView | ||
from rest_framework.response import Response | ||
|
||
from aethel_db.views import aethel_status | ||
from spindle.views import spindle_status | ||
|
||
|
||
class StatusView(APIView): | ||
def get(self, request): | ||
return Response(dict( | ||
aethel=aethel_status(), | ||
spindle=spindle_status() | ||
)) |
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
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
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
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,20 @@ | ||
import { HttpClient } from "@angular/common/http"; | ||
import { Injectable } from "@angular/core"; | ||
import { Observable } from "rxjs"; | ||
import { environment } from "src/environments/environment"; | ||
|
||
interface Status { | ||
aethel: boolean; | ||
spindle: boolean; | ||
} | ||
|
||
@Injectable({ | ||
providedIn: "root" | ||
}) | ||
export class StatusService{ | ||
constructor(private http: HttpClient) {} | ||
|
||
get(): Observable<Status> { | ||
return this.http.get<Status>(`${environment.apiUrl}status/`); | ||
} | ||
} |
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
Oops, something went wrong.