Skip to content

Commit

Permalink
Include install instructions on manage page for cmd tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
wleightond committed Dec 13, 2024
1 parent 0435113 commit 9fcbee3
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 33 deletions.
28 changes: 1 addition & 27 deletions frontend_vue/src/components/tokens/cmd/ActivatedToken.vue
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
<template>
<TokenDisplay :token-data="tokenData" />
<base-message-box
class="mt-24"
variant="info"
message="Once installed (with admin permissions) you'll get an alert whenever someone
(or someone's code) runs your sensitive process."
/>
<p class="mt-24 text-sm">
It will automatically provide the command used, computer the command ran on,
and the user invoking the command.
</p>
<p class="mt-16 text-sm"></p>
<base-message-box
class="mt-24"
variant="warning"
message="In order to ensure that the token fires for both 32-bit and 64-bit
executables, we suggest installing by running the following commands:"
/>
<BaseCodeSnippet
class="mt-16"
lang="bash"
:code="recommendedReg"
></BaseCodeSnippet>
<TokenDisplay :token-data="tokenData" :displayInfoBox="true"/>
</template>

<script setup lang="ts">
Expand All @@ -37,8 +15,4 @@ const tokenData = ref({
token: props.tokenData.token || '',
auth: props.tokenData.auth_token || '',
});
const recommendedReg = ref(
'reg import FILENAME /reg:64 \nreg import FILENAME /reg:32'
);
</script>
8 changes: 2 additions & 6 deletions frontend_vue/src/components/tokens/cmd/ManageToken.vue
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
<template>
<div v-if="!tokenData">Error loading</div>
<TokenDisplay
v-else
:token-data="tokenData"
/>
<TokenDisplay :token-data="tokenData" :displayInfoBox="false"/>
</template>

<script lang="ts" setup>
<script setup lang="ts">
import { ref } from 'vue';
import TokenDisplay from './TokenDisplay.vue';
import type { ManageTokenBackendType } from '@/components/tokens/types.ts';
Expand Down
31 changes: 31 additions & 0 deletions frontend_vue/src/components/tokens/cmd/TokenDisplay.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,34 @@
>Download your MS registry file</base-button
>
</div>
<div v-if="displayInfoBox">
<base-message-box
class="mt-24"
variant="info"
message="Once installed (with admin permissions) you'll get an alert whenever someone
(or someone's code) runs your sensitive process."
/>
<p class="mt-24 text-sm">
It will automatically provide the command used, computer the command ran on,
and the user invoking the command.
</p>
<p class="mt-16 text-sm"></p>
</div>
<base-message-box
class="mt-24"
variant="warning"
message="In order to ensure that the token fires for both 32-bit and 64-bit
executables, we suggest installing by running the following commands:"
/>
<BaseCodeSnippet
class="mt-16"
lang="bash"
:code="recommendedReg"
></BaseCodeSnippet>
</template>

<script setup lang="ts">
import { ref } from 'vue';
import { downloadAsset } from '@/api/main';
type CMDDataType = {
Expand All @@ -18,6 +43,7 @@ type CMDDataType = {
const props = defineProps<{
tokenData: CMDDataType;
displayInfoBox: boolean;
}>();
async function handleDownloadMSregistryFile() {
Expand All @@ -35,4 +61,9 @@ async function handleDownloadMSregistryFile() {
console.log('Download ready');
}
}
const recommendedReg = ref(
'reg import FILENAME /reg:64 \nreg import FILENAME /reg:32'
);
</script>

0 comments on commit 9fcbee3

Please sign in to comment.