Free cookie consent management tool by TermsFeed Policy Generator

Changeset 7910


Ignore:
Timestamp:
05/25/12 15:36:03 (10 years ago)
Author:
jkarder
Message:

#1711:

  • added resource selection dialog
  • added extension method that returns all descendants of a TreeNode
  • relaxed service access permissions
Location:
trunk/sources
Files:
6 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/HeuristicLab.Clients.Hive.JobManager-3.3.csproj

    r7257 r7910  
    9696  </ItemGroup>
    9797  <ItemGroup>
     98    <Compile Include="ExtensionMethods\TreeNodeExtensions.cs" />
    9899    <Compile Include="Plugin.cs" />
    99100    <Compile Include="Views\HiveJobManagerView.cs">
     
    115116    <Compile Include="Views\HiveJobPermissionView.Designer.cs">
    116117      <DependentUpon>HiveJobPermissionView.cs</DependentUpon>
     118    </Compile>
     119    <Compile Include="Views\HiveResourceSelector.cs">
     120      <SubType>UserControl</SubType>
     121    </Compile>
     122    <Compile Include="Views\HiveResourceSelector.Designer.cs">
     123      <DependentUpon>HiveResourceSelector.cs</DependentUpon>
     124    </Compile>
     125    <Compile Include="Views\HiveResourceSelectorDialog.cs">
     126      <SubType>Form</SubType>
     127    </Compile>
     128    <Compile Include="Views\HiveResourceSelectorDialog.Designer.cs">
     129      <DependentUpon>HiveResourceSelectorDialog.cs</DependentUpon>
    117130    </Compile>
    118131    <Compile Include="Views\RefreshableHiveJobListView.cs">
  • trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.Designer.cs

    r7341 r7910  
    5858      this.calculatingLabel = new System.Windows.Forms.Label();
    5959      this.jobsLabel = new System.Windows.Forms.Label();
     60      this.searchButton = new System.Windows.Forms.Button();
    6061      this.tabControl.SuspendLayout();
    6162      this.tasksTabPage.SuspendLayout();
     
    7071      //
    7172      this.tabControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    72                   | System.Windows.Forms.AnchorStyles.Left)
    73                   | System.Windows.Forms.AnchorStyles.Right)));
     73            | System.Windows.Forms.AnchorStyles.Left)
     74            | System.Windows.Forms.AnchorStyles.Right)));
    7475      this.tabControl.Controls.Add(this.tasksTabPage);
    7576      this.tabControl.Controls.Add(this.permissionTabPage);
     
    9899      this.jobsTreeView.AllowDrop = true;
    99100      this.jobsTreeView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    100                   | System.Windows.Forms.AnchorStyles.Left)
    101                   | System.Windows.Forms.AnchorStyles.Right)));
     101            | System.Windows.Forms.AnchorStyles.Left)
     102            | System.Windows.Forms.AnchorStyles.Right)));
    102103      this.jobsTreeView.Caption = "ItemTree View";
    103104      this.jobsTreeView.Content = null;
     
    136137      //
    137138      this.hiveExperimentPermissionListView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    138                   | System.Windows.Forms.AnchorStyles.Left)
    139                   | System.Windows.Forms.AnchorStyles.Right)));
     139            | System.Windows.Forms.AnchorStyles.Left)
     140            | System.Windows.Forms.AnchorStyles.Right)));
    140141      this.hiveExperimentPermissionListView.Caption = "HiveExperimentPermissionList View";
    141142      this.hiveExperimentPermissionListView.Content = null;
     
    162163      //
    163164      this.runCollectionViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    164                   | System.Windows.Forms.AnchorStyles.Left)
    165                   | System.Windows.Forms.AnchorStyles.Right)));
     165            | System.Windows.Forms.AnchorStyles.Left)
     166            | System.Windows.Forms.AnchorStyles.Right)));
    166167      this.runCollectionViewHost.Caption = "View";
    167168      this.runCollectionViewHost.Content = null;
     
    188189      //
    189190      this.stateLogViewHost.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    190                   | System.Windows.Forms.AnchorStyles.Left)
    191                   | System.Windows.Forms.AnchorStyles.Right)));
     191            | System.Windows.Forms.AnchorStyles.Left)
     192            | System.Windows.Forms.AnchorStyles.Right)));
    192193      this.stateLogViewHost.Caption = "StateLog View";
    193194      this.stateLogViewHost.Content = null;
     
    214215      //
    215216      this.logView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
    216                   | System.Windows.Forms.AnchorStyles.Left)
    217                   | System.Windows.Forms.AnchorStyles.Right)));
     217            | System.Windows.Forms.AnchorStyles.Left)
     218            | System.Windows.Forms.AnchorStyles.Right)));
    218219      this.logView.Caption = "Log View";
    219220      this.logView.Content = null;
     
    305306      //
    306307      this.resourceNamesTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    307                   | System.Windows.Forms.AnchorStyles.Right)));
     308            | System.Windows.Forms.AnchorStyles.Right)));
    308309      this.resourceNamesTextBox.Location = new System.Drawing.Point(70, 52);
    309310      this.resourceNamesTextBox.Name = "resourceNamesTextBox";
    310       this.resourceNamesTextBox.Size = new System.Drawing.Size(415, 20);
     311      this.resourceNamesTextBox.Size = new System.Drawing.Size(385, 20);
    311312      this.resourceNamesTextBox.TabIndex = 2;
    312313      this.resourceNamesTextBox.Validated += new System.EventHandler(this.resourceNamesTextBox_Validated);
     
    324325      //
    325326      this.nameTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    326                   | System.Windows.Forms.AnchorStyles.Right)));
     327            | System.Windows.Forms.AnchorStyles.Right)));
    327328      this.nameTextBox.Location = new System.Drawing.Point(70, 27);
    328329      this.nameTextBox.Name = "nameTextBox";
     
    346347      this.isPrivilegedCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
    347348      this.isPrivilegedCheckBox.AutoSize = true;
    348       this.isPrivilegedCheckBox.Location = new System.Drawing.Point(491, 53);
     349      this.isPrivilegedCheckBox.Location = new System.Drawing.Point(491, 54);
    349350      this.isPrivilegedCheckBox.Name = "isPrivilegedCheckBox";
    350351      this.isPrivilegedCheckBox.Size = new System.Drawing.Size(72, 17);
     
    385386      //
    386387      this.finishedTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    387                   | System.Windows.Forms.AnchorStyles.Right)));
     388            | System.Windows.Forms.AnchorStyles.Right)));
    388389      this.finishedTextBox.Location = new System.Drawing.Point(74, 64);
    389390      this.finishedTextBox.Name = "finishedTextBox";
     
    394395      //
    395396      this.calculatingTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    396                   | System.Windows.Forms.AnchorStyles.Right)));
     397            | System.Windows.Forms.AnchorStyles.Right)));
    397398      this.calculatingTextBox.Location = new System.Drawing.Point(74, 40);
    398399      this.calculatingTextBox.Name = "calculatingTextBox";
     
    403404      //
    404405      this.jobsTextBox.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
    405                   | System.Windows.Forms.AnchorStyles.Right)));
     406            | System.Windows.Forms.AnchorStyles.Right)));
    406407      this.jobsTextBox.Location = new System.Drawing.Point(74, 16);
    407408      this.jobsTextBox.Name = "jobsTextBox";
     
    436437      this.jobsLabel.Text = "Waiting:";
    437438      //
     439      // searchButton
     440      //
     441      this.searchButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
     442      this.searchButton.Image = HeuristicLab.Common.Resources.VSImageLibrary.Zoom;
     443      this.searchButton.Location = new System.Drawing.Point(461, 50);
     444      this.searchButton.Name = "searchButton";
     445      this.searchButton.Size = new System.Drawing.Size(24, 24);
     446      this.searchButton.TabIndex = 26;
     447      this.searchButton.UseVisualStyleBackColor = true;
     448      this.searchButton.Click += new System.EventHandler(this.searchButton_Click);
     449      //
    438450      // RefreshableHiveJobView
    439451      //
    440452      this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
    441453      this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
     454      this.Controls.Add(this.searchButton);
    442455      this.Controls.Add(this.isPrivilegedCheckBox);
    443456      this.Controls.Add(this.infoGroupBox);
     
    504517    private System.Windows.Forms.TabPage runsTabPage;
    505518    private MainForm.WindowsForms.ViewHost runCollectionViewHost;
     519    private System.Windows.Forms.Button searchButton;
    506520
    507521  }
  • trunk/sources/HeuristicLab.Clients.Hive.JobManager/3.3/Views/RefreshableHiveJobView.cs

    r7782 r7910  
    2323using System.ComponentModel;
    2424using System.Linq;
     25using System.Text;
    2526using System.Threading;
    2627using System.Threading.Tasks;
     
    4243  public partial class RefreshableHiveJobView : HeuristicLab.Core.Views.ItemView {
    4344    private ProgressView progressView;
     45    private HiveResourceSelectorDialog hiveResourceSelectorDialog;
    4446
    4547    public new RefreshableJob Content {
     
    149151        this.nameTextBox.ReadOnly = !Content.IsControllable || Content.ExecutionState != ExecutionState.Prepared || alreadyUploaded;
    150152        this.resourceNamesTextBox.ReadOnly = !Content.IsControllable || Content.ExecutionState != ExecutionState.Prepared || alreadyUploaded;
     153        this.searchButton.Enabled = Content.IsControllable && !(Content.ExecutionState != ExecutionState.Prepared || alreadyUploaded);
    151154        this.jobsTreeView.ReadOnly = !Content.IsControllable || Content.ExecutionState != ExecutionState.Prepared || alreadyUploaded;
    152155
     
    332335
    333336    #region Control events
     337    private void searchButton_Click(object sender, EventArgs e) {
     338      if (hiveResourceSelectorDialog == null)
     339        hiveResourceSelectorDialog = new HiveResourceSelectorDialog();
     340      if (hiveResourceSelectorDialog.ShowDialog(this) == DialogResult.OK) {
     341        StringBuilder sb = new StringBuilder();
     342        foreach (Resource resource in hiveResourceSelectorDialog.GetSelectedResources()) {
     343          sb.Append(resource.Name);
     344          sb.Append("; ");
     345        }
     346        resourceNamesTextBox.Text = sb.ToString();
     347      }
     348    }
     349
    334350    private void startButton_Click(object sender, EventArgs e) {
    335351      if (nameTextBox.Text.Trim() == string.Empty) {
  • trunk/sources/HeuristicLab.Services.Hive/3.3/HiveService.cs

    r7259 r7910  
    334334      });
    335335    }
     336
    336337    public IEnumerable<JobPermission> GetJobPermissions(Guid jobId) {
    337338      authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
     
    495496
    496497    public IEnumerable<Slave> GetSlaves() {
    497       authen.AuthenticateForAnyRole(HiveRoles.Administrator);
     498      authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
    498499      return dao.GetSlaves(x => true);
    499500    }
    500501
    501502    public IEnumerable<SlaveGroup> GetSlaveGroups() {
    502       authen.AuthenticateForAnyRole(HiveRoles.Administrator);
     503      authen.AuthenticateForAnyRole(HiveRoles.Administrator, HiveRoles.Client);
    503504      return dao.GetSlaveGroups(x => true);
    504505    }
Note: See TracChangeset for help on using the changeset viewer.