Skip to content

Commit

Permalink
- Added service token to basic user settings page
Browse files Browse the repository at this point in the history
- Used pagechanger in more places
  • Loading branch information
rubendel committed Dec 10, 2013
1 parent d69b551 commit 436b027
Show file tree
Hide file tree
Showing 13 changed files with 115 additions and 120 deletions.
2 changes: 2 additions & 0 deletions basicserversettings.html
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@
var othis = this;
othis.change = false;

this.show = function(){};

this.removeDomainButton = function(){
$(this).parent().remove();
othis.change = true;
Expand Down
12 changes: 9 additions & 3 deletions basicusersettings.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
<div class="basicusersettings">
<h3>Basic User Settings</h3>
<div class="alert">
There are no basic user settings yet, but there probably will be in the future.
<label>Service Token</label>
<div class="form-group">
<div class="col-xs-4">
<input type="text" class="tokenInput form-control" disabled="disabled"/>
</div>
</div>
</div>
<script>
function BasicUserSettings() {
function BasicUserSettings(containerDiv, main) {
var othis = this;

this.show = function(){
Global.bimServerApi.call("ServiceInterface", "getUserByUoid", {uoid: main.user.oid}, function(user){
containerDiv.find(".tokenInput").val(user.token);
});
};

this.close = function(){
Expand Down
6 changes: 2 additions & 4 deletions css/bootstrap.min.css

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions extendeddataschemas.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
function ExtendedDataSchemas(main, serversettings) {
var othis = this;

this.show = function(){};

this.close = function(){
};

Expand Down
3 changes: 3 additions & 0 deletions genericpluginsettingslist.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ <h3>Internal Services</h3>
if (configuration.setDefaultMethodName == null) {
$(".genericpluginsettingslist .defaultHeader").hide();
}

this.show = function(){
};

this.pluginClick = function(event) {
if (!$(event.target).is("a, button, span.caret, input")) {
Expand Down
6 changes: 2 additions & 4 deletions js/bootstrap.min.js

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions migrations.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
function Migrations(main, serversettings) {
var othis = this;

this.show = function(){};

this.loadMigrations = function(){
Global.bimServerApi.call("AdminInterface", "getMigrations", {}, function(data){
$(".migrations table tbody tr").remove();
Expand Down
2 changes: 2 additions & 0 deletions modelcheckers.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
function ModelCheckers(main, serversettings) {
var othis = this;

this.show = function(){};

this.close = function(){
};

Expand Down
2 changes: 2 additions & 0 deletions plugins.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
<script>
function Plugins(main, serversettings) {
var othis = this;

this.show = function(){};

this.changeEnabled = function(){
var name = $(this).attr("name");
Expand Down
78 changes: 34 additions & 44 deletions serversettings.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
<div class="row">
<div class="tabbable tabs-left col-md-2">
<ul class="nav nav-tabs" style="width: 100%">
<li><a class="basicServerSettingsLink">Server Settings</a></li>
<li><a class="migrationsLink">Migrations</a></li>
<li><a class="pluginsLink">Plugins</a></li>
<li><a class="webModulesLink">Web Modules</a></li>
<li><a class="extendedDataSchemasLink">Extended Data Schemas</a></li>
<li><a class="modelCheckersLink">Model Checkers</a></li>
<li class="basicServerSettingsLink active"><a>Server Settings</a></li>
<li class="migrationsLink"><a>Migrations</a></li>
<li class="pluginsLink"><a>Plugins</a></li>
<li class="webModulesLink"><a>Web Modules</a></li>
<li class="extendedDataSchemasLink"><a>Extended Data Schemas</a></li>
<li class="modelCheckersLink"><a>Model Checkers</a></li>
</ul>
</div>
<div class="tab-content col-md-10">
Expand All @@ -21,99 +21,89 @@
this.show = function(){
};

this.changePage = function(linkElement, page, constructorFunction, callback) {
if (othis.current != null) {
othis.current.close();
}
$(".serversettings .nav li").removeClass("active");
linkElement.parent().addClass("active");
$(".serversettings .tab-content").load(Global.baseDir + page, function(){
constructorFunction();
if (callback != null) {
callback.call(othis.current);
}
});
};
othis.pageChanger = new PageChanger($(".serversettings .nav"), $(".serversettings .tab-content"));

this.showAddNewExtendedDataSchema = function(extendedDataSchema, callback) {
othis.changePage($(".extendedDataSchemasLink"), "addnewextendeddataschema.html", function(){
othis.current = new AddExtendedDataSchema(main, othis, extendedDataSchema);
othis.pageChanger.changePage($(".extendedDataSchemasLink"), "addnewextendeddataschema.html", function(){
pushHistory({page: "ServerSettings", subpage: "AddNewExtendedDataSchema"}, "Server Settings");
return new AddExtendedDataSchema(main, othis, extendedDataSchema);
}, callback);
};

this.showAddRepoExtendedDataSchema = function(callback) {
othis.changePage($(".extendedDataSchemasLink"), "addrepoextendeddataschema.html", function(){
othis.current = new AddRepoExtendedDataSchema(main, othis);
othis.pageChanger.changePage($(".extendedDataSchemasLink"), "addrepoextendeddataschema.html", function(){
pushHistory({page: "ServerSettings", subpage: "AddRepoExtendedDataSchema"}, "Server Settings");
return new AddRepoExtendedDataSchema(main, othis);
}, callback);
};

this.showAddNewModelChecker = function(modelChecker, callback) {
othis.changePage($(".modelCheckersLink"), "addnewmodelchecker.html", function(){
othis.current = new AddModelChecker(main, othis, modelChecker);
othis.pageChanger.changePage($(".modelCheckersLink"), "addnewmodelchecker.html", function(){
pushHistory({page: "ServerSettings", subpage: "AddNewModelChecker"}, "Server Settings");
return new AddModelChecker(main, othis, modelChecker);
}, callback);
};

this.showAddRepoModelChecker = function(callback) {
othis.changePage($(".modelCheckersLink"), "addrepomodelchecker.html", function(){
othis.current = new AddRepoModelChecker(main, othis);
othis.pageChanger.changePage($(".modelCheckersLink"), "addrepomodelchecker.html", function(){
pushHistory({page: "ServerSettings", subpage: "AddRepoModelChecker"}, "Server Settings");
return new AddRepoModelChecker(main, othis);
}, callback);
};

this.showExtendedDataSchema = function(oid, callback) {
othis.changePage($(".extendedDataSchemasLink"), "extendeddataschema.html", function(){
othis.current = new ExtendedDataSchema(main, oid);
othis.pageChanger.changePage($(".extendedDataSchemasLink"), "extendeddataschema.html", function(){
return new ExtendedDataSchema(main, oid);
pushHistory({page: "ServerSettings", subpage: "ExtendedDataSchema"}, "Extended Data Schema");
}, callback);
};

this.showModelChecker = function(oid, callback) {
othis.changePage($(".modelCheckersLink"), "modelchecker.html", function(){
othis.current = new ModelChecker(main, oid);
othis.pageChanger.changePage($(".modelCheckersLink"), "modelchecker.html", function(){
pushHistory({page: "ServerSettings", subpage: "ModelChecker"}, "Model Checker");
return new ModelChecker(main, oid);
}, callback);
};

this.showBasicServerSettings = function(callback) {
othis.changePage($(".basicServerSettingsLink"), "basicserversettings.html", function(){
othis.current = new BasicServerSettings(main, othis);
pushHistory({page: "ServerSettings", subpage: "BasicServerSettings"}, "Server Settings");
othis.pageChanger.changePage($(".basicServerSettingsLink"), "basicserversettings.html", function(){
pushHistory({page: "ServerSettings", subpage: "BasicServerSettings"}, "Basic Server Settings");
return new BasicServerSettings(main, othis);
}, callback);
};

this.showMigrations = function(callback) {
othis.changePage($(".migrationsLink"), "migrations.html", function(){
othis.current = new Migrations(main, othis);
othis.pageChanger.changePage($(".migrationsLink"), "migrations.html", function(){
pushHistory({page: "ServerSettings", subpage: "Migrations"}, "Server Settings");
return new Migrations(main, othis);
}, callback);
};

this.showPlugins = function(callback) {
othis.changePage($(".pluginsLink"), "plugins.html", function(){
othis.current = new Plugins(main, othis);
othis.pageChanger.changePage($(".pluginsLink"), "plugins.html", function(){
pushHistory({page: "ServerSettings", subpage: "Plugins"}, "Server Settings");
return new Plugins(main, othis);
}, callback);
};

this.showWebModules = function(callback) {
othis.changePage($(".webModulesLink"), "webmodules.html", function(){
othis.current = new WebModules(main, othis);
othis.pageChanger.changePage($(".webModulesLink"), "webmodules.html", function(){
pushHistory({page: "ServerSettings", subpage: "WebModules"}, "Server Settings");
return new WebModules(main, othis);
}, callback);
};

this.showModelCheckers = function(callback) {
othis.changePage($(".modelCheckersLink"), "modelcheckers.html", function(){
othis.current = new ModelCheckers(main, othis);
othis.pageChanger.changePage($(".modelCheckersLink"), "modelcheckers.html", function(){
pushHistory({page: "ServerSettings", subpage: "ModelCheckers"}, "Server Settings");
return new ModelCheckers(main, othis);
}, callback);
};

this.showExtendedDataSchemas = function(callback) {
othis.changePage($(".extendedDataSchemasLink"), "extendeddataschemas.html", function(){
othis.current = new ExtendedDataSchemas(main, othis);
othis.pageChanger.changePage($(".extendedDataSchemasLink"), "extendeddataschemas.html", function(){
pushHistory({page: "ServerSettings", subpage: "ExtendedDataSchemas"}, "Server Settings");
return new ExtendedDataSchemas(main, othis);
}, callback);
};

Expand Down
2 changes: 1 addition & 1 deletion user.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ <h1></h1>
containerDiv.find(".detailsTable").append("<tr><td>Type</td><td><div class=\"ro\">" + formatUserType(othis.user.userType) + "</div><div class=\"w\"><select class=\"form-control usertypeSelect\"><option value=\"ADMIN\">Administrator</option><option value=\"USER\">User</option><option value=\"READ_ONLY\">Read only</option></select></div></td></tr>");
containerDiv.find(".usertypeSelect").val(othis.user.userType);
containerDiv.find(".detailsTable").append("<tr><td>State</td><td>" + othis.user.state + "</td></tr>");
containerDiv.find(".detailsTable").append("<tr><td>Token</td><td>" + othis.user.token + "</td></tr>");
containerDiv.find(".detailsTable").append("<tr><td>Service Token</td><td>" + othis.user.token + "</td></tr>");

Global.bimServerApi.call("ServiceInterface", "getAllCheckoutsByUser", {uoid: othis.user.oid}, function(checkouts){
$(".user .checkoutsLink a").html("Checkouts" + (checkouts == null || checkouts.length == 0 ? "" : (" (" + checkouts.length + ")")));
Expand Down
Loading

0 comments on commit 436b027

Please sign in to comment.