AzureMonitor: Remove unused angular code (#48110)

* remove unsued code

* fix import
This commit is contained in:
Erik Sundell 2022-04-25 12:30:33 +02:00 committed by GitHub
parent 68ca5b2e05
commit cb2c6fe6bc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 1 additions and 104 deletions

View File

@ -15,8 +15,6 @@ import { FolderPicker } from 'app/core/components/Select/FolderPicker';
import { TimePickerSettings } from 'app/features/dashboard/components/DashboardSettings/TimePickerSettings';
import { AnnotationQueryEditor as CloudMonitoringAnnotationQueryEditor } from 'app/plugins/datasource/cloud-monitoring/components/AnnotationQueryEditor';
import { QueryEditor as CloudMonitoringQueryEditor } from 'app/plugins/datasource/cloud-monitoring/components/QueryEditor';
import { AnnotationQueryEditor as CloudWatchAnnotationQueryEditor } from 'app/plugins/datasource/cloudwatch/components/AnnotationQueryEditor';
import QueryEditor from 'app/plugins/datasource/grafana-azure-monitor-datasource/components/QueryEditor/QueryEditor';
import EmptyListCTA from '../core/components/EmptyListCTA/EmptyListCTA';
import { Footer } from '../core/components/Footer/Footer';
@ -125,11 +123,7 @@ export function registerAngularDirectives() {
['datasource', { watchDepth: 'reference' }],
['templateSrv', { watchDepth: 'reference' }],
]);
react2AngularDirective('cloudwatchAnnotationQueryEditor', CloudWatchAnnotationQueryEditor, [
'query',
'onChange',
['datasource', { watchDepth: 'reference' }],
]);
react2AngularDirective('secretFormField', SecretFormField, [
'value',
'isConfigured',
@ -198,12 +192,6 @@ export function registerAngularDirectives() {
['onHideTimePickerChange', { watchDepth: 'reference', wrapApply: true }],
]);
react2AngularDirective('azureMonitorQueryEditor', QueryEditor, [
'query',
['datasource', { watchDepth: 'reference' }],
'onChange',
]);
react2AngularDirective('clipboardButton', ClipboardButton, [
['getText', { watchDepth: 'reference', wrapApply: true }],
]);

View File

@ -1,91 +0,0 @@
<div class="gf-form-group">
<div class="gf-form">
<label class="gf-form-label query-keyword width-9">Service</label>
<div class="gf-form-select-wrapper gf-form-select-wrapper--caret-indent">
<select
class="gf-form-input service-dropdown"
ng-model="ctrl.annotation.queryType"
ng-options="f as f for f in ['Application Insights', 'Azure Monitor', 'Azure Log Analytics']"
></select>
</div>
</div>
<div class="gf-form" ng-show="ctrl.annotation.queryType === 'Azure Log Analytics'">
<label class="gf-form-label query-keyword width-9">Subscription</label>
<div class="gf-form-select-wrapper gf-form-select-wrapper--caret-indent">
<select
class="gf-form-input service-dropdown"
ng-model="ctrl.annotation.subscription"
ng-options="f.value as f.text for f in ctrl.subscriptions"
ng-change="ctrl.onSubscriptionChange()"
></select>
</div>
</div>
<div ng-show="ctrl.annotation.queryType === 'Azure Log Analytics'">
<div class="gf-form-inline">
<div class="gf-form">
<label class="gf-form-label query-keyword width-9">Workspace</label>
<div class="gf-form-select-wrapper gf-form-select-wrapper--caret-indent">
<select
class="gf-form-input min-width-12"
ng-model="ctrl.annotation.workspace"
ng-options="f.value as f.text for f in ctrl.workspaces"
></select>
</div>
</div>
<div class="gf-form">
<div class="width-1"></div>
</div>
<div class="gf-form">
<button class="btn btn-primary width-10" ng-click="ctrl.panelCtrl.refresh()">Run</button>
</div>
<div class="gf-form">
<label class="gf-form-label">(New Line: Shift+Enter, Run Query: Enter, Trigger Suggestion: Ctrl+Space)</label>
</div>
</div>
<kusto-editor
class="gf-form gf-form--grow"
query="ctrl.annotation.rawQuery"
variables="ctrl.templateVariables"
change="ctrl.onLogAnalyticsQueryChange"
getSchema="ctrl.getAzureLogAnalyticsSchema"
/>
</div>
<div class="gf-form-inline" ng-show="ctrl.annotation.queryType !== 'Azure Log Analytics'">
<div class="gf-form gf-form--grow">
<label class="gf-form-label">No annotations support for {{ctrl.annotation.queryType}}</label>
</div>
</div>
<div class="gf-form-inline">
<div class="gf-form">
<label class="gf-form-label query-keyword" ng-click="ctrl.showHelp = !ctrl.showHelp">
Show Help
<icon name="'angle-down'" ng-show="ctrl.showHelp" style="margin-top: 3px;"></icon>
<icon name="'angle-right'" ng-hide="ctrl.showHelp" style="margin-top: 3px;"></icon>
</label>
</div>
</div>
<div class="gf-form" ng-show="ctrl.showHelp">
<pre
class="gf-form-pre alert alert-info"
ng-show="ctrl.annotation.queryType === 'Azure Log Analytics'"
><h6>Annotation Query Format</h6>
An annotation is an event that is overlaid on top of graphs. The query can have up to three columns per row, the datetime column is mandatory. Annotation rendering is expensive so it is important to limit the number of rows returned.
- column with the datetime type.
- column with alias: <b>Text</b> or <b>text</b> for the annotation text
- column with alias: <b>Tags</b> or <b>tags</b> for annotation tags. This is should return a comma separated string of tags e.g. 'tag1,tag2'
Macros:
- $__timeFilter() -&gt; TimeGenerated &ge; datetime(2018-06-05T18:09:58.907Z) and TimeGenerated &le; datetime(2018-06-05T20:09:58.907Z)
- $__timeFilter(datetimeColumn) -&gt; datetimeColumn &ge; datetime(2018-06-05T18:09:58.907Z) and datetimeColumn &le; datetime(2018-06-05T20:09:58.907Z)
Or build your own conditionals using these built-in variables which just return the values:
- $__timeFrom -&gt; datetime(2018-06-05T18:09:58.907Z)
- $__timeTo -&gt; datetime(2018-06-05T20:09:58.907Z)
- $__interval -&gt; 5m
</pre>
</div>
</div>