Commit 2e4a1f31 by Torkel Ödegaard

ux: final fixes to new datasource page

parent 8e285962
...@@ -82,21 +82,22 @@ export function loadDataSources(): ThunkResult<void> { ...@@ -82,21 +82,22 @@ export function loadDataSources(): ThunkResult<void> {
export function addDataSource(plugin: Plugin): ThunkResult<void> { export function addDataSource(plugin: Plugin): ThunkResult<void> {
return async (dispatch, getStore) => { return async (dispatch, getStore) => {
let dataSources = getStore().dataSources.dataSources; await dispatch(loadDataSources());
if (dataSources.length === 0) { const dataSources = getStore().dataSources.dataSources;
dispatch(loadDataSources());
dataSources = getStore().dataSources.dataSources; const newInstance = {
} name: plugin.name,
type: plugin.id,
let name = plugin.name; access: 'proxy',
isDefault: dataSources.length === 0,
};
if (nameExits(dataSources, name)) { if (nameExits(dataSources, newInstance.name)) {
name = findNewName(dataSources, name); newInstance.name = findNewName(dataSources, newInstance.name);
} }
const result = await getBackendSrv().post('/api/datasources', { name: name, type: plugin.id, access: 'proxy' }); const result = await getBackendSrv().post('/api/datasources', newInstance);
dispatch(updateLocation({ path: `/datasources/edit/${result.id}` })); dispatch(updateLocation({ path: `/datasources/edit/${result.id}` }));
}; };
} }
......
...@@ -120,7 +120,7 @@ $code-tag-border: lighten($code-tag-bg, 2%); ...@@ -120,7 +120,7 @@ $code-tag-border: lighten($code-tag-bg, 2%);
// cards // cards
$card-background: linear-gradient(135deg, #2f2f32, #262628); $card-background: linear-gradient(135deg, #2f2f32, #262628);
$card-background-hover: linear-gradient(135deg, $dark-3, $dark-2); $card-background-hover: linear-gradient(135deg, #343436, #262628);
$card-shadow: -1px -1px 0 0 hsla(0, 0%, 100%, 0.1), 1px 1px 0 0 rgba(0, 0, 0, 0.3); $card-shadow: -1px -1px 0 0 hsla(0, 0%, 100%, 0.1), 1px 1px 0 0 rgba(0, 0, 0, 0.3);
// Lists // Lists
......
...@@ -28,10 +28,11 @@ ...@@ -28,10 +28,11 @@
cursor: pointer; cursor: pointer;
background: $card-background; background: $card-background;
box-shadow: $card-shadow; box-shadow: $card-shadow;
color: $headings-color; color: $text-color;
&:hover { &:hover {
background: $card-background-hover; background: $card-background-hover;
color: $text-color-strong;
} }
} }
......
...@@ -191,6 +191,7 @@ ...@@ -191,6 +191,7 @@
.card-item-wrapper { .card-item-wrapper {
padding: 0; padding: 0;
width: 100%; width: 100%;
margin-bottom: 3px;
} }
.card-item-wrapper--clickable { .card-item-wrapper--clickable {
...@@ -198,7 +199,6 @@ ...@@ -198,7 +199,6 @@
} }
.card-item { .card-item {
border-bottom: 3px solid $page-bg;
border-radius: 2px; border-radius: 2px;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment