How can I change the datasource for a Grafana dashboard? - grafana

I've got a new datasource I would like an existing dashboard to use.
How can I change it over? Is there a quicker way than exporting / importing the dashboard?

Specifying a variable would not solve all the problems with changing a data source for the existing dashboard - there will be still some metadata pointing to the old one, which will result in failures. The only thing that worked for me was to go to dashboard setting and copy aside the JSON model, careful find+replace and pasting back the model. I know it's pretty lame, but this was the only thing that worked. There seems to be something missing with this feature in Grafana at the moment...

The following trick worked for me with Grafana 8.
As preparation you have to create a datasource variable "DS_PROMETHEUS".
Then inside the dashboard:
Click "Share Dashboard or Panel"
Switch to "Export" Tab
Activate "Export for sharing externally"
Click "View JSON" and copy the json to the clipboard
Then in the same dashboard open the "Dashboard settings"->"JSON Model" and paste the json from above.

You can specify data source variable for a dashboard:
http://docs.grafana.org/reference/templating/#variable-types

In the JSON Model (dashboard settings), you can just replace all the occurrence of the id of the old source by the id of your new one

Related

Parametrize Auto Refresh for Superset Dashboard

My Superset Dashboard does auto-refresh but I wanted to parameterize it
Ex: http://192.168.223.16:8088/superset/dashboard/sample/?standalone=true&refreshTime=30
I found that we need to modify the DashBoard.jsx file but I am not able to locate where this file is.
I did search everything but dont know if this is hidden or something ?
DashBoard.jsx is under incubator-superset/caravel/assets/javascripts if you are using a clone version of apache-superset

How can I set an Item as Default in Variant-Management's manage dialogue?

