admin: Use relative path to call API

This commit is contained in:
nemunaire 2021-07-21 23:17:47 +02:00
parent 8f1b44e3dd
commit 29607981e4
5 changed files with 87 additions and 87 deletions

View File

@ -63,7 +63,7 @@ const indextpl = `<!DOCTYPE html>
}
</style>
<base href="{{.urlbase}}">
<script src="/js/d3.v3.min.js"></script>
<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">

View File

@ -178,161 +178,161 @@ angular.module("FICApp")
angular.module("FICApp")
.factory("Version", function($resource) {
return $resource("/api/version")
return $resource("api/version")
})
.factory("Timestamp", function($resource) {
return $resource("/api/timestamps.json")
return $resource("api/timestamps.json")
})
.factory("Health", function($resource) {
return $resource("/api/health.json")
return $resource("api/health.json")
})
.factory("Monitor", function($resource) {
return $resource("/api/monitor/:machineId", { machineId: '@id' })
return $resource("api/monitor/:machineId", { machineId: '@id' })
})
.factory("Event", function($resource) {
return $resource("/api/events/:eventId", { eventId: '@id' }, {
return $resource("api/events/:eventId", { eventId: '@id' }, {
'update': {method: 'PUT'},
})
})
.factory("Claim", function($resource) {
return $resource("/api/claims/:claimId", { claimId: '@id' }, {
return $resource("api/claims/:claimId", { claimId: '@id' }, {
'update': {method: 'PUT'},
})
})
.factory("ClaimAssignee", function($resource) {
return $resource("/api/claims-assignees/:assigneeId", { assigneeId: '@id' }, {
return $resource("api/claims-assignees/:assigneeId", { assigneeId: '@id' }, {
'update': {method: 'PUT'},
})
})
.factory("Certificate", function($resource) {
return $resource("/api/certs/:serial", { serial: '@id' }, {
return $resource("api/certs/:serial", { serial: '@id' }, {
'update': {method: 'PUT'},
})
})
.factory("CACertificate", function($resource) {
return $resource("/api/ca/:serial", { serial: '@id' })
return $resource("api/ca/:serial", { serial: '@id' })
})
.factory("File", function($resource) {
return $resource("/api/files/:fileId", { fileId: '@id' })
return $resource("api/files/:fileId", { fileId: '@id' })
})
.factory("ROSettings", function($resource) {
return $resource("/api/settings-ro.json")
return $resource("api/settings-ro.json")
})
.factory("Settings", function($resource) {
return $resource("/api/settings.json", null, {
return $resource("api/settings.json", null, {
'update': {method: 'PUT'},
})
})
.factory("Scene", function($resource) {
return $resource("/api/public/:screenId", { screenId: '@id' }, {
return $resource("api/public/:screenId", { screenId: '@id' }, {
'update': {method: 'PUT'},
})
})
.factory("Team", function($resource) {
return $resource("/api/teams/:teamId", { teamId: '@id' }, {
return $resource("api/teams/:teamId", { teamId: '@id' }, {
'update': {method: 'PUT'},
})
})
.factory("TeamCertificate", function($resource) {
return $resource("/api/teams/:teamId/certificates", { teamId: '@id' })
return $resource("api/teams/:teamId/certificates", { teamId: '@id' })
})
.factory("TeamAssociation", function($resource) {
return $resource("/api/teams/:teamId/associations/:assoc", { teamId: '@teamId', assoc: '@assoc' })
return $resource("api/teams/:teamId/associations/:assoc", { teamId: '@teamId', assoc: '@assoc' })
})
.factory("TeamMember", function($resource) {
return $resource("/api/teams/:teamId/members", { teamId: '@id' }, {
return $resource("api/teams/:teamId/members", { teamId: '@id' }, {
'save': {method: 'PUT'},
})
})
.factory("TeamMy", function($resource) {
return $resource("/api/teams/:teamId/my.json", { teamId: '@id' })
return $resource("api/teams/:teamId/my.json", { teamId: '@id' })
})
.factory("Teams", function($resource) {
return $resource("/api/teams.json")
return $resource("api/teams.json")
})
.factory("TeamHistory", function($resource) {
return $resource("/api/teams/:teamId/history.json", { teamId: '@id' })
return $resource("api/teams/:teamId/history.json", { teamId: '@id' })
})
.factory("TeamScore", function($resource) {
return $resource("/api/teams/:teamId/score-grid.json", { teamId: '@id' })
return $resource("api/teams/:teamId/score-grid.json", { teamId: '@id' })
})
.factory("TeamStats", function($resource) {
return $resource("/api/teams/:teamId/stats.json", { teamId: '@id' })
return $resource("api/teams/:teamId/stats.json", { teamId: '@id' })
})
.factory("TeamPresence", function($resource) {
return $resource("/api/teams/:teamId/tries", { teamId: '@id' })
return $resource("api/teams/:teamId/tries", { teamId: '@id' })
})
.factory("Theme", function($resource) {
return $resource("/api/themes/:themeId", { themeId: '@id' }, {
return $resource("api/themes/:themeId", { themeId: '@id' }, {
update: {method: 'PUT'}
});
})
.factory("Themes", function($resource) {
return $resource("/api/themes.json", null, {
return $resource("api/themes.json", null, {
'get': {method: 'GET'},
})
})
.factory("ThemedExercice", function($resource) {
return $resource("/api/themes/:themeId/exercices/:exerciceId", { themeId: '@id', exerciceId: '@idExercice' }, {
return $resource("api/themes/:themeId/exercices/:exerciceId", { themeId: '@id', exerciceId: '@idExercice' }, {
update: {method: 'PUT'}
})
})
.factory("Exercice", function($resource) {
return $resource("/api/exercices/:exerciceId", { exerciceId: '@id' }, {
return $resource("api/exercices/:exerciceId", { exerciceId: '@id' }, {
update: {method: 'PUT'},
patch: {method: 'PATCH'}
})
})
.factory("ExerciceClaims", function($resource) {
return $resource("/api/exercices/:exerciceId/claims", { exerciceId: '@idExercice'})
return $resource("api/exercices/:exerciceId/claims", { exerciceId: '@idExercice'})
})
.factory("ExerciceTags", function($resource) {
return $resource("/api/exercices/:exerciceId/tags", { exerciceId: '@idExercice'}, {
return $resource("api/exercices/:exerciceId/tags", { exerciceId: '@idExercice'}, {
update: {method: 'PUT'}
})
})
.factory("ExerciceHistory", function($resource) {
return $resource("/api/exercices/:exerciceId/history.json", { exerciceId: '@id' })
return $resource("api/exercices/:exerciceId/history.json", { exerciceId: '@id' })
})
.factory("ExercicesStats", function($resource) {
return $resource("/api/themes/:themeId/exercices_stats.json", { themeId: '@id' })
return $resource("api/themes/:themeId/exercices_stats.json", { themeId: '@id' })
})
.factory("ExerciceStats", function($resource) {
return $resource("/api/exercices/:exerciceId/stats.json", { exerciceId: '@id' })
return $resource("api/exercices/:exerciceId/stats.json", { exerciceId: '@id' })
})
.factory("ExerciceFile", function($resource) {
return $resource("/api/exercices/:exerciceId/files/:fileId", { exerciceId: '@idExercice', fileId: '@id' }, {
return $resource("api/exercices/:exerciceId/files/:fileId", { exerciceId: '@idExercice', fileId: '@id' }, {
update: {method: 'PUT'}
})
})
.factory("ExerciceHint", function($resource) {
return $resource("/api/exercices/:exerciceId/hints/:hintId", { exerciceId: '@idExercice', hintId: '@id' }, {
return $resource("api/exercices/:exerciceId/hints/:hintId", { exerciceId: '@idExercice', hintId: '@id' }, {
update: {method: 'PUT'}
})
})
.factory("ExerciceHintDeps", function($resource) {
return $resource("/api/exercices/:exerciceId/hints/:hintId/dependancies", { exerciceId: '@idExercice', hintId: '@id' })
return $resource("api/exercices/:exerciceId/hints/:hintId/dependancies", { exerciceId: '@idExercice', hintId: '@id' })
})
.factory("ExerciceFlag", function($resource) {
return $resource("/api/exercices/:exerciceId/flags/:flagId", { exerciceId: '@idExercice', flagId: '@id' }, {
return $resource("api/exercices/:exerciceId/flags/:flagId", { exerciceId: '@idExercice', flagId: '@id' }, {
update: {method: 'PUT'}
})
})
.factory("ExerciceFlagChoices", function($resource) {
return $resource("/api/exercices/:exerciceId/flags/:flagId/choices/:choiceId", { exerciceId: '@idExercice', flagId: '@idFlag', choiceId: '@id' }, {
return $resource("api/exercices/:exerciceId/flags/:flagId/choices/:choiceId", { exerciceId: '@idExercice', flagId: '@idFlag', choiceId: '@id' }, {
'update': {method: 'PUT'},
})
})
.factory("ExerciceFlagDeps", function($resource) {
return $resource("/api/exercices/:exerciceId/flags/:flagId/dependancies", { exerciceId: '@idExercice', flagId: '@id' })
return $resource("api/exercices/:exerciceId/flags/:flagId/dependancies", { exerciceId: '@idExercice', flagId: '@id' })
})
.factory("ExerciceMCQFlag", function($resource) {
return $resource("/api/exercices/:exerciceId/quiz/:mcqId", { exerciceId: '@idExercice', mcqId: '@id' }, {
return $resource("api/exercices/:exerciceId/quiz/:mcqId", { exerciceId: '@idExercice', mcqId: '@id' }, {
update: {method: 'PUT'}
})
})
.factory("ExerciceMCQDeps", function($resource) {
return $resource("/api/exercices/:exerciceId/quiz/:mcqId/dependancies", { exerciceId: '@idExercice', mcqId: '@id' })
return $resource("api/exercices/:exerciceId/quiz/:mcqId/dependancies", { exerciceId: '@idExercice', mcqId: '@id' })
});
angular.module("FICApp")
@ -431,7 +431,7 @@ angular.module("FICApp")
.run(function($rootScope, $http, $interval, Settings) {
function refresh() {
$http.get("/api/settings.json").then(function(response) {
$http.get("api/settings.json").then(function(response) {
response.data.start = new Date(response.data.start);
response.data.end = new Date(response.data.end);
response.data.generation = new Date(response.data.generation);
@ -517,7 +517,7 @@ angular.module("FICApp")
refreshSyncReport()
var progressInterval = $interval(function() {
$http.get("/api/sync/deep").then(function(response) {
$http.get("api/sync/deep").then(function(response) {
if (response.data.progress && response.data.progress != 255)
needRefreshSyncReportWhenReady = true;
else if (needRefreshSyncReportWhenReady)
@ -586,7 +586,7 @@ angular.module("FICApp")
$scope.addToast('warning', txts[type], 'Êtes-vous sûr de vouloir continuer ?',
function() {
if (confirm("Êtes-vous vraiment sûr ?\n" + txts[type])) {
$http.post("/api/reset", {"type": type}).then(function(time) {
$http.post("api/reset", {"type": type}).then(function(time) {
$scope.addToast('success', type + 'reseted');
$location.url("/");
}, function(response) {
@ -600,10 +600,10 @@ angular.module("FICApp")
$scope.deepSync = function(theme) {
if (theme) {
question = 'Faire une synchronisation intégrale du thème ' + theme.name + ' ?'
url = "/api/sync/deep/" + theme.id
url = "api/sync/deep/" + theme.id
} else {
question = 'Faire une synchronisation intégrale ?'
url = "/api/sync/deep"
url = "api/sync/deep"
}
$scope.addToast('warning', question, '',
function() {
@ -621,7 +621,7 @@ angular.module("FICApp")
$scope.addToast('warning', 'Faire une synchronisation profonde rapide, sans s\'occuper des fichiers ?', '',
function() {
$scope.deepSyncInProgress = true;
$http.post("/api/sync/speed").then(function() {
$http.post("api/sync/speed").then(function() {
$scope.deepSyncInProgress = false;
$scope.addToast('success', 'Synchronisation profonde rapide terminée.', '<a href="check_import.html">Voir le rapport</a>.', 15000);
}, function(response) {
@ -699,7 +699,7 @@ angular.module("FICApp")
};
$scope.generateCA = function() {
$http.post("/api/ca/new", $scope.newca).then(function() {
$http.post("api/ca/new", $scope.newca).then(function() {
$scope.ca = CACertificate.get();
}, function(response) {
$scope.addToast('danger', 'An error occurs when generating CA:', response.data.errmsg);
@ -710,21 +710,21 @@ angular.module("FICApp")
};
$scope.generateCert = function() {
$http.post("/api/certs").then(function() {
$http.post("api/certs").then(function() {
$scope.certificates = Certificate.query();
}, function(response) {
$scope.addToast('danger', 'An error occurs when generating certificate:', response.data.errmsg);
});
};
$scope.generateHtpasswd = function() {
$http.post("/api/htpasswd").then(function() {
$http.post("api/htpasswd").then(function() {
$scope.addToast('success', 'Fichier htpasswd généré avec succès');
}, function(response) {
$scope.addToast('danger', 'An error occurs when generating htpasswd file:', response.data.errmsg);
});
};
$scope.removeHtpasswd = function() {
$http.delete("/api/htpasswd").then(function() {
$http.delete("api/htpasswd").then(function() {
$scope.addToast('success', 'Fichier htpasswd supprimé avec succès');
}, function(response) {
$scope.addToast('danger', 'An error occurs when deleting htpasswd file:', response.data.errmsg);
@ -1078,7 +1078,7 @@ angular.module("FICApp")
};
$scope.checksum = function(f) {
$http({
url: "/api/files/" + f.id + "/check",
url: "api/files/" + f.id + "/check",
method: "POST"
}).then(function(response) {
f.err = true;
@ -1235,7 +1235,7 @@ angular.module("FICApp")
})
.controller("ClaimLastUpdateController", function($scope, $http) {
$scope.init = function(claim) {
$http.get("/api/claims/" + claim.id + "/last_update").then(function(response) {
$http.get("api/claims/" + claim.id + "/last_update").then(function(response) {
if (response.data)
$scope.last_update = response.data;
else
@ -1301,7 +1301,7 @@ angular.module("FICApp")
}
$scope.updateDescription = function(description) {
$http({
url: "/api/claims/" + $scope.claim.id + "/descriptions",
url: "api/claims/" + $scope.claim.id + "/descriptions",
method: "PUT",
data: description
}).then(function(response) {
@ -1314,7 +1314,7 @@ angular.module("FICApp")
}
$scope.saveDescription = function() {
$http({
url: "/api/claims/" + $scope.claim.id,
url: "api/claims/" + $scope.claim.id,
method: "POST",
data: {
"id_assignee": $scope.whoami,
@ -1387,7 +1387,7 @@ angular.module("FICApp")
$scope.sync = function() {
$scope.inSync = true;
$http({
url: "/api/sync/themes",
url: "api/sync/themes",
method: "POST"
}).then(function(response) {
$scope.inSync = false;
@ -1429,7 +1429,7 @@ angular.module("FICApp")
.controller("AllExercicesListController", function($scope, Exercice, Theme, $routeParams, $location, $rootScope, $http, $filter) {
$http({
url: "/api/themes.json",
url: "api/themes.json",
method: "GET"
}).then(function(response) {
$scope.themes = response.data
@ -1504,11 +1504,11 @@ angular.module("FICApp")
angular.forEach($scope.exercices, function(ex) {
if ($scope.syncFiles)
work.push("/api/sync/exercices/" + ex.id + "/files");
work.push("api/sync/exercices/" + ex.id + "/files");
if ($scope.syncHints)
work.push("/api/sync/exercices/" + ex.id + "/hints");
work.push("api/sync/exercices/" + ex.id + "/hints");
if ($scope.syncFlags)
work.push("/api/sync/exercices/" + ex.id + "/flags");
work.push("api/sync/exercices/" + ex.id + "/flags");
});
$scope.total = work.length;
go();
@ -1530,7 +1530,7 @@ angular.module("FICApp")
$scope.syncExo = function() {
$scope.inSync = true;
$http({
url: "/api/sync/themes/" + $scope.theme.id + "/exercices",
url: "api/sync/themes/" + $scope.theme.id + "/exercices",
method: "POST"
}).then(function(response) {
$scope.inSync = false;
@ -1553,7 +1553,7 @@ angular.module("FICApp")
$scope.exercice = Exercice.get({ exerciceId: $routeParams.exerciceId });
}
$http({
url: "/api/themes.json",
url: "api/themes.json",
method: "GET"
}).then(function(response) {
$scope.themes = response.data
@ -1574,7 +1574,7 @@ angular.module("FICApp")
$scope.syncExo = function() {
$scope.inSync = true;
$http({
url: "/api/sync/themes/" + $scope.exercice.id_theme + "/exercices/" + $routeParams.exerciceId,
url: "api/sync/themes/" + $scope.exercice.id_theme + "/exercices/" + $routeParams.exerciceId,
method: "POST"
}).then(function(response) {
$scope.inSync = false;
@ -1666,7 +1666,7 @@ angular.module("FICApp")
};
if (target) {
$http({
url: "/api/exercices/" + $routeParams.exerciceId + "/history.json",
url: "api/exercices/" + $routeParams.exerciceId + "/history.json",
method: "PATCH",
data: target
}).then(function(response) {
@ -1680,7 +1680,7 @@ angular.module("FICApp")
}
$scope.delHistory = function(row) {
$http({
url: "/api/exercices/" + $routeParams.exerciceId + "/history.json",
url: "api/exercices/" + $routeParams.exerciceId + "/history.json",
method: "DELETE",
data: row
}).then(function(response) {
@ -1704,7 +1704,7 @@ angular.module("FICApp")
}
$scope.deleteFileDep = function() {
$http({
url: "/api//files/" + this.file.id + "/dependancies/" + this.dep.id,
url: "api//files/" + this.file.id + "/dependancies/" + this.dep.id,
method: "DELETE"
}).then(function(response) {
$scope.files = ExerciceFile.query({ exerciceId: $routeParams.exerciceId });
@ -1722,7 +1722,7 @@ angular.module("FICApp")
$scope.syncFiles = function() {
$scope.inSync = true;
$http({
url: "/api/sync/exercices/" + $routeParams.exerciceId + "/files",
url: "api/sync/exercices/" + $routeParams.exerciceId + "/files",
method: "POST"
}).then(function(response) {
$scope.inSync = false;
@ -1765,7 +1765,7 @@ angular.module("FICApp")
$scope.syncHints = function() {
$scope.inSync = true;
$http({
url: "/api/sync/exercices/" + $routeParams.exerciceId + "/hints",
url: "api/sync/exercices/" + $routeParams.exerciceId + "/hints",
method: "POST"
}).then(function(response) {
$scope.inSync = false;
@ -1830,7 +1830,7 @@ angular.module("FICApp")
if (flag.test_str) {
$http({
url: "/api/exercices/" + $routeParams.exerciceId + "/flags/" + flag.id + "/try",
url: "api/exercices/" + $routeParams.exerciceId + "/flags/" + flag.id + "/try",
data: {"flag": flag.test_str},
method: "POST"
}).then(function(response) {
@ -1846,7 +1846,7 @@ angular.module("FICApp")
$scope.syncFlags = function() {
$scope.inSync = true;
$http({
url: "/api/sync/exercices/" + $routeParams.exerciceId + "/flags",
url: "api/sync/exercices/" + $routeParams.exerciceId + "/flags",
method: "POST"
}).then(function(response) {
$scope.inSync = false;
@ -1962,7 +1962,7 @@ angular.module("FICApp")
};
$scope.desactiveTeams = function() {
$http.post("/api/disableinactiveteams").then(function() {
$http.post("api/disableinactiveteams").then(function() {
$scope.teams = Team.query();
}, function(response) {
$scope.addToast('danger', 'An error occurs when disabling inactive teams:', response.data.errmsg);
@ -2032,7 +2032,7 @@ angular.module("FICApp")
$scope.dissociateCertificate = function(certificate) {
$http({
url: "/api/certs/" + certificate.id,
url: "api/certs/" + certificate.id,
method: "PUT",
data: {
id_team: null
@ -2087,7 +2087,7 @@ angular.module("FICApp")
};
if (target) {
$http({
url: "/api/exercices/" + $("#updHistory").data("primary") + "/history.json",
url: "api/exercices/" + $("#updHistory").data("primary") + "/history.json",
method: "PATCH",
data: target
}).then(function(response) {
@ -2101,7 +2101,7 @@ angular.module("FICApp")
}
$scope.delHistory = function(row) {
$http({
url: "/api/teams/" + $routeParams.teamId + "/history.json",
url: "api/teams/" + $routeParams.teamId + "/history.json",
method: "DELETE",
data: row
}).then(function(response) {

View File

@ -1 +1 @@
../../frontend/static/fonts/
../../admin/static/fonts/

View File

@ -535,8 +535,8 @@
<div class="carousel-inner" style="height: inherit">
<div class="carousel-item">
<div class="carousel-caption" style="display: table; width: 100%">
<a href="http://www.epita.fr/" class="align-middle text-center" style="display: table-cell; width: 55%"><img src="/img/epita.png" alt="Epita" style="height:100px"></a>
<a href="http://www.epita.fr/" class="align-middle text-center" style="display: table-cell; width: 45%"><img src="/img/comcyber.png" alt="Réserves de cyberdéfense" style="height:100px"></a>
<a href="http://www.epita.fr/" class="align-middle text-center" style="display: table-cell; width: 55%"><img src="img/epita.png" alt="Epita" style="height:100px"></a>
<a href="http://www.epita.fr/" class="align-middle text-center" style="display: table-cell; width: 45%"><img src="img/comcyber.png" alt="Réserves de cyberdéfense" style="height:100px"></a>
</div>
</div>
<div class="carousel-item">
@ -563,7 +563,7 @@
<div class="carousel-item active">
<div class="carousel-caption" style="padding: 5px; display: table;">
<div class="align-middle" style="display: table-cell; width: 30%">
<a href="https://srs.epita.fr/"><img src="/img/srs.png" alt="Laboratoire SRS" style="max-width:100%; max-height:90px"></a>
<a href="https://srs.epita.fr/"><img src="img/srs.png" alt="Laboratoire SRS" style="max-width:100%; max-height:90px"></a>
</div>
<p class="text-bold align-middle" style="font-size: 110%; display: table-cell; width: 70%;">
Les challenges ont été réalisés par les étudiants de la
@ -577,7 +577,7 @@
Avec le parrainage du commandement de la cyberdéfense
</p>
<div class="align-middle" style="display: table-cell; width: 30%">
<img src="/img/comcyber.png" alt="Réserves de cyberdéfense" style="max-width:100%; max-height: 80px">
<img src="img/comcyber.png" alt="Réserves de cyberdéfense" style="max-width:100%; max-height: 80px">
</div>
</div>
</div>

View File

@ -12,7 +12,7 @@ angular.module("FICApp", ["ngSanitize", "ngAnimate"])
ev.since = now - ev.time;
});
$http.get("/events.json").then(function(response) {
$http.get("../events.json").then(function(response) {
// Don't make anything if the page hasn't changed
if ($scope.lasteventsetag != undefined && $scope.lasteventsetag == response.headers()["last-modified"])
return;
@ -90,7 +90,7 @@ angular.module("FICApp", ["ngSanitize", "ngAnimate"])
var refreshSceneInterval = $interval(refreshScene, 900);
var refreshSettings = function() {
$http.get("/settings.json").then(function(response) {
$http.get("../settings.json").then(function(response) {
$rootScope.recvTime(response);
response.data.start = new Date(response.data.start);
response.data.end = new Date(response.data.end);
@ -104,14 +104,14 @@ angular.module("FICApp", ["ngSanitize", "ngAnimate"])
$rootScope.refresh = function() {
$http.get("/my.json").then(function(response) {
$http.get("../my.json").then(function(response) {
if ($scope.lastmyetag != undefined && $scope.lastmyetag == response.headers()["last-modified"])
return;
$scope.lastmyetag = response.headers()["last-modified"];
$scope.my = response.data;
});
$http.get("/settings.json").then(function(response) {
$http.get("../settings.json").then(function(response) {
$rootScope.recvTime(response);
response.data.start = new Date(response.data.start);
response.data.end = new Date(response.data.end);
@ -119,7 +119,7 @@ angular.module("FICApp", ["ngSanitize", "ngAnimate"])
response.data.awards = new Date("2019-01-23T15:00:00Z");
$rootScope.settings = response.data;
});
$http.get("/themes.json").then(function(response) {
$http.get("../themes.json").then(function(response) {
if ($scope.lastthemeetag != undefined && $scope.lastthemeetag == response.headers()["last-modified"])
return;
$scope.lastthemeetag = response.headers()["last-modified"];
@ -139,7 +139,7 @@ angular.module("FICApp", ["ngSanitize", "ngAnimate"])
$scope.max_gain += theme.gain;
}, themes);
});
$http.get("/teams.json").then(function(response) {
$http.get("../teams.json").then(function(response) {
if ($scope.lastteametag != undefined && $scope.lastteametag == response.headers()["last-modified"])
return;
$scope.lastteametag = response.headers()["last-modified"];
@ -165,7 +165,7 @@ angular.module("FICApp", ["ngSanitize", "ngAnimate"])
})
.controller("TeamController", function($scope, $http, $interval) {
$scope.mystats = null;
$http.get("/api/teams/" + $scope.team.id + "/stats.json").then(function(response) {
$http.get("../api/teams/" + $scope.team.id + "/stats.json").then(function(response) {
$scope.mystats = response.data;
});
})
@ -191,7 +191,7 @@ angular.module("FICApp", ["ngSanitize", "ngAnimate"])
$scope.s.params.teams.forEach(function (teamid) {
var deferred = $q.defer();
loopPromises.push(deferred.promise);
d3.json("api/teams/" + teamid + "/score-grid.json", function (rows) {
d3.json("../api/teams/" + teamid + "/score-grid.json", function (rows) {
if (rows == null) return;
rows.sort(function (a,b) { return a.time > b.time ? 1 : -1 })
var nrows = {};