This commit is contained in:
2022-12-05 08:48:37 +03:00
parent 800d788838
commit 09cd00dc66
35 changed files with 642 additions and 142 deletions

75
old/address.ps1 Normal file
View File

@@ -0,0 +1,75 @@
Add-Type @'
using System;
namespace ps.ipam {
public class address {
public int Id { get; set; }
public int SubnetId { get; set; }
public string Ip { get; set; }
public bool IsGateway { get; set; }
public string Description { get; set; }
public string Hostname { get; set; }
public string MAC { get; set; }
public string Owner { get; set; }
public int TagId { get; set; }
public int DeviceId { get; set; }
public string Location { get; set; }
public int Port { get; set; }
public string Note { get; set; }
public DateTime? LastSeen { get; set; }
public bool ExcludePing { get; set; }
public int PTRignore { get; set; }
public int PTR { get; set; }
public string FirewallAddressObject { get; set; }
public DateTime? EditDate { get; set; }
public int CustomerId { get; set; }
public address(
int id,
int subnetId,
string ip,
bool is_gateway,
string description,
string hostname,
string mac,
string owner,
int tag,
int deviceId,
string location,
int port,
string note,
DateTime? lastSeen,
bool excludePing,
int PTRignore,
int PTR,
string firewallAddressObject,
DateTime? editDate,
int customer_id
) {
this.Id = id;
this.SubnetId = subnetId;
this.Ip = ip;
this.IsGateway = is_gateway;
this.Description = description;
this.Hostname = hostname;
this.MAC = mac;
this.Owner = owner;
this.TagId = tag;
this.DeviceId = deviceId;
this.Location = location;
this.Port = port;
this.Note = note;
this.EditDate = lastSeen;
this.ExcludePing = excludePing;
this.PTRignore = PTRignore;
this.PTR = PTR;
this.FirewallAddressObject = firewallAddressObject;
this.EditDate = editDate;
this.CustomerId = customer_id;
}
public override string ToString() {
return this.Ip;
}
}
}
'@

33
old/tag.ps1 Normal file
View File

@@ -0,0 +1,33 @@
class tag {
[int]$id
[string]$Type
[bool]$ShowTag
[System.Drawing.Color]$BGColor
[System.Drawing.Color]$FGColor
[bool]$Compress
[bool]$Locked
[bool]$UpdateTag
tag ([int]$id,[string]$type,[bool]$showTag,[string]$BGColor,[string]$FGColor,[string]$compress,[string]$locked,[bool]$updateTag) {
$this.id = $id
$this.Type = $type
$this.ShowTag = $showTag
$this.BGColor = $BGColor
$this.FGColor = $FGColor
$this.Compress = $this.ToBool($compress)
$this.Locked = $this.ToBool($locked)
$this.UpdateTag = $updateTag
}
[string] ToString() {
return $this.Type
}
hidden [bool]ToBool([string]$str) {
if ($str -eq "Yes") {
return $true
} else {
return $false
}
}
}