dashboard: In prod, we don't use ../

This commit is contained in:
nemunaire 2023-04-05 16:05:50 +02:00
parent 094deeab51
commit a9ba784e58
1 changed files with 9 additions and 9 deletions

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);
@ -103,7 +103,7 @@ angular.module("FICApp", ["ngSanitize", "ngAnimate"])
var refreshSettingsInterval = $interval(refreshSettings, 4200);
var refreshChallengeInfo = function() {
$http.get("../challenge.json").then(function(response) {
$http.get("./challenge.json").then(function(response) {
$rootScope.challenge = response.data;
});
}
@ -112,14 +112,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);
@ -127,7 +127,7 @@ angular.module("FICApp", ["ngSanitize", "ngAnimate"])
response.data.awards = new Date("2019-01-23T15:30: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"];
@ -147,7 +147,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"];
@ -173,7 +173,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;
});
})
@ -199,7 +199,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 = {};