Projet

Général

Profil

Révision 54800558 src/app/settings/settings.component.ts

Voir les différences:

src/app/settings/settings.component.ts
48 48
        this.serverURI = getString("serverURI", "");
49 49

  
50 50
        //On recupere les infos serveurs et en particulier la liste des serveurs disponibles
51
        getJSON("https://clicalbum.abuledu.net/api.php").then((r: any) => {
52
            console.log("getJSON : ", r);
53
            this.serverJSON = r;
54
            let i = 0;
55
            r.servers.forEach(element => {
56
                console.log(" json element : ", element.name);
57
                let option = new RadioOption(element.label, element.uri);
58
                this.radioOptions.push(option);
59
                if (i == 0) {
60
                    console.log(" premier element on le checked : ", element.label);
61
                    this.serverLabel = element.label;
62
                    this.serverName = element.label;
63
                    this.serverURI = element.uri;
64
                    option.selected = true;
65
                }
66
                i++;
67
            });
68
        }, (e) => {
69
            console.log("getJSON Error", e);
51
        this.serverJSON = JSON.parse(getString("serverJSON"));
52

  
53
        let i = 0;
54
        this.serverJSON['servers'].forEach(element => {
55
            console.log(" JSON element : ", element.name);
56
            let option = new RadioOption(element.label, element.uri);
57
            this.radioOptions.push(option);
58
            if (i == 0) {
59
                console.log(" Premier element on le checked : ", element.label);
60
                this.serverLabel = element.label;
61
                this.serverName = element.label;
62
                this.serverURI = element.uri;
63
                option.selected = true;
64
            }
65
            i++;
70 66
        });
71 67
    }
72 68

  

Formats disponibles : Unified diff

Redmine Appliance - Powered by TurnKey Linux