Add Description field to backups
This commit is contained in:
@@ -57,6 +57,10 @@ namespace Duplicati.Server.Database
|
||||
/// </summary>
|
||||
public string Name { get; set; }
|
||||
/// <summary>
|
||||
/// The backup description
|
||||
/// </summary>
|
||||
public string Description { get; set; }
|
||||
/// <summary>
|
||||
/// The backup tags
|
||||
/// </summary>
|
||||
public string[] Tags { get; set; }
|
||||
|
||||
@@ -293,11 +293,12 @@ namespace Duplicati.Server.Database
|
||||
(rd) => new Backup() {
|
||||
ID = ConvertToInt64(rd, 0).ToString(),
|
||||
Name = ConvertToString(rd, 1),
|
||||
Tags = (ConvertToString(rd, 2) ?? "").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries),
|
||||
TargetURL = ConvertToString(rd, 3),
|
||||
DBPath = ConvertToString(rd, 4),
|
||||
Description = ConvertToString(rd, 2),
|
||||
Tags = (ConvertToString(rd, 3) ?? "").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries),
|
||||
TargetURL = ConvertToString(rd, 4),
|
||||
DBPath = ConvertToString(rd, 5),
|
||||
},
|
||||
@"SELECT ""ID"", ""Name"", ""Tags"", ""TargetURL"", ""DBPath"" FROM ""Backup"" WHERE ID = ?", id)
|
||||
@"SELECT ""ID"", ""Name"", ""Description"", ""Tags"", ""TargetURL"", ""DBPath"" FROM ""Backup"" WHERE ID = ?", id)
|
||||
.FirstOrDefault();
|
||||
|
||||
if (bk != null)
|
||||
@@ -506,8 +507,8 @@ namespace Duplicati.Server.Database
|
||||
new object[] { long.Parse(item.ID ?? "-1") },
|
||||
new IBackup[] { item },
|
||||
update ?
|
||||
@"UPDATE ""Backup"" SET ""Name""=?, ""Tags""=?, ""TargetURL""=? WHERE ""ID""=?" :
|
||||
@"INSERT INTO ""Backup"" (""Name"", ""Tags"", ""TargetURL"", ""DBPath"") VALUES (?,?,?,?)",
|
||||
@"UPDATE ""Backup"" SET ""Name""=?, ""Description""=?, ""Tags""=?, ""TargetURL""=? WHERE ""ID""=?" :
|
||||
@"INSERT INTO ""Backup"" (""Name"", ""Description"", ""Tags"", ""TargetURL"", ""DBPath"") VALUES (?,?,?,?,?)",
|
||||
(n) => {
|
||||
|
||||
if (n.TargetURL.IndexOf(Duplicati.Server.WebServer.Server.PASSWORD_PLACEHOLDER, StringComparison.Ordinal) >= 0)
|
||||
@@ -517,6 +518,7 @@ namespace Duplicati.Server.Database
|
||||
|
||||
return new object[] {
|
||||
n.Name,
|
||||
n.Description,
|
||||
string.Join(",", n.Tags ?? new string[0]),
|
||||
n.TargetURL,
|
||||
update ? (object)item.ID : (object)n.DBPath
|
||||
@@ -685,11 +687,12 @@ namespace Duplicati.Server.Database
|
||||
(rd) => (IBackup)new Backup() {
|
||||
ID = ConvertToInt64(rd, 0).ToString(),
|
||||
Name = ConvertToString(rd, 1),
|
||||
Tags = (ConvertToString(rd, 2) ?? "").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries),
|
||||
TargetURL = ConvertToString(rd, 3),
|
||||
DBPath = ConvertToString(rd, 4),
|
||||
Description = ConvertToString(rd, 2),
|
||||
Tags = (ConvertToString(rd, 3) ?? "").Split(new char[] { ',' }, StringSplitOptions.RemoveEmptyEntries),
|
||||
TargetURL = ConvertToString(rd, 4),
|
||||
DBPath = ConvertToString(rd, 5),
|
||||
},
|
||||
@"SELECT ""ID"", ""Name"", ""Tags"", ""TargetURL"", ""DBPath"" FROM ""Backup"" ")
|
||||
@"SELECT ""ID"", ""Name"", ""Description"", ""Tags"", ""TargetURL"", ""DBPath"" FROM ""Backup"" ")
|
||||
.ToArray();
|
||||
|
||||
foreach(var n in lst)
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
ALTER TABLE "Backup" ADD COLUMN "Description" TEXT NULL;
|
||||
@@ -9,6 +9,7 @@
|
||||
CREATE TABLE "Backup" (
|
||||
"ID" INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
"Name" TEXT NOT NULL,
|
||||
"Description" TEXT NOT NULL,
|
||||
"Tags" TEXT NOT NULL,
|
||||
"TargetURL" TEXT NOT NULL,
|
||||
"DBPath" TEXT NOT NULL
|
||||
|
||||
@@ -34,6 +34,10 @@ namespace Duplicati.Server.Serialization.Interface
|
||||
/// </summary>
|
||||
string Name { get; set; }
|
||||
/// <summary>
|
||||
/// The backup description
|
||||
/// </summary>
|
||||
string Description { get; set; }
|
||||
/// <summary>
|
||||
/// The backup tags
|
||||
/// </summary>
|
||||
string[] Tags { get; set; }
|
||||
|
||||
@@ -319,6 +319,9 @@
|
||||
<ItemGroup>
|
||||
<Folder Include="webroot\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Database\Database schema\6. Add Description to Backup.sql" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
||||
@@ -37,7 +37,11 @@
|
||||
|
||||
<div class="input text">
|
||||
<label for="name" translate>Name</label>
|
||||
<input type="text" name="name" id="name" ng-model="Backup.Name" placeholder="{{'My Photos' | translate}}"/>
|
||||
<input type="text" name="name" id="name" ng-model="Backup.Name" placeholder="{{'My Photos' | translate}}" />
|
||||
</div>
|
||||
<div class="input textarea">
|
||||
<label for="description" translate>Description</label>
|
||||
<textarea name="description" id="description" ng-model="Backup.Description"></textarea>
|
||||
</div>
|
||||
<div class="input select" ng-hide="SystemInfo.EncryptionModules.length == 0">
|
||||
<label for="encryption" translate>Encryption</label>
|
||||
|
||||
@@ -13,6 +13,11 @@
|
||||
</a>
|
||||
|
||||
<dl class="taskmenu" ng-show="$parent.TaskMenuID == item.Backup.ID">
|
||||
<dt translate>Description:</dt>
|
||||
<dd>
|
||||
{{item.Backup.Description}}
|
||||
</dd>
|
||||
|
||||
<dt translate>Operations:</dt>
|
||||
<dd>
|
||||
<p ng-click="doRun(item.Backup.ID)" translate>Run now</p>
|
||||
|
||||
Reference in New Issue
Block a user