Commit 2e537f49 authored by JoyJ's avatar JoyJ

add url in setting

parent 72cb05f0
......@@ -13,6 +13,9 @@
<setting name="AuthKey" serializeAs="String">
<value />
</setting>
<setting name="ApiUrl" serializeAs="String">
<value>https://yunomi.mycard.moe</value>
</setting>
</YRP2Video.Properties.Settings>
</userSettings>
</configuration>
\ No newline at end of file
......@@ -34,5 +34,17 @@ namespace YRP2Video.Properties {
this["AuthKey"] = value;
}
}
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Configuration.DefaultSettingValueAttribute("https://yunomi.mycard.moe")]
public string ApiUrl {
get {
return ((string)(this["ApiUrl"]));
}
set {
this["ApiUrl"] = value;
}
}
}
}
......@@ -5,5 +5,8 @@
<Setting Name="AuthKey" Type="System.String" Scope="User">
<Value Profile="(Default)" />
</Setting>
<Setting Name="ApiUrl" Type="System.String" Scope="User">
<Value Profile="(Default)">https://yunomi.mycard.moe</Value>
</Setting>
</Settings>
</SettingsFile>
\ No newline at end of file
......@@ -42,6 +42,8 @@
this.fbdSave = new System.Windows.Forms.FolderBrowserDialog();
this.txtAuthKey = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.txtApiUrl = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.dgvData)).BeginInit();
this.statusStrip1.SuspendLayout();
this.SuspendLayout();
......@@ -53,12 +55,12 @@
| System.Windows.Forms.AnchorStyles.Right)));
this.dgvData.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill;
this.dgvData.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dgvData.Location = new System.Drawing.Point(12, 12);
this.dgvData.Location = new System.Drawing.Point(12, 37);
this.dgvData.Name = "dgvData";
this.dgvData.ReadOnly = true;
this.dgvData.RowTemplate.Height = 23;
this.dgvData.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dgvData.Size = new System.Drawing.Size(960, 509);
this.dgvData.Size = new System.Drawing.Size(960, 484);
this.dgvData.TabIndex = 3;
//
// btnRefresh
......@@ -158,12 +160,31 @@
this.label1.TabIndex = 10;
this.label1.Text = "认证秘钥:";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(12, 13);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(59, 12);
this.label2.TabIndex = 12;
this.label2.Text = "API网址:";
//
// txtApiUrl
//
this.txtApiUrl.Location = new System.Drawing.Point(83, 10);
this.txtApiUrl.Name = "txtApiUrl";
this.txtApiUrl.Size = new System.Drawing.Size(209, 21);
this.txtApiUrl.TabIndex = 11;
this.txtApiUrl.TextChanged += new System.EventHandler(this.txtApiUrl_TextChanged);
//
// YRP2Video
//
this.AllowDrop = true;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(984, 603);
this.Controls.Add(this.label2);
this.Controls.Add(this.txtApiUrl);
this.Controls.Add(this.label1);
this.Controls.Add(this.txtAuthKey);
this.Controls.Add(this.btnDelete);
......@@ -200,6 +221,8 @@
private System.Windows.Forms.FolderBrowserDialog fbdSave;
private System.Windows.Forms.TextBox txtAuthKey;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox txtApiUrl;
}
}
......@@ -126,6 +126,7 @@ new System.IO.Compression.GZipStream(streamReceive, System.IO.Compression.Compre
}
dgvData.DataSource = table;
txtAuthKey.Text = Properties.Settings.Default.AuthKey;
txtApiUrl.Text = Properties.Settings.Default.ApiUrl;
init = true;
}
......@@ -395,7 +396,7 @@ new System.IO.Compression.GZipStream(streamReceive, System.IO.Compression.Compre
{
continue;
}
string url = $"https://yunomi.mycard.moe/video/task?id={id}";
string url = $"{txtApiUrl.Text}/video/task?id={id}";
string json = this.HttpGet(url);
DataRow row = table.Rows[i];
this.RefreshRow(ref row, json);
......@@ -470,6 +471,15 @@ new System.IO.Compression.GZipStream(streamReceive, System.IO.Compression.Compre
Properties.Settings.Default.Save();
}
}
private void txtApiUrl_TextChanged(object sender, EventArgs e)
{
if (init)
{
Properties.Settings.Default.ApiUrl = txtApiUrl.Text;
Properties.Settings.Default.Save();
}
}
}
public class Replay
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment