Jellyfin.Plugin.Webdav/Configuration/configPage.html
copyrights 2811ed4aad The WebDAV integration plugin (Jellyfin.Plugin.Webdav) has been scaffolded according to the approved plan:
• Project renamed and updated (Jellyfin.Plugin.Webdav.csproj) with WebDav.Client reference

• Plugin.cs set to “WebDAV” with the new GUID

• Configuration/PluginConfiguration.cs defines the connection and cache settings

• ServiceRegistrator.cs wires DI for WebDavClientService and the WebDavSyncService hosted service

• WebDavClientService.cs wraps WebDav.Client for directory listing and streaming

• WebDavSyncService.cs syncs remote files into a local cache and registers it as a virtual folder

• StreamingController.cs exposes /WebDav/Stream/{*path} for streaming

• Configuration/configPage.html implements the dashboard configuration UI

Next step: build and deploy the plugin to your Jellyfin server’s plugins folder.
2025-04-19 21:59:22 +02:00

82 lines
4.4 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>WebDAV Configuration</title>
</head>
<body>
<div id="WebdavConfigPage" data-role="page" class="page type-interior pluginConfigurationPage" data-require="emby-input,emby-button,emby-checkbox">
<div data-role="content">
<div class="content-primary">
<form id="WebdavConfigForm">
<div class="inputContainer">
<label class="inputLabel" for="BaseUrl">WebDAV URL</label>
<input id="BaseUrl" name="BaseUrl" type="text" is="emby-input" />
</div>
<div class="inputContainer">
<label class="inputLabel" for="Username">Username</label>
<input id="Username" name="Username" type="text" is="emby-input" />
</div>
<div class="inputContainer">
<label class="inputLabel" for="Password">Password</label>
<input id="Password" name="Password" type="password" is="emby-input" />
</div>
<div class="inputContainer">
<label class="inputLabel" for="RootPath">Root Path</label>
<input id="RootPath" name="RootPath" type="text" is="emby-input" />
</div>
<div class="inputContainer">
<label class="inputLabel" for="CacheDirectory">Cache Directory</label>
<input id="CacheDirectory" name="CacheDirectory" type="text" is="emby-input" />
</div>
<div class="inputContainer">
<label class="inputLabel" for="CacheSizeMb">Cache Size (MB)</label>
<input id="CacheSizeMb" name="CacheSizeMb" type="number" is="emby-input" min="0" />
</div>
<div>
<button is="emby-button" type="submit" class="raised button-submit block emby-button">
<span>Save</span>
</button>
</div>
</form>
</div>
</div>
<script type="text/javascript">
var Config = {
pluginUniqueId: '5db89aeb-14ad-450b-bcf2-ae235ebbe299'
};
document.querySelector('#WebdavConfigPage')
.addEventListener('pageshow', function() {
Dashboard.showLoadingMsg();
ApiClient.getPluginConfiguration(Config.pluginUniqueId).then(function (config) {
document.querySelector('#BaseUrl').value = config.BaseUrl;
document.querySelector('#Username').value = config.Username;
document.querySelector('#Password').value = config.Password;
document.querySelector('#RootPath').value = config.RootPath;
document.querySelector('#CacheDirectory').value = config.CacheDirectory;
document.querySelector('#CacheSizeMb').value = config.CacheSizeMb;
Dashboard.hideLoadingMsg();
});
});
document.querySelector('#WebdavConfigForm')
.addEventListener('submit', function(e) {
Dashboard.showLoadingMsg();
ApiClient.getPluginConfiguration(Config.pluginUniqueId).then(function (config) {
config.BaseUrl = document.querySelector('#BaseUrl').value;
config.Username = document.querySelector('#Username').value;
config.Password = document.querySelector('#Password').value;
config.RootPath = document.querySelector('#RootPath').value;
config.CacheDirectory = document.querySelector('#CacheDirectory').value;
config.CacheSizeMb = parseInt(document.querySelector('#CacheSizeMb').value, 10);
ApiClient.updatePluginConfiguration(Config.pluginUniqueId, config).then(function (result) {
Dashboard.processPluginConfigurationUpdateResult(result);
});
});
e.preventDefault();
return false;
});
</script>
</div>
</body>
</html>