login-validator: remove unused index page

This commit is contained in:
nemunaire 2020-02-21 01:05:19 +01:00
parent 8d4ab002d8
commit c833b64d13
2 changed files with 1 additions and 82 deletions

View File

@ -1,78 +0,0 @@
package main
import (
"net/http"
"text/template"
)
const indextpl = `<!DOCTYPE html>
<html ng-app="FICApp">
<head>
<meta charset="utf-8">
<title>Challenge Forensic - Administration</title>
<link href="/css/bootstrap.min.css" type="text/css" rel="stylesheet">
<link href="/css/glyphicon.css" type="text/css" rel="stylesheet" media="screen">
<style>
samp.cksum {
overflow-x: hidden;
text-overflow: ellipsis;
max-width: 20vw;
display: inline-block;
vertical-align: middle;
}
</style>
<script src="/js/d3.v3.min.js"></script>
</head>
<body class="bg-light text-dark">
<nav class="navbar sticky-top navbar-expand-lg navbar-dark bg-dark text-light" style="margin-bottom: 5px;">
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#adminMenu" aria-controls="adminMenu" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<span id="clock" class="navbar-text" ng-controller="CountdownController" ng-cloak>
<span ng-show="startIn > 0">
Démarrage dans :
<span>{{"{{ startIn }}"}}</span>"
<span class="point">|</span>
</span>
<span id="hours">{{"{{ time.hours | time }}"}}</span>
<span class="point">:</span>
<span id="min">{{"{{ time.minutes | time }}"}}</span>
<span class="point">:</span>
<span id="sec">{{"{{ time.seconds | time }}"}}</span>
</span>
</nav>
<div class="container" ng-controller="DIWEBoxController">
<div ng-repeat="box in boxes" class="alert alert-dismissible alert-{{"{{ box.kind }}"}}" ng-cloak>
<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<strong ng-if="box.title">{{"{{ box.title }}"}}</strong> {{"{{ box.msg }}"}}
<ul ng-if="box.list">
<li ng-repeat="i in box.list">{{"{{ i }}"}}</li>
</ul>
<button class="btn btn-sm btn-success" ng-if="box.yes || box.no" ng-click="box.yes()">Yes</button>
<button class="btn btn-sm btn-danger" ng-if="box.yes || box.no" ng-click="box.no()">No</button>
</div>
</div>
<div class="container" ng-view></div>
<script src="/js/jquery.min.js"></script>
<script src="/js/popper.min.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/angular.min.js"></script>
<script src="/js/angular-route.min.js"></script>
<script src="/js/angular-sanitize.min.js"></script>
</body>
</html>
`
func Index(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "text/html")
if indexTmpl, err := template.New("index").Parse(indextpl); err != nil {
http.Error(w, "Cannot create template: "+err.Error(), http.StatusInternalServerError)
} else if err := indexTmpl.Execute(w, nil); err != nil {
http.Error(w, "An error occurs during template execution: "+err.Error(), http.StatusInternalServerError)
}
}

View File

@ -75,7 +75,6 @@ func main() {
log.Println("Registering handlers...")
mux := http.NewServeMux()
mux.HandleFunc("/", Index)
mux.Handle("/login", lc)
mux.HandleFunc("/logout", logout)
http.HandleFunc("/", mux.ServeHTTP)
@ -94,9 +93,7 @@ func main() {
if lc.students, err = readStudentsList(studentsFile); err != nil {
log.Println("Error during students.csv reload:", err)
}
case syscall.SIGTERM:
break mloop;
case syscall.SIGINT:
case syscall.SIGTERM, syscall.SIGINT:
break mloop;
}
}