mirror of
https://github.com/XShengTech/MEGREZ.git
synced 2026-01-14 09:07:16 +08:00
[Feat] ✨ Unified Entrance of Web Services
This commit is contained in:
parent
1a3a126388
commit
67d7707ba3
@ -70,12 +70,11 @@
|
||||
:href="'http://' + data.code_server_address" target="_blank" v-tooltip.top="'VSCode Web'" />
|
||||
<Button v-else icon="pi pi-code" aria-label="Filter" v-tooltip.top="'VSCode Web'" disabled />
|
||||
<Button v-if="data.status == statusRunning" severity="info" icon="pi pi-inbox" aria-label="Filter" as="a"
|
||||
:href="'http://' + data.jupyter_address + '/lab'" target="_blank" v-tooltip.top="'Jupyter Lab'" />
|
||||
:href="'http://' + data.jupyter_address" target="_blank" v-tooltip.top="'Jupyter Lab'" />
|
||||
<Button v-else severity="info" icon="pi pi-inbox" aria-label="Filter" v-tooltip.top="'Jupyter Lab'"
|
||||
disabled />
|
||||
<Button v-if="data.status == statusRunning" severity="contrast" icon="pi pi-chart-bar" as="a"
|
||||
:href="'http://' + data.grafana_address + '/public-dashboards/2c510f203876465ba76617510ce3e219'"
|
||||
target="_blank" v-tooltip.top="'监控'" />
|
||||
:href="'http://' + data.grafana_address" target="_blank" v-tooltip.top="'监控'" />
|
||||
<Button v-else severity="contrast" icon="pi pi-chart-bar" v-tooltip.top="'监控'" disabled />
|
||||
<Button v-if="!isAdmin" icon="pi pi-ellipsis-h" severity="secondary" aria-label="Bookmark"
|
||||
@click="showMenu($event, data)" />
|
||||
|
||||
@ -74,12 +74,11 @@
|
||||
:href="'http://' + data.code_server_address" target="_blank" v-tooltip.top="'VSCode Web'" />
|
||||
<Button v-else icon="pi pi-code" aria-label="Filter" v-tooltip.top="'VSCode Web'" disabled />
|
||||
<Button v-if="data.status == statusRunning" severity="info" icon="pi pi-inbox" aria-label="Filter" as="a"
|
||||
:href="'http://' + data.jupyter_address + '/lab'" target="_blank" v-tooltip.top="'Jupyter Lab'" />
|
||||
:href="'http://' + data.jupyter_address" target="_blank" v-tooltip.top="'Jupyter Lab'" />
|
||||
<Button v-else severity="info" icon="pi pi-inbox" aria-label="Filter" v-tooltip.top="'Jupyter Lab'"
|
||||
disabled />
|
||||
<Button v-if="data.status == statusRunning" severity="contrast" icon="pi pi-chart-bar" as="a"
|
||||
:href="'http://' + data.grafana_address + '/public-dashboards/2c510f203876465ba76617510ce3e219'"
|
||||
target="_blank" v-tooltip.top="'监控'" />
|
||||
:href="'http://' + data.grafana_address" target="_blank" v-tooltip.top="'监控'" />
|
||||
<Button v-else severity="contrast" icon="pi pi-chart-bar" v-tooltip.top="'监控'" disabled />
|
||||
<Button icon="pi pi-ellipsis-h" severity="secondary" aria-label="Bookmark"
|
||||
@click="showMenu($event, data)" />
|
||||
@ -126,13 +125,13 @@
|
||||
</Fieldset>
|
||||
<Fieldset legend="GPU">
|
||||
<span v-if="instanceDetail.gpu_count !== 0">{{ instanceDetail.gpu_type }} * {{ instanceDetail.gpu_count
|
||||
}}</span>
|
||||
}}</span>
|
||||
<span v-else>无卡模式</span>
|
||||
</Fieldset>
|
||||
<div class="flex flex-col md:flex-row gap-4">
|
||||
<Fieldset class="flex flex-wrap gap-2 w-full" legend="CPU">
|
||||
<span v-if="instanceDetail.gpu_count !== 0">{{ instanceDetail.cpu_count_per_gpu * instanceDetail.gpu_count
|
||||
}}
|
||||
}}
|
||||
核</span>
|
||||
<span v-else>1 核</span>
|
||||
</Fieldset>
|
||||
|
||||
@ -64,9 +64,9 @@ func Create(instance *models.Instances) (containerName, volumeName string, err e
|
||||
|
||||
instance.SshAddress = server.IP + ":" + portBindings["22"]
|
||||
instance.TensorBoardAddress = server.IP + ":" + portBindings["6007"]
|
||||
instance.JupyterAddress = server.IP + ":" + portBindings["8888"]
|
||||
instance.GrafanaAddress = server.IP + ":" + portBindings["3000"]
|
||||
instance.CodeServerAddress = server.IP + ":" + portBindings["8080"]
|
||||
instance.JupyterAddress = server.IP + ":" + portBindings["80"] + "/jupyter"
|
||||
instance.GrafanaAddress = server.IP + ":" + portBindings["80"] + "/monitor/public-dashboards/2c510f203876465ba76617510ce3e219"
|
||||
instance.CodeServerAddress = server.IP + ":" + portBindings["80"] + "/code-server/"
|
||||
|
||||
instance.Status = 0
|
||||
result = database.DB.Save(&instance)
|
||||
|
||||
@ -40,10 +40,8 @@ func createInstance(ip string, port int, apikey string,
|
||||
Memory: strconv.Itoa(memorySize) + "GB",
|
||||
ContainerPorts: []string{
|
||||
"22", // SSH
|
||||
"80", // Nginx
|
||||
"6007", // TensorBoard
|
||||
"8888", // Jupyter Notebook
|
||||
"3000", // Grafana
|
||||
"8080", // Code-Server
|
||||
"34567", // Custom Port
|
||||
},
|
||||
Env: []string{
|
||||
|
||||
@ -104,8 +104,9 @@ func Patch(instance *models.Instances, gpuCount, volumeSize int, cpuOnly bool) (
|
||||
|
||||
instance.SshAddress = server.IP + ":" + portBindings["22"]
|
||||
instance.TensorBoardAddress = server.IP + ":" + portBindings["6007"]
|
||||
instance.JupyterAddress = server.IP + ":" + portBindings["8888"]
|
||||
instance.GrafanaAddress = server.IP + ":" + portBindings["3000"]
|
||||
instance.JupyterAddress = server.IP + ":" + portBindings["80"] + "/jupyter"
|
||||
instance.GrafanaAddress = server.IP + ":" + portBindings["80"] + "/monitor/public-dashboards/2c510f203876465ba76617510ce3e219"
|
||||
instance.CodeServerAddress = server.IP + ":" + portBindings["80"] + "/code-server/"
|
||||
|
||||
instance.CpuOnly = true
|
||||
instance.GpuCount = 0
|
||||
@ -148,9 +149,9 @@ func Patch(instance *models.Instances, gpuCount, volumeSize int, cpuOnly bool) (
|
||||
|
||||
instance.SshAddress = server.IP + ":" + portBindings["22"]
|
||||
instance.TensorBoardAddress = server.IP + ":" + portBindings["6007"]
|
||||
instance.JupyterAddress = server.IP + ":" + portBindings["8888"]
|
||||
instance.GrafanaAddress = server.IP + ":" + portBindings["3000"]
|
||||
instance.CodeServerAddress = server.IP + ":" + portBindings["8080"]
|
||||
instance.JupyterAddress = server.IP + ":" + portBindings["80"] + "/jupyter"
|
||||
instance.GrafanaAddress = server.IP + ":" + portBindings["80"] + "/monitor/public-dashboards/2c510f203876465ba76617510ce3e219"
|
||||
instance.CodeServerAddress = server.IP + ":" + portBindings["80"] + "/code-server/"
|
||||
|
||||
instance.CpuOnly = false
|
||||
instance.GpuCount = gpuCount
|
||||
|
||||
@ -57,9 +57,9 @@ func Restart(instance *models.Instances) (err error) {
|
||||
|
||||
instance.SshAddress = server.IP + ":" + portBindings["22"]
|
||||
instance.TensorBoardAddress = server.IP + ":" + portBindings["6007"]
|
||||
instance.JupyterAddress = server.IP + ":" + portBindings["8888"]
|
||||
instance.GrafanaAddress = server.IP + ":" + portBindings["3000"]
|
||||
instance.CodeServerAddress = server.IP + ":" + portBindings["8080"]
|
||||
instance.JupyterAddress = server.IP + ":" + portBindings["80"] + "/jupyter"
|
||||
instance.GrafanaAddress = server.IP + ":" + portBindings["80"] + "/monitor/public-dashboards/2c510f203876465ba76617510ce3e219"
|
||||
instance.CodeServerAddress = server.IP + ":" + portBindings["80"] + "/code-server/"
|
||||
|
||||
instance.Status = models.InstanceStatusRunning
|
||||
result = database.DB.Save(&instance)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user