|
|
@ -2,17 +2,19 @@ |
|
|
|
using System.Text; |
|
|
|
using System.Text; |
|
|
|
using System.Windows.Input; |
|
|
|
using System.Windows.Input; |
|
|
|
using HandyControl.Controls; |
|
|
|
using HandyControl.Controls; |
|
|
|
|
|
|
|
using log4net; |
|
|
|
using Microsoft.Data.Sqlite; |
|
|
|
using Microsoft.Data.Sqlite; |
|
|
|
using Newtonsoft.Json; |
|
|
|
using Newtonsoft.Json; |
|
|
|
using Newtonsoft.Json.Linq; |
|
|
|
using Newtonsoft.Json.Linq; |
|
|
|
using SparkClient.Model.Entity; |
|
|
|
using SparkClient.Model.Entity; |
|
|
|
using SparkClient.Model.Helper; |
|
|
|
using SparkClient.Model.Helper; |
|
|
|
using SparkClient.ViewModel.Configuration.SettingsPages; |
|
|
|
using SparkClient.ViewModel.Configuration.SettingsPages; |
|
|
|
|
|
|
|
using MessageBox = SparkClient.Views.Dialog.MessageBox; |
|
|
|
namespace SparkClient.ViewModel.Configuration; |
|
|
|
namespace SparkClient.ViewModel.Configuration; |
|
|
|
|
|
|
|
|
|
|
|
public class AlgorithmConfigVM : BaseViewModel |
|
|
|
public class AlgorithmConfigVM : BaseViewModel |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
private static readonly ILog Logger = LogManager.GetLogger(typeof(AlgorithmConfigVM)); |
|
|
|
public ICommand SaveAlgorithmDataCommand { get; } |
|
|
|
public ICommand SaveAlgorithmDataCommand { get; } |
|
|
|
public ICommand BeautifyJsonCommand { get; } |
|
|
|
public ICommand BeautifyJsonCommand { get; } |
|
|
|
public ICommand UglifyJsonCommand { get; } |
|
|
|
public ICommand UglifyJsonCommand { get; } |
|
|
@ -60,6 +62,8 @@ public class AlgorithmConfigVM : BaseViewModel |
|
|
|
/// </summary> |
|
|
|
/// </summary> |
|
|
|
/// <param name="param"></param> |
|
|
|
/// <param name="param"></param> |
|
|
|
public void SaveAlgorithmData(object param) |
|
|
|
public void SaveAlgorithmData(object param) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
try |
|
|
|
{ |
|
|
|
{ |
|
|
|
DataBaseHelper.BeginTransaction(); |
|
|
|
DataBaseHelper.BeginTransaction(); |
|
|
|
string temp = JsonConvert.SerializeObject(JsonConvert.DeserializeObject(AlgorithmConfigJson)); |
|
|
|
string temp = JsonConvert.SerializeObject(JsonConvert.DeserializeObject(AlgorithmConfigJson)); |
|
|
@ -111,6 +115,12 @@ public class AlgorithmConfigVM : BaseViewModel |
|
|
|
DataBaseHelper.rollback(); |
|
|
|
DataBaseHelper.rollback(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
catch (Exception ex) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Growl.Error(MultilingualHelper.getString("SaveFail")); |
|
|
|
|
|
|
|
Logger.Error(ex); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
private void IsEnabledByRole (){ |
|
|
|
private void IsEnabledByRole (){ |
|
|
|
string PERMISSIONS = Settings.SelectValueByName("PERMISSIONS"); |
|
|
|
string PERMISSIONS = Settings.SelectValueByName("PERMISSIONS"); |
|
|
|
if ("admin".Equals(PERMISSIONS)) |
|
|
|
if ("admin".Equals(PERMISSIONS)) |
|
|
|