mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
ux(): added style guide page
This commit is contained in:
@@ -186,6 +186,11 @@ function setupAngularRoutes($routeProvider, $locationProvider) {
|
||||
.when('/global-alerts', {
|
||||
templateUrl: 'public/app/features/dashboard/partials/globalAlerts.html',
|
||||
})
|
||||
.when('/styleguide', {
|
||||
controller: 'StyleGuideCtrl',
|
||||
controllerAs: 'ctrl',
|
||||
templateUrl: 'public/app/features/styleguide/styleguide.html',
|
||||
})
|
||||
.otherwise({
|
||||
templateUrl: 'public/app/partials/error.html',
|
||||
controller: 'ErrorCtrl'
|
||||
|
||||
@@ -10,4 +10,5 @@ define([
|
||||
'./profile/profileCtrl',
|
||||
'./profile/changePasswordCtrl',
|
||||
'./profile/selectOrgCtrl',
|
||||
'./styleguide/styleguide',
|
||||
], function () {});
|
||||
|
||||
22
public/app/features/styleguide/styleguide.html
Normal file
22
public/app/features/styleguide/styleguide.html
Normal file
@@ -0,0 +1,22 @@
|
||||
<navbar icon="fa fa-fw fa-adjust" title="Style Guide">
|
||||
</navbar>
|
||||
|
||||
<div class="page-container">
|
||||
<div class="page-header">
|
||||
<h1>Style Guide</h1>
|
||||
|
||||
<a class="btn btn-success" ng-click="ctrl.switchTheme()">
|
||||
<i class="fa fa-random"></i>
|
||||
Switch theme
|
||||
</a>
|
||||
</div>
|
||||
|
||||
|
||||
<h3 class="page-heading">Colors</h3>
|
||||
<ul>
|
||||
<li class="style-guide-color-card">
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
14
public/app/features/styleguide/styleguide.ts
Normal file
14
public/app/features/styleguide/styleguide.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
|
||||
import coreModule from 'app/core/core_module';
|
||||
import config from 'app/core/config';
|
||||
|
||||
class StyleGuideCtrl {
|
||||
|
||||
switchTheme() {
|
||||
var other = config.bootData.user.lightTheme ? 'dark' : 'light';
|
||||
window.location.href = config.appSubUrl + '/styleguide?theme=' + other;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
coreModule.controller('StyleGuideCtrl', StyleGuideCtrl);
|
||||
Reference in New Issue
Block a user