/// <inheritdoc />
        public override string GetDashboardContent(IConfigurationRequestContext context)
        {
            // Create a new dashboard that refreshes every 30 seconds.
            var dashboard = new StatusDashboard()
            {
                RefreshInterval = 30
            };

            // If there's some base content then add that.
            var baseContent = base.GetDashboardContent(context);

            if (false == string.IsNullOrWhiteSpace(baseContent))
            {
                dashboard.AddContent(new DashboardCustomContent(baseContent));
            }

            // Do we have any asynchronous operation content?
            var asynchronousOperationContent = this.GetAsynchronousOperationDashboardContent();

            if (null != asynchronousOperationContent)
            {
                dashboard.AddContent(asynchronousOperationContent);
            }

            // Return the dashboard.
            return(dashboard.ToString());
        }
Esempio n. 2
0
        /// <summary>
        /// Generates the HTML for the dashboard.
        /// </summary>
        /// <returns></returns>
        public string DashboardGenerator()
        {
            // Create the content for the dashboard.
            var content = new DashboardContentCollection
            {
                // Display the licence information.
                new DashboardCustomContent($"<p>The current licence status is: <strong>{this.License.LicenseStatus}</strong>.</p>"),

                // Display some configuration information.
                new DashboardCustomContent($"<p>There are <strong>{this.Configuration.CurrentConfiguration.ImportInstructions.Count}</strong> import instructions configured.</p>")
            };

            // The status dashboard is our root object, and will handle generating the required HTML.
            var statusDashboard = new StatusDashboard();

            // Create a panel for this content to sit in and set the content and title.
            var panel = new DashboardPanel()
            {
                Title        = "Xml Importer",
                InnerContent = content
            };

            // Add the panel to the dashboard.
            statusDashboard.Contents.Add(panel);

            //Return the dashboard HTML.
            return(statusDashboard.ToString());
        }
Esempio n. 3
0
        /// <summary>
        /// Generates the dashboard when the user selects the "Dashboard" tab in the configuration area.
        /// </summary>
        /// <returns>The dashboard HTML.</returns>
        private string GenerateDashboard()
        {
            // Note: only some HTML tags and attributes are allowed.
            // ref: https://developer.m-files.com/Frameworks/Vault-Application-Framework/Configuration/Custom-Dashboards/

            // Retrieve something from the configuration.
            var propertyDefId = this
                                .ConfigurationNode?
                                .CurrentConfiguration?
                                .ConfigurationEditors?
                                .IdentifierConfigurationEditors?
                                .PropertyDefValue?
                                .ID ?? -1;

            // Build up a dashboard.
            var dashboard = new StatusDashboard()
            {
                Contents = new DashboardContentCollection()
                {
                    new DashboardPanel()
                    {
                        Title        = "My first dashboard",
                        InnerContent = new DashboardContentCollection()
                        {
                            // Output what one of the MFIdentifiers is currently resolved to.
                            new DashboardCustomContent(
                                $"<p>The property definition ID for <code>ConfigurationEditors.IdentifierConfigurationEditors.PropertyDefValue</code> was <code>{propertyDefId}</code>.</p>"),
                        }
                    }
                }
            };

            return(dashboard.ToString());
        }
Esempio n. 4
0
        /// <inheritdoc />
        public override string GetDashboardContent(IConfigurationRequestContext context)
        {
            var dashboard = new StatusDashboard();

            dashboard.RefreshInterval = 30;

            // If there's some base content then add that.
            var baseContent = base.GetDashboardContent(context);

            if (false == string.IsNullOrWhiteSpace(baseContent))
            {
                dashboard.AddContent(new DashboardCustomContent(baseContent));
            }

            // Do we have any background operation content?
            var backgroundOperationContent = this.GetBackgroundOperationDashboardContent();

            if (null != backgroundOperationContent)
            {
                dashboard.AddContent(backgroundOperationContent);
            }

            // Return the dashboard.
            return(dashboard.ToString());
        }