mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
move: moved styleguide to admin
This commit is contained in:
28
public/app/features/admin/StyleGuideCtrl.ts
Normal file
28
public/app/features/admin/StyleGuideCtrl.ts
Normal file
@@ -0,0 +1,28 @@
|
||||
import config from 'app/core/config';
|
||||
|
||||
export default class StyleGuideCtrl {
|
||||
theme: string;
|
||||
buttonNames = ['primary', 'secondary', 'inverse', 'success', 'warning', 'danger'];
|
||||
buttonSizes = ['btn-small', '', 'btn-large'];
|
||||
buttonVariants = ['-'];
|
||||
navModel: any;
|
||||
|
||||
/** @ngInject */
|
||||
constructor(private $routeParams, private backendSrv, navModelSrv) {
|
||||
this.navModel = navModelSrv.getNav('cfg', 'admin', 'styleguide', 1);
|
||||
this.theme = config.bootData.user.lightTheme ? 'light' : 'dark';
|
||||
}
|
||||
|
||||
switchTheme() {
|
||||
this.$routeParams.theme = this.theme === 'dark' ? 'light' : 'dark';
|
||||
|
||||
const cmd = {
|
||||
theme: this.$routeParams.theme,
|
||||
};
|
||||
|
||||
this.backendSrv.put('/api/user/preferences', cmd).then(() => {
|
||||
window.location.href = window.location.href;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ import AdminListUsersCtrl from './AdminListUsersCtrl';
|
||||
import AdminEditUserCtrl from './AdminEditUserCtrl';
|
||||
import AdminListOrgsCtrl from './AdminListOrgsCtrl';
|
||||
import AdminEditOrgCtrl from './AdminEditOrgCtrl';
|
||||
import StyleGuideCtrl from './StyleGuideCtrl';
|
||||
|
||||
import coreModule from 'app/core/core_module';
|
||||
|
||||
@@ -29,9 +30,8 @@ class AdminHomeCtrl {
|
||||
|
||||
coreModule.controller('AdminListUsersCtrl', AdminListUsersCtrl);
|
||||
coreModule.controller('AdminEditUserCtrl', AdminEditUserCtrl);
|
||||
|
||||
coreModule.controller('AdminListOrgsCtrl', AdminListOrgsCtrl);
|
||||
coreModule.controller('AdminEditOrgCtrl', AdminEditOrgCtrl);
|
||||
|
||||
coreModule.controller('AdminSettingsCtrl', AdminSettingsCtrl);
|
||||
coreModule.controller('AdminHomeCtrl', AdminHomeCtrl);
|
||||
coreModule.controller('StyleGuideCtrl', StyleGuideCtrl);
|
||||
|
||||
27
public/app/features/admin/partials/styleguide.html
Normal file
27
public/app/features/admin/partials/styleguide.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<page-header model="ctrl.navModel"></page-header>
|
||||
|
||||
<div class="page-container page-body">
|
||||
|
||||
<h3 class="page-heading">Buttons</h3>
|
||||
|
||||
<div class="tab-pane">
|
||||
<div ng-repeat="variant in ctrl.buttonVariants" class="row">
|
||||
<div ng-repeat="btnSize in ctrl.buttonSizes" class="style-guide-button-list p-a-2 col-md-4">
|
||||
<button ng-repeat="buttonName in ctrl.buttonNames" class="btn btn{{variant}}{{buttonName}} {{btnSize}}">
|
||||
btn{{variant}}{{buttonName}}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h3 class="page-heading">Forms</h3>
|
||||
|
||||
<div class="gf-form-inline">
|
||||
<div class="gf-form">
|
||||
<label class="gf-form-label">Label</label>
|
||||
<input type="text" class="gf-form-input" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user