mirror of
https://github.com/UnickSoft/graphonline.git
synced 2026-06-18 14:50:59 +00:00
Fixes to run from sub-directory.
This commit is contained in:
@@ -17,7 +17,7 @@ Server side:
|
|||||||
|
|
||||||
# How to run
|
# How to run
|
||||||
|
|
||||||
1. Download repository to local website folder. It should be placed into root of domen. It can work wrong from subdirectory.
|
1. Download repository to local website folder. It should be placed into root of domen. If you want to run graphonline from subdirectory read "Additional steps to run from subdirectory" below.
|
||||||
2. Change access rights of directory /tmp. PHP scripts need to create and modify files inside it.
|
2. Change access rights of directory /tmp. PHP scripts need to create and modify files inside it.
|
||||||
3. Run file from browser: /script/merge.php. It merges all js files into one /script/example.js.
|
3. Run file from browser: /script/merge.php. It merges all js files into one /script/example.js.
|
||||||
4. Run file from browser: /cgi-bin/getPluginsList.php?reset. It creates file with list of plug-ins. Just optimization.
|
4. Run file from browser: /cgi-bin/getPluginsList.php?reset. It creates file with list of plug-ins. Just optimization.
|
||||||
@@ -46,6 +46,24 @@ In files:
|
|||||||
|
|
||||||
8. Some algorithms use binary CGI file (short-path, Eulerian cycle/path and so on). If you want to run them, you need to compile GraphOffline util: https://github.com/UnickSoft/GraphOffline. And place it with name /cgi-bin/GraphCGI.exe
|
8. Some algorithms use binary CGI file (short-path, Eulerian cycle/path and so on). If you want to run them, you need to compile GraphOffline util: https://github.com/UnickSoft/GraphOffline. And place it with name /cgi-bin/GraphCGI.exe
|
||||||
|
|
||||||
|
# Additional steps to run from subdirectory:
|
||||||
|
|
||||||
|
For example you place graphonline sources into http://localhost/graph/ directory.
|
||||||
|
|
||||||
|
1. Edit .htaccess change RewriteRule to line:
|
||||||
|
```
|
||||||
|
RewriteRule ^(.*)$ /graph/index.php?q=$1 [L,QSA]
|
||||||
|
```
|
||||||
|
2. Write your directory name to script\main.j variable SiteDirs:
|
||||||
|
```
|
||||||
|
var SiteDir = "graph/";
|
||||||
|
```
|
||||||
|
3. Write your directory to core config core\config\main.php in line SITE_IN_DIR:
|
||||||
|
```
|
||||||
|
define('SITE_IN_DIR', 'graph');
|
||||||
|
```
|
||||||
|
4. Run merge.php to apply changes. Run http://localhost/graph/script/merge.php
|
||||||
|
|
||||||
# 3th-party
|
# 3th-party
|
||||||
|
|
||||||
1. Micron (http://zmicron.itkd.ru/) is our engine.
|
1. Micron (http://zmicron.itkd.ru/) is our engine.
|
||||||
|
|||||||
@@ -163,7 +163,7 @@ BaseAlgorithmEx.prototype.CalculateAlgorithm = function(queryString, resultCallb
|
|||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/cgi-bin/GraphCGI.exe?" + queryString,
|
url: "/" + SiteDir + "cgi-bin/GraphCGI.exe?" + queryString,
|
||||||
data: xml,
|
data: xml,
|
||||||
dataType: "text",
|
dataType: "text",
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -497,7 +497,7 @@ Application.prototype.FindPath = function(graph1, graph2)
|
|||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/cgi-bin/GraphCGI.exe?dsp=cgiInput&start=" + graph1.id + "&finish=" + graph2.id + "&report=xml",
|
url: "/" + SiteDir + "cgi-bin/GraphCGI.exe?dsp=cgiInput&start=" + graph1.id + "&finish=" + graph2.id + "&report=xml",
|
||||||
data: creator.GetXMLString(),
|
data: creator.GetXMLString(),
|
||||||
dataType: "text"
|
dataType: "text"
|
||||||
})
|
})
|
||||||
@@ -778,7 +778,7 @@ Application.prototype.SetAdjacencyMatrix = function (matrix, separator)
|
|||||||
var c = {};
|
var c = {};
|
||||||
if (!this.TestAdjacencyMatrix(matrix, r, c, separator))
|
if (!this.TestAdjacencyMatrix(matrix, r, c, separator))
|
||||||
{
|
{
|
||||||
$.get( "/cgi-bin/addFailedMatrix.php?text=adjacency&matrix=" + encodeURIComponent(matrix), function( data ) {;});
|
$.get( "/" + SiteDir + "cgi-bin/addFailedMatrix.php?text=adjacency&matrix=" + encodeURIComponent(matrix), function( data ) {;});
|
||||||
res = false;
|
res = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -806,7 +806,7 @@ Application.prototype.SetIncidenceMatrix = function (matrix)
|
|||||||
var c = {};
|
var c = {};
|
||||||
if (!this.TestIncidenceMatrix(matrix, r, c))
|
if (!this.TestIncidenceMatrix(matrix, r, c))
|
||||||
{
|
{
|
||||||
$.get( "/cgi-bin/addFailedMatrix.php?text=incidence&matrix=" + encodeURIComponent(matrix), function( data ) {;});
|
$.get( "/" + SiteDir + "cgi-bin/addFailedMatrix.php?text=incidence&matrix=" + encodeURIComponent(matrix), function( data ) {;});
|
||||||
res = false;
|
res = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -880,7 +880,7 @@ Application.prototype.SaveGraphOnDisk = function ()
|
|||||||
var app = this;
|
var app = this;
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/cgi-bin/saveGraph.php?name=" + this.savedGraphName,
|
url: "/" + SiteDir + "cgi-bin/saveGraph.php?name=" + this.savedGraphName,
|
||||||
data: graphAsString,
|
data: graphAsString,
|
||||||
dataType: "text"
|
dataType: "text"
|
||||||
})
|
})
|
||||||
@@ -918,7 +918,7 @@ Application.prototype.SaveGraphImageOnDisk = function (showDialogCallback)
|
|||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/cgi-bin/saveImage.php?name=" + imageName + rectParams,
|
url: "/" + SiteDir + "cgi-bin/saveImage.php?name=" + imageName + rectParams,
|
||||||
data: {
|
data: {
|
||||||
base64data : imageBase64Data
|
base64data : imageBase64Data
|
||||||
},
|
},
|
||||||
@@ -947,7 +947,7 @@ Application.prototype.SaveFullGraphImageOnDisk = function (showDialogCallback, f
|
|||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: "/cgi-bin/saveImage.php?name=" + imageName + rectParams,
|
url: "/" + SiteDir + "cgi-bin/saveImage.php?name=" + imageName + rectParams,
|
||||||
data: {
|
data: {
|
||||||
base64data : imageBase64Data
|
base64data : imageBase64Data
|
||||||
},
|
},
|
||||||
@@ -977,7 +977,7 @@ Application.prototype.LoadGraphFromDisk = function (graphName)
|
|||||||
|
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: "/cgi-bin/loadGraph.php?name=" + graphName
|
url: "/" + SiteDir + "cgi-bin/loadGraph.php?name=" + graphName
|
||||||
})
|
})
|
||||||
.done(function( msg )
|
.done(function( msg )
|
||||||
{
|
{
|
||||||
|
|||||||
+6
-3
@@ -1,3 +1,6 @@
|
|||||||
|
|
||||||
|
var SiteDir = "";
|
||||||
|
|
||||||
var application = new Application(document, window);
|
var application = new Application(document, window);
|
||||||
|
|
||||||
var waitCounter = false;
|
var waitCounter = false;
|
||||||
@@ -548,7 +551,7 @@ function postLoadPage()
|
|||||||
console.log("Vote" + this["voteIndex"]);
|
console.log("Vote" + this["voteIndex"]);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: "/cgi-bin/vote.php?index=" + this["voteIndex"],
|
url: "/" + SiteDir + "cgi-bin/vote.php?index=" + this["voteIndex"],
|
||||||
dataType: "text"
|
dataType: "text"
|
||||||
});
|
});
|
||||||
$("#voteDialog").dialog('close');
|
$("#voteDialog").dialog('close');
|
||||||
@@ -572,7 +575,7 @@ function postLoadPage()
|
|||||||
|
|
||||||
|
|
||||||
// Get algorithms list and load it.
|
// Get algorithms list and load it.
|
||||||
$.get( "/cgi-bin/getPluginsList.php",
|
$.get( "/" + SiteDir + "cgi-bin/getPluginsList.php",
|
||||||
function( data )
|
function( data )
|
||||||
{
|
{
|
||||||
var scriptList = JSON.parse(data);
|
var scriptList = JSON.parse(data);
|
||||||
@@ -586,7 +589,7 @@ function postLoadPage()
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
var script = document.createElement('script');
|
var script = document.createElement('script');
|
||||||
script.src = scriptList[0];
|
script.src = "/" + SiteDir + "script/" + scriptList[0];
|
||||||
scriptList.shift();
|
scriptList.shift();
|
||||||
script.onload = loadOneScript;
|
script.onload = loadOneScript;
|
||||||
script.onerror = loadOneScript;
|
script.onerror = loadOneScript;
|
||||||
|
|||||||
@@ -69,7 +69,7 @@ NeedAlgorithm.prototype.result = function(resultCallback)
|
|||||||
console.log("Vote" + this["voteIndex"]);
|
console.log("Vote" + this["voteIndex"]);
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "GET",
|
type: "GET",
|
||||||
url: "/cgi-bin/vote.php?index=" + this["voteIndex"],
|
url: "/" + SiteDir + "cgi-bin/vote.php?index=" + this["voteIndex"],
|
||||||
dataType: "text"
|
dataType: "text"
|
||||||
});
|
});
|
||||||
$("#voteDialog").dialog('close');
|
$("#voteDialog").dialog('close');
|
||||||
|
|||||||
Reference in New Issue
Block a user