I'm using:
SAP UI5 version 1.38.8
sap.ui.comp.variants.VariantManagement
My problem is that I can't set an item programmatically so that the item is shown as 'selected' in the management dialog.
It works in the select dialogue (or popup), as shown below:
However, it doesn't work in the "variants manage" dialog, as you can see in here
Unfortunately, I need to use version 1.38.8 (because of restrictions by customer's environment). Any ideas how to solve this problem?
Solution:
variantManagment.setDefaultVariantKey(item.VariantId);
after Variants were loaded.
I don't know why it didn't work at my first tries.

Build pages not showing on admin panel?

As you can see here: [1]: https://i.stack.imgur.com/oVfts.png . I have build some pages from templates but they are not showing in admin panel. When I go for example to : http://sulu-dev.lo/contact, it opens that page.
Are you using the doctrine-dbal transport layer and do you have some kind of special character (dot, dash, ...) in your webspace configuration? There is currently an issue in Jackalope Doctrine DBAL which causes this behavior. Simply change the webspace key, use bin/adminconsole sulu:build --destroy to initialize Sulu again.
The --destroy option deletes all the existing data. If you don't want to do that you should move the /cmf/<webspace> node to match the new key using something like the PHPCR Shell on your own.

Unable to delete content resources on JasperReports Server

I'm using JasperReports Server 5.6 and I have some reports deployed there.
The problem starts when I generate a PDF output for my reports. I can see the output file in the repository, but I'm unable to delete it.
I'm able to delete other types of resources, as an image or report, for example. But when I need to delete a generated PDF, the upper options bar doesn't offer me any options (including deleting). If I try to right-click the PDF, it doesn't open any pop-up menus (as it does for images, for example).
The image below shows what happens to the options bar:
Here goes some interesting things I've noticed:
The type column in the repo tells me the PDF is a "Content Resource". If I manually upload another PDF from my local machine to the repo as a "Content Resource", the UI also doesn't let me delete the resource.
I'm logged in as the administrator user. It's set with ROLE_USER and ROLE_ADMINISTRATOR roles (it's the default jasperadmin user).
The directory which contains the PDF is set with permissions Read+Write+Delete for the ROLE_USER.
Tried to log in as another user with ROLE_USER and I got the same result.
The JasperReports Server's tomcat is running as root (it's a test environment).
I went through the JasperReports Server's User's Guide and Administrator's Guide. Both said that I need to have the right permissions (and I do), and also I need to have no references to the resources to be deleted. In the case above, where I have an uploaded PDF as a "Content Resource", I don't have any references to it inside the repo, and I still can't delete it!
If I delete the super directory that contains the PDF, it works fine.
So, do you guys have any ideas of what I can try to get rid of these PDF outputs?
So far the best solution, I didn't find any better, for this is to use the delete button on the keyboard
I really don't know why is the menu button disabled but nevermind.
I am facing the same problem. There is a work around for this: Use Jaspersoft Studio.
Add a JasperReports Server Connection, expand the node and locate the file you wanted, then right-click and select Delete.
This is not an elegance solution but works for the moment.
EDIT - found the problem and have a fix.
The JS is missing "Utils" scope in getInitConfiguration. The original source is:
var Utils = {
restOfString: function(str, fromStr) {
var from = str.lastIndexOf(fromStr) + fromStr.length;
return str.substring(from, str.length).trim();
},
getInitOptions: function () {
return localContext.rsInitOptions || __jrsConfigs__.repositorySearch["localContext"].rsInitOptions;
},
getInitConfiguration: function () {
return getInitOptions().configuration;
}
};
Just change "return getInitOptions().configuration;" to get "return Utils.getInitOptions().configuration;"
You'll have to make this change in the optimized version of the script (optimized-scripts/results.page.js). Fortunately there are only two occurrences of getInitOptions so it's easy to find and fix the correct one.
The root cause is a javascript error:
uncaught ReferenceError: getInitOptions is not defined
This is coming from results.page.js, but I haven't found a fix for it yet. This code is attempting to change the state of the toolbar buttons. I tried using the latest 6.x version of the script, and that did not fix the problem either.
Also listed at http://community.jaspersoft.com/questions/843951/unable-delete-report-output-jasperserver-56
When you are going to delete the content resource Delete button show disable. I am also experiencing the same problem so for time being I am deleting my content resources by using following query on Jasperserver schema.
Delete from jicontentresource where id in
(
Select id from jiresource
where resourcetype='com.jaspersoft.jasperserver.api.metadata.common.domain.ContentResource'
and to_char(update_date,'YYYY-MM-DD') = '2014-11-25');
Delete from jiresource where resourcetype='com.jaspersoft.jasperserver.api.metadata.common.domain.ContentResource'
and to_char(update_date,'YYYY-MM-DD') = '2014-11-25';
You have only to mark all files and then push the Delete-Button

How can I get rid of a persistent VBA Form Object that won't honor the form deletion?

I have an MS Access 2003 database that I'm using to develop a basic little inventory app. I have added some extraneous forms along the way and I wanted to get them out of the DB. I deleted most of them just fine but one of them appears to have left behind its VBA Object. All that's in the object is Option Compare Database. Now whenever I try to work with the database, I get the following error:
The form name 'Transaction1' is misspelled or refers to a form that doesn't exist.
If the invalid form name is a macro, ...
Truncated for typings sake.
Yes, I agree, the form doesn't exist. What confuses me so much is that all of the other forms, when I deleted them, also destroyed their VBA object as well. This one, no matter what, seems to like to stick around and I have no idea how to get rid of it.
How do I get rid of it?
Things I've tried:
Compact and Repair and the DB
Create a new form named what it's expecting, verify that it gets rid of the problem, and then delete that form.
You can try the /decompile switch
Make a backup of your mdb
Open your mdb (hold the SHIFT key down to stop any code from running) via a short
cut: msaccess.exe database.mdb /decompile
Open a module and compile your app
Save and close Access
Open again (SHIFT again) without decompile
Compact and repair database
close Access
I had similar problem. I found I had named the missing form in the STARTUP menu as the default form to open when starting Access. I opened Tools>Startup and deleted the missing forms name from the "Display/Form/Page" field of the Startup. My problem solved.
The problem I was having is that the form was named ~TMPCLP8151 and would not show up in Access no matter what I tried, but I could see it in VBA in the Project Explorer. Here's how I resolved the issue. I created a new form, and created an Event Procedure for Form_Open that contained this:
DoCmd.DeleteObject acForm, "~TMPCLP8151"
Then I just opened the form, and sure enough, the VB code deleted the form that I could not delete myself.
I had a same problem. I created a form with same name and deleted the form again. That fixed the peoblem. Try. BTW try to open the new form in design mode to make sure if the VBA module is assosiated with the new form.
I had to combine both solutions to achieve the goal.
First de- and recompile
next compact and repair
then create new form with the same name and delete it
Pay attention that the form has the status Hasmodule set to Yes
I had this problem. I renamed my default form from Form Login to frmLogin which suits my naming style, but the program was still looking for it on opening. I am using 2013 so I went to File » Options » CurrentDB and in the display dropdown select the new name. The old name remains in the list until you close and restart the application.