vs code 1.47.1 automatically reformatting dart code files - dart

Unfortunately I replied yes
to a vs code prompt for a settings change and now,
when I edit a .dart file, it is automatically reformatted.
In some cases git shows the entire file has been modified.
In some places 2 spaces are replaced with 4 spaces.
In another place code was added.
The time stamp on the settings.json file is today (July 14, 2020) at 11:20AM PST.
Is there a way to find out the latest changes to the settings.json file?
before:
icon: FaIcon(FontAwesomeIcons.solidBuilding), /*Icon(Icons.format_list_bulleted ),*/
after:
icon: FaIcon(FontAwesomeIcons.solidBuilding),
/*Icon(Icons.format_list_bulleted ),*/
before:
MyClass({
this.field1,
this.field2,
this.field3
});
after:
MyClass({this.field1,this.field2,this.field3});
before:
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
AvatarUpload(
after:
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
AvatarUpload(
AvatarUpload(
AvatarUpload(
What is the setting that I need to revert?
settings.json
{
"editor.tabSize": 2,
"files.exclude": {
"**/.git": true,
"**/.svn": true,
"**/.hg": true,
"**/CVS": true,
"**/.DS_Store": true,
"**/*.js": { "when": "$(basename).ts"}
},
"files.autoSave": "afterDelay",
"workbench.iconTheme": "vscode-simpler-icons",
"editor.insertSpaces": true,
"editor.detectIndentation": false,
"solidity.linter": "solhint",
"solidity.solhintRules": {
"avoid-sha3": "warn"
},
"editor.suggestSelection": "first",
"vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
"java.configuration.checkProjectSettingsExclusions": false,
"peacock.favoriteColors": [
{
"name": "Angular Red",
"value": "#b52e31"
},
{
"name": "Auth0 Orange",
"value": "#eb5424"
},
{
"name": "Azure Blue",
"value": "#007fff"
},
{
"name": "C# Purple",
"value": "#68217A"
},
{
"name": "Gatsby Purple",
"value": "#639"
},
{
"name": "Go Cyan",
"value": "#5dc9e2"
},
{
"name": "Java Blue-Gray",
"value": "#557c9b"
},
{
"name": "JavaScript Yellow",
"value": "#f9e64f"
},
{
"name": "Mandalorian Blue",
"value": "#1857a4"
},
{
"name": "Node Green",
"value": "#215732"
},
{
"name": "React Blue",
"value": "#00b3e6"
},
{
"name": "Something Different",
"value": "#832561"
},
{
"name": "Vue Green",
"value": "#42b883"
}
],
"dart.debugExternalLibraries": true,
"dart.debugSdkLibraries": false,
"[yaml]": {
"editor.defaultFormatter": "redhat.vscode-yaml"
},
"dart.openDevTools": "flutter",
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"diffEditor.ignoreTrimWhitespace": false,
"terminal.integrated.fontSize": 10,
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.rulers": [
80
],
"editor.selectionHighlight": false,
"editor.suggest.snippetsPreventQuickSuggestions": false,
"editor.suggestSelection": "first",
"editor.tabCompletion": "onlySnippets",
"editor.wordBasedSuggestions": false
}
}

This one:
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
...
}
Change it to "editor.formatOnSave": false, and "editor.formatOnType": false, depends on your taste.

Related

Recently Issue face in Input.date and Input.choice in AdaptiveCard While Integrating chatBot with Teams

While using input.choice with confirmation message in adaptive card rest at that time dropdown of choice list is not showing up, we started facing this problem recently before it was working properly.
This was the code we were using at first when it was having proper behaviour
TeamsAdaptiveCardRest adaptiveCardRest = new TeamsAdaptiveCardRest();
List<TeamsItemsChoiceRest> choiceList =
createTeamsItemChoiceRestList((MapUserMessageRest) chatUserResponse.getOptions());
TeamsTextBlockRest textBlock = new TeamsTextBlockRest();
textBlock.setText(chatUserResponse.getMessage());
TeamsStaticItemListRest staticItemListRest = new TeamsStaticItemListRest();
staticItemListRest.setChoices(choiceList);
staticItemListRest.setPlaceholder("select");
staticItemListRest.setId(String.valueOf(chatUserResponse.getChatBrainId()));
TeamsToggleElementsRest enableConfirmationMessage = createToggleElements("confirmationToggle", true);
TeamsToggleElementsRest enableActionButton = createToggleElements("actionButton", true);
TeamsToggleActionRest toggleSelectAction = new TeamsToggleActionRest();
toggleSelectAction
.setTargetElements(Lists.newArrayList(enableConfirmationMessage, enableActionButton));
TeamsContainerRest inputChoiceContainer = new TeamsContainerRest();
inputChoiceContainer.setVisible(true);
inputChoiceContainer.setItems(Lists.newArrayList(textBlock, staticItemListRest));
inputChoiceContainer.setSelectAction(toggleSelectAction);
adaptiveCardRest.addInBody(inputChoiceContainer);
TeamsContainerRest confirmationMessageContainer = new TeamsContainerRest();
confirmationMessageContainer.setItems(
Lists.newArrayList(new TeamsTextBlockRest(chatUserResponse.getConfirmationMessage())));
confirmationMessageContainer.setId("confirmationToggle");
confirmationMessageContainer.setVisible(false);
adaptiveCardRest.addInBody(confirmationMessageContainer);
TeamsActionSubmitRest submitAction = new TeamsActionSubmitRest("Yes");
TeamsToggleElementsRest disableConfirmationMessage =
createToggleElements("confirmationToggle", false);
TeamsToggleElementsRest disableActionButton = createToggleElements("actionButton", false);
TeamsToggleActionRest toggleDisabledAction = new TeamsToggleActionRest();
toggleDisabledAction
.setTargetElements(Lists.newArrayList(disableConfirmationMessage, disableActionButton));
toggleDisabledAction.setTitle("Cancel");
TeamsActionSetRest actionButtionSetRest = new TeamsActionSetRest();
actionButtionSetRest.setVisible(false);
actionButtionSetRest.setId("actionButton");
actionButtionSetRest.setActions(Lists.newArrayList(submitAction, toggleDisabledAction));
adaptiveCardRest.addInBody(actionButtionSetRest);
return adaptiveCardRest;
Json for the above code:
{
"type": "AdaptiveCard",
"version": "1.5",
"body": [
{
"type": "Container",
"id": null,
"items": [
{
"type": "TextBlock",
"text": "Input.choice",
"wrap": true
},
{
"type": "Input.ChoiceSet",
"choices": [
{
"title": "a",
"value": "aa",
"id": "aa"
}
],
"id": "39",
"value": null,
"placeholder": "select"
}
],
"selectAction": {
"type": "Action.ToggleVisibility",
"title": null,
"id": null,
"targetElements": [
{
"elementId": "confirmationToggle",
"visible": true,
"isVisible": true
},
{
"elementId": "actionButton",
"visible": true,
"isVisible": true
}
]
},
"visible": true,
"isVisible": true
},
{
"type": "Container",
"id": "confirmationToggle",
"items": [
{
"type": "TextBlock",
"text": "Are you sure?",
"wrap": true
}
],
"selectAction": null,
"visible": false,
"isVisible": false
},
{
"type": "ActionSet",
"actions": [
{
"type": "Action.Submit",
"title": "Yes",
"associatedInputs": "auto",
"data": null
},
{
"type": "Action.ToggleVisibility",
"title": "Cancel",
"id": null,
"targetElements": [
{
"elementId": "confirmationToggle",
"visible": false,
"isVisible": false
},
{
"elementId": "actionButton",
"visible": false,
"isVisible": false
}
]
}
],
"id": "actionButton",
"visible": false,
"isVisible": false
}
],
"selectAction": null,
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json"
}
We are facing same issue in input.date with confirmation message in that dropdown of datepicker doesn't show up
Due to the change in behaviour the dropdown of input.choice and input.date Doesn't show with confirmation message so It was working properly before but recently behaviour changed, So want to know the reason behind the change in behaviour.
enter image description here

How to add dashboard configuration json file in Grafana image?

I have a grafana docker image which have hawkular-datasource pre-configured using configuration files.
After after running grafana instance, I have a json given by teammate, which can be imported inside grafana and that json file creates dashboard when imported.
How do I make that dashboards appear by default in Grafana instance?
I tried copying the json file to /etc/grafana/provisioning/dashboards/ folder and created a new docker image. But when I run the image, the instance doesn't contain the dashboard at the homepage or anywhere in it.
How do I add this json file in docker image. Am I following the correct way?
I tried this http://docs.grafana.org/administration/provisioning/ But it didn't help out much. Any suggestion?
Here is the json file.
{
"id": null,
"title": "Openshift Metrics",
"tags": [],
"style": "dark",
"timezone": "browser",
"editable": true,
"hideControls": false,
"sharedCrosshair": false,
"rows": [
{
"collapse": false,
"editable": true,
"height": "322px",
"panels": [
{
"content": "<center><p style='font-size: 40pt'>$app</p></center>",
"editable": true,
"error": false,
"id": 23,
"isNew": true,
"links": [],
"mode": "html",
"repeatIteration": 1476706310439,
"scopedVars": {},
"span": 2,
"style": {
"font-size": "36pt"
},
"title": "",
"type": "text"
},
{
"aliasColors": {},
"bars": false,
"datasource": "Hawk-DS",
"editable": true,
"error": false,
"fill": 1,
"grid": {
"threshold1": null,
"threshold1Color": "rgba(216, 200, 27, 0.27)",
"threshold2": null,
"threshold2Color": "rgba(234, 112, 112, 0.22)"
},
"id": 9,
"isNew": true,
"legend": {
"avg": false,
"current": false,
"max": false,
"min": false,
"show": true,
"total": false,
"values": false
},
"lines": true,
"linewidth": 2,
"links": [],
"nullPointMode": "connected",
"percentage": false,
"pointradius": 5,
"points": false,
"renderer": "flot",
"repeatIteration": 1476706310439,
"scopedVars": {},
"seriesOverrides": [],
"span": 6,
"stack": false,
"steppedLine": false,
"targets": [
{
"queryBy": "tags",
"rate": false,
"refId": "A",
"seriesAggFn": "none",
"tags": [
{
"name": "container_name",
"value": "$app"
},
{
"name": "descriptor_name",
"value": "memory/usage"
}
],
"target": "select metric",
"tagsQL": "container_name IN [$app] AND descriptor_name='memory/usage'",
"timeAggFn": "avg",
"type": "gauge"
}
],
"timeFrom": null,
"timeShift": null,
"title": "Memory usage",
"tooltip": {
"msResolution": true,
"shared": true,
"sort": 0,
"value_type": "cumulative"
},
"type": "graph",
"xaxis": {
"show": true
},
"yaxes": [
{
"format": "bytes",
"label": null,
"logBase": 1,
"max": null,
"min": 0,
"show": true
},
{
"format": "short",
"label": null,
"logBase": 1,
"max": null,
"min": null,
"show": true
}
]
},
{
"cacheTimeout": null,
"colorBackground": true,
"colorValue": false,
"colors": [
"rgba(50, 172, 45, 0.97)",
"rgba(237, 129, 40, 0.89)",
"rgba(245, 54, 54, 0.9)"
],
"datasource": "Hawk-DS",
"editable": true,
"error": false,
"format": "bytes",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"height": "100px",
"id": 12,
"interval": null,
"isNew": true,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"repeatIteration": 1476706310439,
"scopedVars": {},
"span": 2,
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"targets": [
{
"queryBy": "tags",
"rate": false,
"refId": "A",
"seriesAggFn": "sum",
"tags": [
{
"name": "container_name",
"value": "$app"
},
{
"name": "descriptor_name",
"value": "memory/usage"
}
],
"target": "select metric",
"tagsQL": "container_name IN [$app] AND descriptor_name='memory/usage'",
"timeAggFn": "live",
"type": "gauge"
}
],
"thresholds": "140000000,180000000",
"title": "Live, all pods",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "avg"
},
{
"cacheTimeout": null,
"colorBackground": true,
"colorValue": false,
"colors": [
"rgba(50, 172, 45, 0.97)",
"rgba(237, 129, 40, 0.89)",
"rgba(245, 54, 54, 0.9)"
],
"datasource": "Hawk-DS",
"editable": true,
"error": false,
"format": "bytes",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"height": "100px",
"id": 15,
"interval": null,
"isNew": true,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"repeatIteration": 1476706310439,
"scopedVars": {},
"span": 2,
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"targets": [
{
"queryBy": "tags",
"rate": false,
"refId": "A",
"seriesAggFn": "avg",
"tags": [
{
"name": "container_name",
"value": "$app"
},
{
"name": "descriptor_name",
"value": "memory/usage"
}
],
"target": "select metric",
"tagsQL": "container_name IN [$app] AND descriptor_name='memory/usage'",
"timeAggFn": "live",
"type": "gauge"
}
],
"thresholds": "140000000,180000000",
"title": "Live per pod",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "avg"
},
{
"cacheTimeout": null,
"colorBackground": true,
"colorValue": false,
"colors": [
"rgba(50, 172, 45, 0.97)",
"rgba(237, 129, 40, 0.89)",
"rgba(245, 54, 54, 0.9)"
],
"datasource": "Hawk-DS",
"editable": true,
"error": false,
"format": "bytes",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"height": "100px",
"id": 10,
"interval": null,
"isNew": true,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"repeatIteration": 1476706310439,
"scopedVars": {},
"span": 2,
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"targets": [
{
"queryBy": "tags",
"rate": false,
"refId": "A",
"seriesAggFn": "sum",
"tags": [
{
"name": "container_name",
"value": "$app"
},
{
"name": "descriptor_name",
"value": "memory/usage"
}
],
"target": "select metric",
"tagsQL": "container_name IN [$app] AND descriptor_name='memory/usage'",
"timeAggFn": "avg",
"type": "gauge"
}
],
"thresholds": "140000000,180000000",
"title": "Average, all pods",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "avg"
},
{
"cacheTimeout": null,
"colorBackground": true,
"colorValue": false,
"colors": [
"rgba(50, 172, 45, 0.97)",
"rgba(237, 129, 40, 0.89)",
"rgba(245, 54, 54, 0.9)"
],
"datasource": "Hawk-DS",
"editable": true,
"error": false,
"format": "bytes",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"height": "100px",
"id": 13,
"interval": null,
"isNew": true,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"repeatIteration": 1476706310439,
"scopedVars": {},
"span": 2,
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"targets": [
{
"queryBy": "tags",
"rate": false,
"refId": "A",
"seriesAggFn": "avg",
"tags": [
{
"name": "container_name",
"value": "$app"
},
{
"name": "descriptor_name",
"value": "memory/usage"
}
],
"target": "select metric",
"tagsQL": "container_name IN [$app] AND descriptor_name='memory/usage'",
"timeAggFn": "avg",
"type": "gauge"
}
],
"thresholds": "140000000,180000000",
"title": "Average per pod",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "avg"
},
{
"cacheTimeout": null,
"colorBackground": true,
"colorValue": false,
"colors": [
"rgba(50, 172, 45, 0.97)",
"rgba(237, 129, 40, 0.89)",
"rgba(245, 54, 54, 0.9)"
],
"datasource": "Hawk-DS",
"editable": true,
"error": false,
"format": "bytes",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"height": "100px",
"id": 11,
"interval": null,
"isNew": true,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"repeatIteration": 1476706310439,
"scopedVars": {},
"span": 2,
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"targets": [
{
"queryBy": "tags",
"rate": false,
"refId": "A",
"seriesAggFn": "sum",
"tags": [
{
"name": "container_name",
"value": "$app"
},
{
"name": "descriptor_name",
"value": "memory/usage"
}
],
"target": "select metric",
"tagsQL": "container_name IN [$app] AND descriptor_name='memory/usage'",
"timeAggFn": "max",
"type": "gauge"
}
],
"thresholds": "140000000,180000000",
"title": "Max, all pods",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "avg"
},
{
"cacheTimeout": null,
"colorBackground": true,
"colorValue": false,
"colors": [
"rgba(50, 172, 45, 0.97)",
"rgba(237, 129, 40, 0.89)",
"rgba(245, 54, 54, 0.9)"
],
"datasource": "Hawk-DS",
"editable": true,
"error": false,
"format": "bytes",
"gauge": {
"maxValue": 100,
"minValue": 0,
"show": false,
"thresholdLabels": false,
"thresholdMarkers": true
},
"height": "100px",
"id": 14,
"interval": null,
"isNew": true,
"links": [],
"mappingType": 1,
"mappingTypes": [
{
"name": "value to text",
"value": 1
},
{
"name": "range to text",
"value": 2
}
],
"maxDataPoints": 100,
"nullPointMode": "connected",
"nullText": null,
"postfix": "",
"postfixFontSize": "50%",
"prefix": "",
"prefixFontSize": "50%",
"rangeMaps": [
{
"from": "null",
"text": "N/A",
"to": "null"
}
],
"repeatIteration": 1476706310439,
"scopedVars": {},
"span": 2,
"sparkline": {
"fillColor": "rgba(31, 118, 189, 0.18)",
"full": false,
"lineColor": "rgb(31, 120, 193)",
"show": false
},
"targets": [
{
"queryBy": "tags",
"rate": false,
"refId": "A",
"seriesAggFn": "avg",
"tags": [
{
"name": "container_name",
"value": "$app"
},
{
"name": "descriptor_name",
"value": "memory/usage"
}
],
"target": "select metric",
"tagsQL": "container_name IN [$app] AND descriptor_name='memory/usage'",
"timeAggFn": "max",
"type": "gauge"
}
],
"thresholds": "140000000,180000000",
"title": "Max per pod",
"type": "singlestat",
"valueFontSize": "80%",
"valueMaps": [
{
"op": "=",
"text": "N/A",
"value": "null"
}
],
"valueName": "avg"
}
],
"repeat": "app",
"scopedVars": {
"app": {
"text": "aloha",
"value": "aloha",
"selected": true
}
},
"title": "New row"
}
],
"time": {
"from": "now-30m",
"to": "now"
},
"timepicker": {
"refresh_intervals": [
"5s",
"10s",
"30s",
"1m",
"5m",
"15m",
"30m",
"1h",
"2h",
"1d"
],
"time_options": [
"5m",
"15m",
"1h",
"6h",
"12h",
"24h",
"2d",
"7d",
"30d"
]
},
"templating": {
"list": [
{
"current": {},
"datasource": "Hawk-DS",
"hide": 0,
"includeAll": true,
"label": "Application",
"multi": true,
"name": "app",
"options": [],
"query": "tags/container_name:*",
"refresh": 1,
"regex": "",
"type": "query"
}
]
},
"annotations": {
"list": []
},
"schemaVersion": 12,
"version": 32,
"links": [],
"gnetId": null
}
You should put a YAML file pointing to the JSON files in that folder. For example write /etc/grafana/provisioning/dashboards/local.yml:
apiVersion: 1
providers:
- name: 'default'
orgId: 1
folder: ''
type: file
disableDeletion: false
updateIntervalSeconds: 10 #how often Grafana will scan for changed dashboards
options:
path: /var/lib/grafana/dashboards
And then write your JSON file to /var/lib/grafana/dashboards/openshift.json.
Before Grafana 5, my previous solution was to wrap the whole Docker process in a script that uses the API to create the dashboard once the Docker container is up. You can use the GF_SECURITY_ADMIN_PASSWORD environment variable to set the password. You can also use GF_AUTH_ANONYMOUS_ENABLED, but you'll need to make sure it's not accessible to the outside world.
docker run -p 3000:3000 -e GF_AUTH_ANONYMOUS_ENABLED=true grafana/grafana ...
sleep 10 # wait for grafana to load (use a better method of waiting in production)
curl -skfS -XPOST --header "Content-Type: application/json" "http://localhost:3000/grafana/api/dashboards/db" --data-binary #dashboard.json
I've faced with the same problem and I hope the next solution could help somebody.
For example, you have the next working directory:
├── docker-compose.yml
├── grafana
│ ├── Dockerfile
│ ├── dashboards
│ │ └── exported_dashboard.json #dashboard you saved before
│ └── provisioning
│ │
│ ├── dashboards
│ │ └── all.yml
│ └── datasources
│ └── all.yml
In the Dockerfile you have to add provisioning and dashboards folders into grafana container:
FROM grafana/grafana:latest
ADD ./provisioning /etc/grafana/provisioning
ADD ./dashboards /var/lib/grafana/dashboards
In provisioning/dashboards/all.yml you have to set path to imported dashboards folder
where exported_dashboard.json is actually placed:
- name: 'default'
org_id: 1
folder: ''
type: 'file'
options:
folder: '/var/lib/grafana/dashboards'
[Optional] Then you also can configure default datasourse in provisioning/datasources/all.yml, prometheus, for example:
datasources:
- access: 'proxy'
editable: true
is_default: true
name: 'prom1'
org_id: 1
type: 'prometheus'
url: 'http://prometheus:9090'
version: 1
Finally, docker-compose.yml:
version: '3.8'
services:
grafana:
image: awesome-grafana:latest
build:
context: grafana
ports:
- "3000:3000"
environment:
GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH: "/var/lib/grafana/dashboards/exported_dashboard.json"
As for HOME dashborad, you can use the GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH evironment variable, as shown above.
More about GF_DASHBOARDS_DEFAULT_HOME_DASHBOARD_PATH evironment variable you can read in that github issue.
The full comprehensive code example you can find in the next github repository
Original article with explanation there.

Flutter: How to load all paged data with JSON

I have a wordpress page where I publish posts.
The problem is found when I exceed more than 10 publications in Wordpress, the application only receives the last 10 recent publications.
I would like to implement that show all the posts. But I do not know how to start.
Currently I have 15 publications and as you can see in the image, only the last 10 are shown, I hope to solve this problem, thank you
This is my JSON code
[
{
"id": 65,
"date": "2014-08-24T18:56:26",
"date_gmt": "2014-08-24T18:56:26",
"guid": {
"rendered": "http:\/\/********\/********\/?p=1"
},
"modified": "2018-06-05T13:24:58",
"modified_gmt": "2018-06-05T13:24:58",
"slug": "this-url-wordpress",
"status": "publish",
"type": "post",
"title": {
"rendered": "\u2018 This a test title 1 \u2019"
},
"content": {
"rendered": "<p>This is a content 1</p>",
"protected": false
},
"excerpt": {
"rendered": "<p>this a excerpt 1...<\/p>\n",
"protected": false
},
"author": 1,
"featured_media": 468,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"template": "",
"format": "standard",
"meta": [
],
"categories": [
14
],
"tags": [
17,
18
],
},
{
"id": 650,
"date": "2014-08-24T18:56:26",
"date_gmt": "2014-08-24T18:56:26",
"guid": {
"rendered": "http:\/\/********\/********\/?p=1"
},
"modified": "2018-06-05T13:24:58",
"modified_gmt": "2018-06-05T13:24:58",
"slug": "this-url-wordpress",
"status": "publish",
"type": "post",
"title": {
"rendered": "\u2018 This a test title 2 \u2019"
},
"content": {
"rendered": "<p>This is a content 2</p>",
"protected": false
},
"excerpt": {
"rendered": "<p>this a excerpt 2...<\/p>\n",
"protected": false
},
"author": 1,
"featured_media": 468,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"template": "",
"format": "standard",
"meta": [
],
"categories": [
14
],
"tags": [
17,
18
],
},
{
"id": 230,
"date": "2014-08-24T18:56:26",
"date_gmt": "2014-08-24T18:56:26",
"guid": {
"rendered": "http:\/\/********\/********\/?p=1"
},
"modified": "2018-06-05T13:24:58",
"modified_gmt": "2018-06-05T13:24:58",
"slug": "this-url-wordpress",
"status": "publish",
"type": "post",
"title": {
"rendered": "\u2018 This a test title 3 \u2019"
},
"content": {
"rendered": "<p>This is a content 3</p>",
"protected": false
},
"excerpt": {
"rendered": "<p>this a excerpt 3...<\/p>\n",
"protected": false
},
"author": 1,
"featured_media": 468,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"template": "",
"format": "standard",
"meta": [
],
"categories": [
14
],
"tags": [
17,
18
],
},
{
"id": 236,
"date": "2014-08-24T18:56:26",
"date_gmt": "2014-08-24T18:56:26",
"guid": {
"rendered": "http:\/\/********\/********\/?p=1"
},
"modified": "2018-06-05T13:24:58",
"modified_gmt": "2018-06-05T13:24:58",
"slug": "this-url-wordpress",
"status": "publish",
"type": "post",
"title": {
"rendered": "\u2018 This a test title 4 \u2019"
},
"content": {
"rendered": "<p>This is a content 4</p>",
"protected": false
},
"excerpt": {
"rendered": "<p>this a excerpt 4...<\/p>\n",
"protected": false
},
"author": 1,
"featured_media": 468,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"template": "",
"format": "standard",
"meta": [
],
"categories": [
14
],
"tags": [
17,
18
],
},
{
"id": 330,
"date": "2014-08-24T18:56:26",
"date_gmt": "2014-08-24T18:56:26",
"guid": {
"rendered": "http:\/\/********\/********\/?p=1"
},
"modified": "2018-06-05T13:24:58",
"modified_gmt": "2018-06-05T13:24:58",
"slug": "this-url-wordpress",
"status": "publish",
"type": "post",
"title": {
"rendered": "\u2018 This a test title 5 \u2019"
},
"content": {
"rendered": "<p>This is a content 5</p>",
"protected": false
},
"excerpt": {
"rendered": "<p>this a excerpt 5...<\/p>\n",
"protected": false
},
"author": 1,
"featured_media": 468,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"template": "",
"format": "standard",
"meta": [
],
"categories": [
14
],
"tags": [
17,
18
],
},
{
"id": 230,
"date": "2014-08-24T18:56:26",
"date_gmt": "2014-08-24T18:56:26",
"guid": {
"rendered": "http:\/\/********\/********\/?p=1"
},
"modified": "2018-06-05T13:24:58",
"modified_gmt": "2018-06-05T13:24:58",
"slug": "this-url-wordpress",
"status": "publish",
"type": "post",
"title": {
"rendered": "\u2018 This a test title 6 \u2019"
},
"content": {
"rendered": "<p>This is a content 6</p>",
"protected": false
},
"excerpt": {
"rendered": "<p>this a excerpt 6...<\/p>\n",
"protected": false
},
"author": 1,
"featured_media": 468,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"template": "",
"format": "standard",
"meta": [
],
"categories": [
14
],
"tags": [
17,
18
],
},
{
"id": 230,
"date": "2014-08-24T18:56:26",
"date_gmt": "2014-08-24T18:56:26",
"guid": {
"rendered": "http:\/\/********\/********\/?p=1"
},
"modified": "2018-06-05T13:24:58",
"modified_gmt": "2018-06-05T13:24:58",
"slug": "this-url-wordpress",
"status": "publish",
"type": "post",
"title": {
"rendered": "\u2018 This a test title 7 \u2019"
},
"content": {
"rendered": "<p>This is a content 7</p>",
"protected": false
},
"excerpt": {
"rendered": "<p>this a excerpt 7...<\/p>\n",
"protected": false
},
"author": 1,
"featured_media": 468,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"template": "",
"format": "standard",
"meta": [
],
"categories": [
14
],
"tags": [
17,
18
],
},
{
"id": 230,
"date": "2014-08-24T18:56:26",
"date_gmt": "2014-08-24T18:56:26",
"guid": {
"rendered": "http:\/\/********\/********\/?p=1"
},
"modified": "2018-06-05T13:24:58",
"modified_gmt": "2018-06-05T13:24:58",
"slug": "this-url-wordpress",
"status": "publish",
"type": "post",
"title": {
"rendered": "\u2018 This a test title 8 \u2019"
},
"content": {
"rendered": "<p>This is a content 8</p>",
"protected": false
},
"excerpt": {
"rendered": "<p>this a excerpt 8...<\/p>\n",
"protected": false
},
"author": 1,
"featured_media": 468,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"template": "",
"format": "standard",
"meta": [
],
"categories": [
14
],
"tags": [
17,
18
],
},
{
"id": 230,
"date": "2014-08-24T18:56:26",
"date_gmt": "2014-08-24T18:56:26",
"guid": {
"rendered": "http:\/\/********\/********\/?p=1"
},
"modified": "2018-06-05T13:24:58",
"modified_gmt": "2018-06-05T13:24:58",
"slug": "this-url-wordpress",
"status": "publish",
"type": "post",
"title": {
"rendered": "\u2018 This a test title 9 \u2019"
},
"content": {
"rendered": "<p>This is a content 9</p>",
"protected": false
},
"excerpt": {
"rendered": "<p>this a excerpt 9...<\/p>\n",
"protected": false
},
"author": 1,
"featured_media": 468,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"template": "",
"format": "standard",
"meta": [
],
"categories": [
14
],
"tags": [
17,
18
],
},
{
"id": 230,
"date": "2014-08-24T18:56:26",
"date_gmt": "2014-08-24T18:56:26",
"guid": {
"rendered": "http:\/\/********\/********\/?p=1"
},
"modified": "2018-06-05T13:24:58",
"modified_gmt": "2018-06-05T13:24:58",
"slug": "this-url-wordpress",
"status": "publish",
"type": "post",
"title": {
"rendered": "\u2018 This a test title 10 \u2019"
},
"content": {
"rendered": "<p>This is a content 10</p>",
"protected": false
},
"excerpt": {
"rendered": "<p>this a excerpt 10...<\/p>\n",
"protected": false
},
"author": 1,
"featured_media": 468,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"template": "",
"format": "standard",
"meta": [
],
"categories": [
14
],
"tags": [
17,
18
],
},
{
"id": 230,
"date": "2014-08-24T18:56:26",
"date_gmt": "2014-08-24T18:56:26",
"guid": {
"rendered": "http:\/\/********\/********\/?p=1"
},
"modified": "2018-06-05T13:24:58",
"modified_gmt": "2018-06-05T13:24:58",
"slug": "this-url-wordpress",
"status": "publish",
"type": "post",
"title": {
"rendered": "\u2018 This a test title 11 \u2019"
},
"content": {
"rendered": "<p>This is a content 11</p>",
"protected": false
},
"excerpt": {
"rendered": "<p>this a excerpt 11...<\/p>\n",
"protected": false
},
"author": 1,
"featured_media": 468,
"comment_status": "open",
"ping_status": "open",
"sticky": false,
"template": "",
"format": "standard",
"meta": [
],
"categories": [
14
],
"tags": [
17,
18
],
},
]
This is my Dart code:
Future<List<Post>> fetchPosts() async {
http.Response response =
await http.get("http://*********:88/WordPress/wp-json/wp/v2/posts/");
List responseJson = json.decode(response.body);
return responseJson.map((m) => new Post.fromJson(m)).toList();
}
class Post {
final String title;
final String body;
final String content;
final String urlimagen;
final String linkWeb;
Post({this.title, this.body, this.content, this.urlimagen, this.linkWeb});
factory Post.fromJson(Map<String, dynamic> json) {
return new Post(
title: json['title']['rendered'].toString(),
body: json['excerpt']['rendered'].toString(),
content: json['content']['rendered'].toString(),
linkWeb: json['link'].toString(),
);
}
}
class NewsState extends State<NewsPage> {
int _count = 0;
#override
Widget build(BuildContext context) {
return Scaffold(
appBar: new AppBar(
title: new Text("Noticias"),
centerTitle: true,
backgroundColor: Colors.deepOrange[700],
),
body: new Container(
child: new RefreshIndicator(
child: new ListView(
children: <Widget>[
new FutureBuilder<List<Post>>(
future: fetchPosts(),
builder: (context, snapshotImg) {
if (snapshotImg.hasData){
List<Post> posts = snapshotImg.data;
return new Column(
children: posts.map((post) => new Column(
children: _getItems(post.title, post.body, post.content, post.linkWeb),
)).toList()
);
}
else if(snapshotImg.hasError)
{
return new Text("${snapshotImg.error}");
}
return new Center(
child: new Column(
children: <Widget>[
new Padding(padding: new dgeInsets.all(50.0)),
new CircularProgressIndicator(),
],
),
);
},
),
],
),
onRefresh: _handleRefresh,
),
)
);
}
List<Widget> _getItems(String title, String description, String content, String url) {
var items = <Widget>[];
var item = new Column(
children: <Widget>[
new ListTile(
leading: new Icon(Icons.language, color: Colors.deepOrange[700], size: 30.0,),
title: new Text(title),
subtitle: new Text(description),
onTap: ()
{
Navigator.push(
context,
new MaterialPageRoute(builder: (context) => new WebView(url: url, title: title)));
},
),
new Divider(
color: Colors.deepOrange[700],
height: 2.0,
),
],
);
items.add(item);
return items;
}
Future<Null> _handleRefresh() async {
await new Future.delayed(new Duration(seconds: 3));
setState(() {
_count += 5;
});
return null;
}
}
A sample of the content in the app
My solution to this problem is due to the Wordpress JSON API REST V2 plugin, which limits me to 10 publications
More information in: Wordpress API JSON return limit
I appreciate your help, thank you.

Bar chart with wrong bar height

There are three data series, two of them are bar type series (Insolation Duration and Power Duration).
When I import data (from Striped Table) to the Highcharts, the bar chart height doesn't display properly.
It doesn't fit the scale of the chart's value, like this:
e.g. 2018/05/01
The Insolation value is less than the Power value, but the height of Power Duration bar chart is higher than Insolation Duration.
Here are the chart options I use:
var ChartObj =
{
type: "chart",
value:
{
"chart": { "alignTicks": false, "zoomType": "xy" },
"title": { "text": " ", "floating": false, "align": "center" },
"xAxis":
[
{
"categories": [], //PUT LABEL IN HERE
"crosshair": true, "index": 0, "isX": true
}
],
"tooltip": { "shared": true },
"legend":
{
"layout": "horizontal",
"align": "right",
"x": 0,
"verticalAlign": "top",
"y": 0,
"floating": false,
"backgroundColor": "#FFFFFF"
},
"yAxis":
[
{
"gridLineColor": "transparent",
"labels":
{
"format": "{value}",
"style": { "color": "#7cb5ec" },
"enabled": false
},
"title": { "text": null, "style": { "color": "#7cb5ec" } },
"opposite": false,
"index": 0,
},
{
"gridLineColor": "transparent",
"labels":
{
"format": "{value}",
"style": { "color": "#90ed7d" },
"enabled": false
},
"title":
{
"text": null,
"style": { "color": "#90ed7d" }
},
"opposite": true,
"index": 1,
},
{
"gridLineColor": "transparent",
"labels":
{
"format": "{value}",
"style": { "color": "#f7a35c" },
"enabled": false
},
"title": { "text": null,
"style": { "color": "#f7a35c" } },
"opposite": true,
"index": 2,
}
],
"series":
[
{
// Insolation
"name": " ",
"color": "#90ed7d",
"tooltip":
{
"valueSuffix": "",
"pointFormat": "<span style=\"color:{point.color}\">●</span> {series.name}: <b>{point.y:,.2f}</sup></b><br/>"
},
"yAxis": 0,
"type": "column",
"data": [],
"_symbolIndex": 0
},
{
// Power
"name": " ",
"color": "#f7a35c",
"tooltip":
{
"valueSuffix": "",
"pointFormat": "<span style=\"color:{point.color}\">●</span> {series.name}: <b>{point.y:,.2f}</b><br/>"
},
"yAxis": 1,
"type": "column",
"data": [],
"_symbolIndex": 1
},
{
// PR
"name": " ",
"color": "#7cb5ec",
"tooltip":
{
"valueSuffix": "",
"pointFormat": "<span style=\"color:{point.color}\">●</span> {series.name}: <b>{point.y:,.2f}</b><br/>"
},
"yAxis": 2,
"type": "line",
"data": []
}
]
}
};
You will need to set a max to the 2 first column axis like this
{
"gridLineColor": "transparent",
"labels":
{
"format": "{value}",
"style": { "color": "#7cb5ec" },
"enabled": false
},
"title": { "text": null, "style": { "color": "#7cb5ec" } },
"opposite": false,
"index": 0,
max:12 // The value to set
},
Or change the index of your series to use the same yAxis
Demo Fiddle

marker become invisible when line chart negative values in highcharts

marker of negative value become invisible in line chart type in highcharts
My fiddle is : http://jsfiddle.net/TnTsr/542/
i have tried to change plot options but it seems like that there is no error in plot options.
Advance thanks
{
"chart": {
"renderTo": "container",
"reportCode": "container",
"defaultSeriesType": "line",
"events": {
}
},
"title": {
"text": null,
"style": {
"fontSize": "11px",
"fontFamily": "Open Sans , sans-serif",
"fontWeight": "normal"
}
},
"subtitle": {
"text": null,
"style": {
"fontSize": "11px",
"fontFamily": "Open Sans , sans-serif",
"fontWeight": "normal"
}
},
"legend": {
"floating": false,
"enabled": false,
"itemStyle": {
"fontSize": "9px"
},
"verticalAlign": "bottom",
"layout": "horizontal",
"align": "center",
"borderWidth": 0,
"symbolWidth": 9
},
"xAxis": {
"categories": [
"Glendale Adventist ",
"Simi Valley ",
"Feather River ",
"St Helena (Clearlake)",
"White Memorial ",
"Frank R Howard Memorial ",
"San Joaquin Comm ",
"St Helena ",
"Sonora Reg ",
"Ukiah Valley ",
"Central Valley General"
],
"categoriesFullName": [
""
],
"enabledCategoryAbbreviation": false,
"title": {
"text": "",
"style": {
"fontSize": "12px",
"fontFamily": "Open Sans , sans-serif",
"color": "black",
"fontWeight": "normal"
}
},
"labels": {
"enabled": true,
"style": {
"fontSize": "10px",
"fontFamily": "Open Sans , sans-serif",
"fontWeight": "normal"
},
"rotation": 315,
"align": "right"
}
},
"yAxis": [
{
"labels": {
"style": {
"fontSize": "12px",
"fontFamily": "Open Sans , sans-serif",
"fontWeight": "normal"
}
},
"title": {
"text": "CS-ALOS GAP",
"tooltip": "At DRG Level CS-ALOS Gap = (Facility CS-ALOS) -(Benchmark CS-ALOS). At Any Level above DRG CS-ALOS Gap = (Gap Days)/Discharges",
"style": {
"fontSize": "12px",
"fontFamily": "Open Sans , sans-serif",
"color": "#3E576F",
"fontWeight": "normal"
}
},
"opposite": false,
"plotLines": [
],
"plotBands": [
]
}
],
"tooltip": {
"shared": false,
"borderWidth": "0",
"backgroundColor": "rgba(255,255,255,1)",
"style": {
"line-height": "18px",
"fontSize": "10px",
"fontFamily": "Open Sans , sans-serif",
"color": "#1A5488",
"padding": "8px"
},
"Color": "#1A5488",
"borderRadius": "3",
"shadow": "false",
"borderColor": "rgba(48,132,201,1)",
"padding": "5",
"font-family": "arial",
"font-size": "10",
"z-index": "10"
},
"credits": {
"enabled": false
},
"plotOptions": {
"column": {
"dataLabels": {
},
"pointPadding": "0.01",
"groupPadding": "0.09",
"borderColor": "black",
"borderWidth": 1,
"shadow": false
},
"bar": {
"dataLabels": {
},
"pointPadding": "0.01",
"groupPadding": "0.09",
"borderColor": "black",
"borderWidth": 1,
"shadow": false
},
"scatter": {
"marker": {
"radius": 9
}
},
"pie": {
"allowPointSelect": true,
"cursor": "pointer",
"dataLabels": {
"enabled": true,
"color": "#000000",
"connectorColor": "#000000"
}
},
"series": {
"groupPadding": "0.04"
}
},
"series": [
{
"name": "Hospitals",
"type": "line",
"yAxis": 0,
"index": 0,
"isAdditionalYAxisSeries": false,
"color": "#0833ff",
"data": [
{
"customTooltip": [
],
"y": 1.12,
"dataElementValue": "Glendale Adventist ",
"dataElementName": "Hospitals",
"columnStacking": false,
"color": "#0833ff",
"isPointColor": true,
"isSeriesColor": true,
"colorIndex": "0"
},
{
"customTooltip": [
],
"y": 0.99,
"dataElementValue": "Simi Valley ",
"dataElementName": "Hospitals",
"columnStacking": false,
"color": "#0833ff",
"isPointColor": true,
"isSeriesColor": true,
"colorIndex": "0"
},
{
"customTooltip": [
],
"y": 0.71,
"dataElementValue": "Feather River ",
"dataElementName": "Hospitals",
"columnStacking": false,
"color": "#0833ff",
"isPointColor": true,
"isSeriesColor": true,
"colorIndex": "0"
},
{
"customTooltip": [
],
"y": 0.7,
"dataElementValue": "St Helena (Clearlake)",
"dataElementName": "Hospitals",
"columnStacking": false,
"color": "#0833ff",
"isPointColor": true,
"isSeriesColor": true,
"colorIndex": "0"
},
{
"customTooltip": [
],
"y": 0.68,
"dataElementValue": "White Memorial ",
"dataElementName": "Hospitals",
"columnStacking": false,
"color": "#0833ff",
"isPointColor": true,
"isSeriesColor": true,
"colorIndex": "0"
},
{
"customTooltip": [
],
"y": 0.49,
"dataElementValue": "Frank R Howard Memorial ",
"dataElementName": "Hospitals",
"columnStacking": false,
"color": "#0833ff",
"isPointColor": true,
"isSeriesColor": true,
"colorIndex": "0"
},
{
"customTooltip": [
],
"y": 0.37,
"dataElementValue": "San Joaquin Comm ",
"dataElementName": "Hospitals",
"columnStacking": false,
"color": "#0833ff",
"isPointColor": true,
"isSeriesColor": true,
"colorIndex": "0"
},
{
"customTooltip": [
],
"y": 0.36,
"dataElementValue": "St Helena ",
"dataElementName": "Hospitals",
"columnStacking": false,
"color": "#0833ff",
"isPointColor": true,
"isSeriesColor": true,
"colorIndex": "0"
},
{
"customTooltip": [
],
"y": -0.05,
"dataElementValue": "Sonora Reg ",
"dataElementName": "Hospitals",
"columnStacking": false,
"color": "#0833ff",
"isPointColor": true,
"isSeriesColor": true,
"colorIndex": "0"
},
{
"customTooltip": [
],
"y": -0.23,
"dataElementValue": "Ukiah Valley ",
"dataElementName": "Hospitals",
"columnStacking": false,
"color": "#0833ff",
"isPointColor": true,
"isSeriesColor": true,
"colorIndex": "0"
},
{
"customTooltip": [
],
"y": -0.3,
"dataElementValue": "Central Valley General",
"dataElementName": "Hospitals",
"columnStacking": false,
"color": "#0833ff",
"isPointColor": true,
"isSeriesColor": true,
"colorIndex": "0"
}
],
"colorIndex": "0"
}
],
"exporting": {
"enabled": false
}
}
This is known bug, already resolved on master version: http://jsfiddle.net/TnTsr/543/
Thanks, but i have already fixed that, the issue was in data objects that I was assigning each point a color rather than assigning color to points i just assign color to series. the fiddle is : jsfiddle.net/TnTsr/545 –

Resources