Skip to content

Commit

Permalink
Merge pull request #565 from rstudio/dotnomad/show-config-settings
Browse files Browse the repository at this point in the history
Show current config settings existing deployment
  • Loading branch information
dotNomad authored Dec 14, 2023
2 parents d31435e + 901e287 commit 98286f8
Showing 1 changed file with 16 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
:subtitle="deployment.configurationName"
>
<ConfigSettings
:config="deployment"
v-if="defaultConfig"
:config="defaultConfig"
/>
</DeploymentSection>
<DeploymentSection
Expand All @@ -28,7 +29,7 @@
import { ref, computed, watch } from 'vue';
import { useRoute } from 'vue-router';

import { useApi } from 'src/api';
import { Configuration, ConfigurationError, useApi } from 'src/api';
import { Deployment, isDeploymentError } from 'src/api/types/deployments';

import ConfigSettings from 'src/components/config/ConfigSettings.vue';
Expand All @@ -41,6 +42,8 @@ const api = useApi();

const deployment = ref<Deployment>();

const configurations = ref<Array<Configuration | ConfigurationError>>([]);

const deploymentName = computed(():string => {
// route param can be either string | string[]
if (Array.isArray(route.params.name)) {
Expand Down Expand Up @@ -70,6 +73,17 @@ const getDeployment = async() => {
}
};

const defaultConfig = computed(() => {
return configurations.value.find((c) => c.configurationName === 'default');
});

async function getConfigurations() {
const response = await api.configurations.getAll();
configurations.value = response.data;
}

getConfigurations();

watch(
() => route.params,
() => {
Expand Down

0 comments on commit 98286f8

Please sign in to comment.