mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-14 17:26:22 +01:00
added global variable for restUrl
This commit is contained in:
@@ -10,3 +10,5 @@ var repositoryTypeStore = new Ext.data.ArrayStore({
|
|||||||
fields: [ 'name', 'type' ],
|
fields: [ 'name', 'type' ],
|
||||||
data: repositoryTypes
|
data: repositoryTypes
|
||||||
});
|
});
|
||||||
|
|
||||||
|
var restUrl = "api/rest/";
|
||||||
@@ -20,20 +20,20 @@ function removeGroup(){
|
|||||||
console.debug( 'remove group ' + group );
|
console.debug( 'remove group ' + group );
|
||||||
|
|
||||||
Ext.MessageBox.show({
|
Ext.MessageBox.show({
|
||||||
title: "Remove Group",
|
title: 'Remove Group',
|
||||||
msg: "Remove Group '" + group + "'?",
|
msg: 'Remove Group "' + group + '"?',
|
||||||
buttons: Ext.MessageBox.OKCANCEL,
|
buttons: Ext.MessageBox.OKCANCEL,
|
||||||
icon: Ext.MessageBox.QUESTION,
|
icon: Ext.MessageBox.QUESTION,
|
||||||
fn: function(result){
|
fn: function(result){
|
||||||
if ( result == "ok" ){
|
if ( result == 'ok' ){
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
url: 'api/rest/groups/' + group + ".json",
|
url: restUrl + 'groups/' + group + '.json',
|
||||||
method: 'DELETE',
|
method: 'DELETE',
|
||||||
success: function(){
|
success: function(){
|
||||||
groupStore.reload();
|
groupStore.reload();
|
||||||
},
|
},
|
||||||
failure: function(){
|
failure: function(){
|
||||||
alert("ERROR!!!")
|
alert('ERROR!!!')
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -78,7 +78,7 @@ var groupToolbar = new Ext.Toolbar({
|
|||||||
specialkey: function(field, e){
|
specialkey: function(field, e){
|
||||||
if (e.getKey() == e.ENTER) {
|
if (e.getKey() == e.ENTER) {
|
||||||
var value = this.getValue();
|
var value = this.getValue();
|
||||||
console.log( "Filter: " + value );
|
console.log( 'Filter: ' + value );
|
||||||
// TODO filter by member
|
// TODO filter by member
|
||||||
groupStore.filter('name', new RegExp('.*' + value + '.*'));
|
groupStore.filter('name', new RegExp('.*' + value + '.*'));
|
||||||
}
|
}
|
||||||
@@ -99,10 +99,10 @@ var groupSelModel = new Ext.grid.RowSelectionModel({
|
|||||||
});
|
});
|
||||||
|
|
||||||
var groupStore = new Ext.data.JsonStore({
|
var groupStore = new Ext.data.JsonStore({
|
||||||
url: 'api/rest/groups.json',
|
url: restUrl + 'groups.json',
|
||||||
root: 'groups',
|
root: 'groups',
|
||||||
fields: [
|
fields: [
|
||||||
'name', "members"
|
'name', 'members'
|
||||||
],
|
],
|
||||||
sortInfo: {
|
sortInfo: {
|
||||||
field: 'name'
|
field: 'name'
|
||||||
@@ -269,15 +269,15 @@ Sonia.group.AddForm = new Ext.extend(Ext.FormPanel, {
|
|||||||
|
|
||||||
var url = null;
|
var url = null;
|
||||||
if ( this.update ){
|
if ( this.update ){
|
||||||
url = "api/rest/groups/" + this.name + ".json";
|
url = restUrl + 'groups/' + this.name + '.json';
|
||||||
} else {
|
} else {
|
||||||
url = "api/rest/groups.json";
|
url = restUrl + 'groups.json';
|
||||||
}
|
}
|
||||||
|
|
||||||
Ext.Ajax.request({
|
Ext.Ajax.request({
|
||||||
url: url,
|
url: url,
|
||||||
jsonData: group,
|
jsonData: group,
|
||||||
method: this.update ? "PUT" : "POST",
|
method: this.update ? 'PUT' : 'POST',
|
||||||
success: function(){
|
success: function(){
|
||||||
// TODO make this in a nice way
|
// TODO make this in a nice way
|
||||||
groupStore.reload();
|
groupStore.reload();
|
||||||
@@ -287,7 +287,7 @@ Sonia.group.AddForm = new Ext.extend(Ext.FormPanel, {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
failure: function(){
|
failure: function(){
|
||||||
alert( "failure" );
|
alert( 'failure' );
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user