+
{
"instanceConnect": "/projects/p/instances/i/connect",
"instanceMetrics": "/projects/p/instances/i/metrics",
"instanceNetworking": "/projects/p/instances/i/networking",
+ "instanceSettings": "/projects/p/instances/i/settings",
"instanceStorage": "/projects/p/instances/i/storage",
"instances": "/projects/p/instances",
"instancesNew": "/projects/p/instances-new",
diff --git a/app/util/path-builder.ts b/app/util/path-builder.ts
index 5b5ab823f9..d227511a18 100644
--- a/app/util/path-builder.ts
+++ b/app/util/path-builder.ts
@@ -44,6 +44,7 @@ export const pb = {
instanceConnect: (params: PP.Instance) => `${instanceBase(params)}/connect`,
instanceNetworking: (params: PP.Instance) => `${instanceBase(params)}/networking`,
serialConsole: (params: PP.Instance) => `${instanceBase(params)}/serial-console`,
+ instanceSettings: (params: PP.Instance) => `${instanceBase(params)}/settings`,
disksNew: (params: PP.Project) => `${projectBase(params)}/disks-new`,
disks: (params: PP.Project) => `${projectBase(params)}/disks`,
diff --git a/mock-api/instance.ts b/mock-api/instance.ts
index c274e1f16c..3f93b6a4f5 100644
--- a/mock-api/instance.ts
+++ b/mock-api/instance.ts
@@ -42,6 +42,8 @@ const failedInstance: Json = {
hostname: 'oxide.com',
project_id: project.id,
run_state: 'failed',
+ auto_restart_cooldown_expiration: new Date(Date.now() + 5 * 60 * 1000).toISOString(), // 5 mins in the future
+ time_last_auto_restarted: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString(), // one month ago
}
const startingInstance: Json = {
diff --git a/mock-api/msw/handlers.ts b/mock-api/msw/handlers.ts
index 376ad49714..36e0e7a263 100644
--- a/mock-api/msw/handlers.ts
+++ b/mock-api/msw/handlers.ts
@@ -584,7 +584,23 @@ export const handlers = makeHandlers({
return json(newInstance, { status: 201 })
},
- instanceView: ({ path, query }) => lookup.instance({ ...path, ...query }),
+ instanceView: ({ path, query }) => {
+ const instance = lookup.instance({ ...path, ...query })
+
+ // if empty uses default auto-restart behaviour
+ // if set, is based off of the policy
+ // https://github.com/oxidecomputer/omicron/blob/f63ed095e744fb8d2383fda6799eb0b2d6dfbd3c/nexus/db-queries/src/db/datastore/instance.rs#L228C26-L239
+ if (instance.auto_restart_policy === 'never') {
+ instance.auto_restart_enabled = false
+ } else if (
+ instance.auto_restart_policy === 'best_effort' ||
+ !instance.auto_restart_policy // included for posterity but this has to be set in the mock data anyway
+ ) {
+ instance.auto_restart_enabled = true
+ }
+
+ return instance
+ },
instanceUpdate({ path, query, body }) {
const instance = lookup.instance({ ...path, ...query })
@@ -613,6 +629,10 @@ export const handlers = makeHandlers({
instance.boot_disk_id = undefined
}
+ if (body.auto_restart_policy !== undefined) {
+ instance.auto_restart_policy = body.auto_restart_policy
+ }
+
// always present on the body, always set them
instance.ncpus = body.ncpus
instance.memory = body.memory
diff --git a/package-lock.json b/package-lock.json
index f646265b4d..a56de5dfb0 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -12,7 +12,7 @@
"dependencies": {
"@floating-ui/react": "^0.26.23",
"@headlessui/react": "^2.2.0",
- "@oxide/design-system": "^3.0.0",
+ "@oxide/design-system": "^2.1.0",
"@radix-ui/react-accordion": "^1.2.0",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-focus-guards": "1.0.1",
@@ -1547,9 +1547,9 @@
"license": "MIT"
},
"node_modules/@oxide/design-system": {
- "version": "3.0.0",
- "resolved": "https://registry.npmjs.org/@oxide/design-system/-/design-system-3.0.0.tgz",
- "integrity": "sha512-GB35TIZXD4zEjQjoYKvJqBPuuABD76QJr1pP+huJHKixrQY1UO83DZeqSNBQ6ifdBTTMqLtgHDxcroHLM7BXTQ==",
+ "version": "2.1.0",
+ "resolved": "https://registry.npmjs.org/@oxide/design-system/-/design-system-2.1.0.tgz",
+ "integrity": "sha512-aQpD+vZQIgkBzi9jcX35m1z1milAf4PzewVH9FlMMGniwUNCXw6G6KT8t3Unnwy3egUQ/qvhdQqm9VSdoDQwsA==",
"license": "MPL 2.0",
"dependencies": {
"@floating-ui/react": "^0.25.1",
diff --git a/package.json b/package.json
index a1ed316fb4..0544ff0e31 100644
--- a/package.json
+++ b/package.json
@@ -34,7 +34,7 @@
"dependencies": {
"@floating-ui/react": "^0.26.23",
"@headlessui/react": "^2.2.0",
- "@oxide/design-system": "^3.0.0",
+ "@oxide/design-system": "^2.1.0",
"@radix-ui/react-accordion": "^1.2.0",
"@radix-ui/react-dialog": "^1.0.5",
"@radix-ui/react-focus-guards": "1.0.1",
diff --git a/tailwind.config.ts b/tailwind.config.ts
index 4203962afd..e68c978a34 100644
--- a/tailwind.config.ts
+++ b/tailwind.config.ts
@@ -61,6 +61,9 @@ export default {
transparent: 'transparent',
current: 'currentColor',
},
+ animation: {
+ 'spin-slow': 'spin 5s linear infinite',
+ },
},
plugins: [
plugin(({ addVariant, addUtilities }) => {