Compare commits
No commits in common. "323152a8f5c5db86ae13e1055c24486742513e11" and "5581f0de9019b8b6a7a19d21ed094866151995aa" have entirely different histories.
323152a8f5
...
5581f0de90
28
.gitignore
vendored
28
.gitignore
vendored
@ -1,13 +1,23 @@
|
|||||||
# Composer dependencies
|
# ---> Go
|
||||||
/vendor/
|
# If you prefer the allow list template instead of the deny list, see community template:
|
||||||
|
# https://github.com/github/gitignore/blob/main/community/Golang/Go.AllowList.gitignore
|
||||||
|
#
|
||||||
|
# Binaries for programs and plugins
|
||||||
|
*.exe
|
||||||
|
*.exe~
|
||||||
|
*.dll
|
||||||
|
*.so
|
||||||
|
*.dylib
|
||||||
|
|
||||||
# Local data directory
|
# Test binary, built with `go test -c`
|
||||||
data/
|
*.test
|
||||||
|
|
||||||
# NPM dependencies for Grunt
|
# Output of the go coverage tool, specifically when used with LiteIDE
|
||||||
node_modules/
|
*.out
|
||||||
|
|
||||||
# Compiled CSS and JS
|
# Dependency directories (remove the comment below to include it)
|
||||||
public/css/
|
# vendor/
|
||||||
public/js/
|
|
||||||
|
# Go workspace file
|
||||||
|
go.work
|
||||||
|
|
||||||
|
61
Gruntfile.js
61
Gruntfile.js
@ -1,61 +0,0 @@
|
|||||||
module.exports = function(grunt) {
|
|
||||||
|
|
||||||
// Project configuration.
|
|
||||||
grunt.initConfig({
|
|
||||||
pkg: grunt.file.readJSON('package.json'),
|
|
||||||
|
|
||||||
sass: {
|
|
||||||
dist: {
|
|
||||||
options: {
|
|
||||||
style: 'compressed'
|
|
||||||
},
|
|
||||||
files: [{
|
|
||||||
expand: true,
|
|
||||||
cwd: 'assets/styles',
|
|
||||||
src: ['**/*.scss'],
|
|
||||||
dest: 'public/css',
|
|
||||||
ext: '.css'
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
uglify: {
|
|
||||||
options: {
|
|
||||||
mangle: false
|
|
||||||
},
|
|
||||||
compile: {
|
|
||||||
files: {
|
|
||||||
'public/js/bedabin.min.js': ['assets/js/**/*.js']
|
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
|
|
||||||
watch: {
|
|
||||||
css: {
|
|
||||||
files: ['assets/styles/**/*.scss'],
|
|
||||||
tasks: ['sass'],
|
|
||||||
options: {
|
|
||||||
atBegin: true,
|
|
||||||
spawn: false
|
|
||||||
}
|
|
||||||
},
|
|
||||||
js: {
|
|
||||||
files: ['assets/js/**/*.js'],
|
|
||||||
tasks: ['uglify'],
|
|
||||||
options: {
|
|
||||||
atBegin: true,
|
|
||||||
spawn: false
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Load plugins.
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-watch');
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-sass');
|
|
||||||
grunt.loadNpmTasks('grunt-contrib-uglify');
|
|
||||||
|
|
||||||
// CLI tasks.
|
|
||||||
grunt.registerTask('default', ['sass', 'uglify']);
|
|
||||||
|
|
||||||
};
|
|
2
LICENSE
2
LICENSE
@ -1,4 +1,4 @@
|
|||||||
Copyright (c) 2022 Bit Goblin
|
Copyright (c) <year> <owner>
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
|
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
$(document).ready(function() {
|
|
||||||
console.log("ready");
|
|
||||||
});
|
|
@ -1,65 +0,0 @@
|
|||||||
$primary-color: navy;
|
|
||||||
$primary-color-highlight: lighten($primary-color, 10%);
|
|
||||||
|
|
||||||
$nav-height: 65px;
|
|
||||||
|
|
||||||
body{
|
|
||||||
margin: 0;
|
|
||||||
padding: $nav-height 0 0;
|
|
||||||
background: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
a{
|
|
||||||
color: $primary-color;
|
|
||||||
transition: all 230ms ease-in-out;
|
|
||||||
&:hover{
|
|
||||||
color: $primary-color-highlight;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#main-nav{
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
width: 100%;
|
|
||||||
height: $nav-height;
|
|
||||||
background: navy;
|
|
||||||
color: #eee;
|
|
||||||
font-size: 2rem;
|
|
||||||
|
|
||||||
ul{
|
|
||||||
list-style: none;
|
|
||||||
li{
|
|
||||||
display: inline-block;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.nav-left{
|
|
||||||
float: left;
|
|
||||||
}
|
|
||||||
.nav-right{
|
|
||||||
float: right;
|
|
||||||
}
|
|
||||||
|
|
||||||
a{
|
|
||||||
display: inline-block;
|
|
||||||
padding: 15px 10px;
|
|
||||||
color: #eee;
|
|
||||||
text-decoration: none;
|
|
||||||
&:hover{
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.site-logo{
|
|
||||||
margin-left: 25px;
|
|
||||||
margin-right: 25px;
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#main-wrapper{
|
|
||||||
max-width: 1180px;
|
|
||||||
margin-top: 15px;
|
|
||||||
padding: 15px 20px;
|
|
||||||
}
|
|
@ -1,4 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
# start a local instance of the app using PHP's built-in webserver
|
|
||||||
php -S localhost:8080 -t public/ public/index.php
|
|
@ -1,24 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "bitgoblin/colossus",
|
|
||||||
"description": "Self-hosted database for organizing PC hardware benchmarking results",
|
|
||||||
"type": "project",
|
|
||||||
"license": "BSD-2-Clause",
|
|
||||||
"autoload": {
|
|
||||||
"psr-4": {
|
|
||||||
"BitGoblin\\Colossus\\": "src/"
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"authors": [
|
|
||||||
{
|
|
||||||
"name": "Gregory Ballantine",
|
|
||||||
"email": "gballantine@bitgoblin.tech"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"minimum-stability": "stable",
|
|
||||||
"require": {
|
|
||||||
"slim/slim": "^4.11",
|
|
||||||
"slim/psr7": "^1.6",
|
|
||||||
"php-di/php-di": "^6.4",
|
|
||||||
"slim/twig-view": "^3.3"
|
|
||||||
}
|
|
||||||
}
|
|
1387
composer.lock
generated
1387
composer.lock
generated
File diff suppressed because it is too large
Load Diff
3132
package-lock.json
generated
3132
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
26
package.json
26
package.json
@ -1,26 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "colossus",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"description": "Self-hosted database for organizing PC hardware benchmarking results",
|
|
||||||
"main": "index.js",
|
|
||||||
"scripts": {
|
|
||||||
"grunt": "grunt",
|
|
||||||
"test": "echo \"Error: no test specified\" && exit 1"
|
|
||||||
},
|
|
||||||
"repository": {
|
|
||||||
"type": "git",
|
|
||||||
"url": "https://git.metaunix.net/BitGoblin/colossus"
|
|
||||||
},
|
|
||||||
"keywords": [
|
|
||||||
"inventory"
|
|
||||||
],
|
|
||||||
"author": "Gregory Ballantine <gballantine@bitgoblin.tech>",
|
|
||||||
"license": "BSD-2-Clause",
|
|
||||||
"dependencies": {
|
|
||||||
"grunt": "^1.5.3",
|
|
||||||
"grunt-contrib-sass": "^2.0.0",
|
|
||||||
"grunt-contrib-uglify": "^5.2.2",
|
|
||||||
"grunt-contrib-watch": "^1.1.0",
|
|
||||||
"sass": "^1.56.1"
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,5 +0,0 @@
|
|||||||
# rewrite rules
|
|
||||||
RewriteEngine On
|
|
||||||
RewriteCond %{REQUEST_FILENAME} !-f
|
|
||||||
RewriteCond %{REQUEST_FILENAME} !-d
|
|
||||||
RewriteRule ^ index.php [QSA,L]
|
|
@ -1,24 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
// if we're looking for static files in dev, return false so they can be served.
|
|
||||||
if (PHP_SAPI == 'cli-server') {
|
|
||||||
$url = parse_url($_SERVER['REQUEST_URI']);
|
|
||||||
$file = __DIR__ . $url['path'];
|
|
||||||
|
|
||||||
// check the file types, only serve standard files
|
|
||||||
if (preg_match('/\.(?:png|js|jpg|jpeg|gif|css)$/', $file)) {
|
|
||||||
// does the file exist? If so, return it
|
|
||||||
if (is_file($file))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
// file does not exist. return a 404
|
|
||||||
header($_SERVER['SERVER_PROTOCOL'].' 404 Not Found');
|
|
||||||
printf('"%s" does not exist', $_SERVER['REQUEST_URI']);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
require_once __DIR__ . '/../src/app.php';
|
|
||||||
|
|
||||||
$app->run();
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace BitGoblin\Colossus\Controllers;
|
|
||||||
|
|
||||||
use Psr\Container\ContainerInterface;
|
|
||||||
|
|
||||||
class Controller {
|
|
||||||
|
|
||||||
protected $container;
|
|
||||||
|
|
||||||
public function __construct(ContainerInterface $container) {
|
|
||||||
$this->container = $container;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function get(string $name) {
|
|
||||||
return $this->container->get($name);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,16 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace BitGoblin\Colossus\Controllers;
|
|
||||||
|
|
||||||
use Psr\Http\Message\ResponseInterface as Response;
|
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
|
||||||
use Slim\Views\Twig;
|
|
||||||
|
|
||||||
class HomeController extends Controller {
|
|
||||||
|
|
||||||
public function getIndex(Request $request, Response $response): Response {
|
|
||||||
$view = Twig::fromRequest($request);
|
|
||||||
return $view->render($response, 'index.twig');
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -1,33 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace BitGoblin\Colossus\Controllers;
|
|
||||||
|
|
||||||
use Psr\Http\Message\ResponseInterface as Response;
|
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
|
||||||
use Slim\Routing\RouteContext;
|
|
||||||
use Slim\Views\Twig;
|
|
||||||
|
|
||||||
class ResultController extends Controller {
|
|
||||||
|
|
||||||
public function getList(Request $request, Response $response): Response {
|
|
||||||
$view = Twig::fromRequest($request);
|
|
||||||
return $view->render($response, 'result/list.twig');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getAdd(Request $request, Response $response): Response {
|
|
||||||
$view = Twig::fromRequest($request);
|
|
||||||
return $view->render($response, 'result/add.twig');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function postAdd(Request $request, Response $response): Response {
|
|
||||||
// will add data to database later...
|
|
||||||
|
|
||||||
// redirect the user back to the home page
|
|
||||||
$routeContext = RouteContext::fromRequest($request);
|
|
||||||
$routeParser = $routeContext->getRouteParser();
|
|
||||||
return $response
|
|
||||||
->withHeader('Location', $routeParser->urlFor('result.list'))
|
|
||||||
->withStatus(302);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
31
src/app.php
31
src/app.php
@ -1,31 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use DI\Container;
|
|
||||||
use Psr\Http\Message\ResponseInterface as Response;
|
|
||||||
use Psr\Http\Message\ServerRequestInterface as Request;
|
|
||||||
use Slim\Factory\AppFactory;
|
|
||||||
use Slim\Views\Twig;
|
|
||||||
use Slim\Views\TwigMiddleware;
|
|
||||||
|
|
||||||
require __DIR__ . '/../vendor/autoload.php';
|
|
||||||
|
|
||||||
// Create Container using PHP-DI
|
|
||||||
$container = new Container();
|
|
||||||
|
|
||||||
// Set container to create App with on AppFactory
|
|
||||||
AppFactory::setContainer($container);
|
|
||||||
$app = AppFactory::create();
|
|
||||||
|
|
||||||
// Allow body parsing for POST parameters
|
|
||||||
$app->addBodyParsingMiddleware();
|
|
||||||
|
|
||||||
// Add Error Handling Middleware
|
|
||||||
$app->addErrorMiddleware(true, false, false);
|
|
||||||
|
|
||||||
// Create Twig
|
|
||||||
$twig = Twig::create(__DIR__ . '/../views', ['cache' => false]);
|
|
||||||
// Add Twig-View Middleware
|
|
||||||
$app->add(TwigMiddleware::create($app, $twig));
|
|
||||||
|
|
||||||
// Register routes
|
|
||||||
require_once __DIR__ . '/routes.php';
|
|
@ -1,7 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
$app->get('/', '\\BitGoblin\\Colossus\\Controllers\\HomeController:getIndex')->setName('dashboard');
|
|
||||||
|
|
||||||
$app->get('/result', '\\BitGoblin\\Colossus\\Controllers\\ResultController:getList')->setName('result.list');
|
|
||||||
$app->get('/result/add', '\\BitGoblin\\Colossus\\Controllers\\ResultController:getAdd')->setName('result.add');
|
|
||||||
$app->post('/result/add', '\\BitGoblin\\Colossus\\Controllers\\ResultController:postAdd');
|
|
@ -1,19 +0,0 @@
|
|||||||
{% extends 'layout.twig' %}
|
|
||||||
|
|
||||||
{% block title %}Dashboard{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="twelve columns">
|
|
||||||
<h1>Welcome to Colossus!</h1>
|
|
||||||
<p>Using Colossus, you can easily organize your hardware benchmark results.</p>
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<p><a href="{{ url_for('result.list') }}">View saved results</a></p>
|
|
||||||
<p><a href="{{ url_for('result.add') }}">Add a new result</a></p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock %}
|
|
@ -1,20 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="en">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<title>{% block title %}{% endblock %} | Colossus</title>
|
|
||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/skeleton/2.0.4/skeleton.min.css">
|
|
||||||
<link rel="stylesheet" href="/css/nardah.css">
|
|
||||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.1/jquery.min.js"></script>
|
|
||||||
<script src="/js/bedabin.min.js"></script>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
{% include 'layout/navbar.twig' %}
|
|
||||||
|
|
||||||
<div id="main-wrapper" class="container">
|
|
||||||
{% block content %}{% endblock %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,9 +0,0 @@
|
|||||||
<nav id="main-nav">
|
|
||||||
|
|
||||||
<ul class="nav-left">
|
|
||||||
<li class="site-logo">Colossus</li>
|
|
||||||
<li><a href="{{ url_for('dashboard') }}">Dashboard</a></li>
|
|
||||||
<li><a href="/result">Results</a></li>
|
|
||||||
</ul>
|
|
||||||
|
|
||||||
</nav>
|
|
@ -1,54 +0,0 @@
|
|||||||
{% extends 'layout.twig' %}
|
|
||||||
|
|
||||||
{% block title %}Add Benchmark Result{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="twelve columns">
|
|
||||||
<h1>Add new benchmark result</h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="twelve columns">
|
|
||||||
<form action="{{ url_for('result.add') }}" method="POST" class="u-full-width">
|
|
||||||
<div class="row">
|
|
||||||
<div class="six columns">
|
|
||||||
<label for="result_component">Hardware name:</label>
|
|
||||||
<input type="text" id="result_component" class="u-full-width" name="result_component">
|
|
||||||
</div>
|
|
||||||
<div class="six columns">
|
|
||||||
<label for="result_benchmark">Benchmark used:</label>
|
|
||||||
<input type="text" id="result_benchmark" class="u-full-width" name="result_benchmark">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="six columns">
|
|
||||||
<label for="result_type">Score type:</label>
|
|
||||||
<select id="result_type" class="u-full-width" name="result_type">
|
|
||||||
<option value="fps">Frames per second</option>
|
|
||||||
<option value="points">Point value</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
<div class="two columns">
|
|
||||||
<label for="result_avg">Average:</label>
|
|
||||||
<input type="number" id="result_avg" class="u-full-width" name="result_avg">
|
|
||||||
</div>
|
|
||||||
<div class="two columns">
|
|
||||||
<label for="result_min">Minimum:</label>
|
|
||||||
<input type="number" id="result_min" class="u-full-width" name="result_min">
|
|
||||||
</div>
|
|
||||||
<div class="two columns">
|
|
||||||
<label for="result_max">Maximum:</label>
|
|
||||||
<input type="number" id="result_max" class="u-full-width" name="result_max">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<input class="button button-primary" type="submit" value="Submit">
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% endblock %}
|
|
@ -1,7 +0,0 @@
|
|||||||
{% extends 'layout.twig' %}
|
|
||||||
|
|
||||||
{% block title %}List of Results{% endblock %}
|
|
||||||
|
|
||||||
{% block content %}
|
|
||||||
<p>Results list...</p>
|
|
||||||
{% endblock %}
|
|
Loading…
Reference in New Issue
Block a user