Simplified debugging of web server with html changes

git-svn-id: https://duplicati.googlecode.com/svn/trunk@1196 59da171f-624f-0410-aa54-27559c288bec
This commit is contained in:
kenneth@hexad.dk
2012-03-31 17:44:21 +00:00
parent 23b8d50815
commit b82acee8a3
2 changed files with 52 additions and 30 deletions
+35 -29
View File
@@ -129,48 +129,54 @@
<ItemGroup>
<None Include="app.config" />
<None Include="Duplicati.snk" />
<None Include="webroot\scripts\app-base.js">
<Content Include="webroot\scripts\app-base.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="webroot\scripts\app-functions.js">
</Content>
<Content Include="webroot\scripts\app-functions.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="webroot\scripts\customized.js">
</Content>
<Content Include="webroot\scripts\customized.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="webroot\scripts\jquery-1.7.1.js">
</Content>
<Content Include="webroot\scripts\jquery-1.7.1.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="webroot\scripts\status-window.js">
</Content>
<Content Include="webroot\scripts\status-window.js">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="webroot\status-window.html">
</Content>
<Content Include="webroot\status-window.html">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="webroot\stylesheets\common.css">
</Content>
<Content Include="webroot\stylesheets\common.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="webroot\stylesheets\customized.css">
</Content>
<Content Include="webroot\stylesheets\customized.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="webroot\stylesheets\jquery-ui-cupertino.css">
</Content>
<Content Include="webroot\stylesheets\jquery-ui-cupertino.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="webroot\stylesheets\jquery-ui.css">
</Content>
<Content Include="webroot\stylesheets\jquery-ui.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="webroot\stylesheets\status-window.css">
</Content>
<Content Include="webroot\stylesheets\status-window.css">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="webroot\gfx\drop-arrow.gif">
</Content>
<Content Include="webroot\gfx\drop-arrow.gif">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Include="webroot\gfx\round-box2.gif" />
<None Include="webroot\gfx\round-box3.gif" />
<None Include="webroot\gfx\round-dot.gif" />
<None Include="webroot\gfx\spinner.gif">
</Content>
<Content Include="webroot\gfx\round-box2.gif">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</Content>
<Content Include="webroot\gfx\round-box3.gif">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="webroot\gfx\round-dot.gif">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<Content Include="webroot\gfx\spinner.gif">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<Content Include="webroot\edit-window.html">
+17 -1
View File
@@ -22,7 +22,23 @@ namespace Duplicati.Server
m_server.Add(new DynamicHandler());
FileModule fh = new FileModule("/", System.IO.Path.Combine(System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location), "webroot"));
string webroot = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location);
#if DEBUG
//For debug we go "../../../.." to get out of "GUI/Duplicati.GUI.TrayIcon/bin/debug"
string tmpwebroot = System.IO.Path.GetFullPath(System.IO.Path.Combine(webroot, "..", "..", "..", ".."));
tmpwebroot = System.IO.Path.Combine(tmpwebroot, "Server");
if (System.IO.Directory.Exists(System.IO.Path.Combine(tmpwebroot, "webroot")))
webroot = tmpwebroot;
else
{
//If we are running the server standalone, we only need to exit "bin/Debug"
tmpwebroot = System.IO.Path.GetFullPath(System.IO.Path.Combine(webroot, "..", ".."));
if (System.IO.Directory.Exists(System.IO.Path.Combine(tmpwebroot, "webroot")))
webroot = tmpwebroot;
}
#endif
FileModule fh = new FileModule("/", System.IO.Path.Combine(webroot, "webroot"));
fh.AddDefaultMimeTypes();
m_server.Add(fh);