Changeset View
Changeset View
Standalone View
Standalone View
swh/web/assets/src/bundles/save/index.js
/** | /** | ||||
* Copyright (C) 2018-2019 The Software Heritage developers | * Copyright (C) 2018-2020 The Software Heritage developers | ||||
* See the AUTHORS file at the top-level directory of this distribution | * See the AUTHORS file at the top-level directory of this distribution | ||||
* License: GNU Affero General Public License version 3, or any later version | * License: GNU Affero General Public License version 3, or any later version | ||||
* See top-level LICENSE file for more information | * See top-level LICENSE file for more information | ||||
*/ | */ | ||||
import {handleFetchError, csrfPost, isGitRepoUrl, htmlAlert, removeUrlFragment} from 'utils/functions'; | import {handleFetchError, csrfPost, isGitRepoUrl, htmlAlert, removeUrlFragment} from 'utils/functions'; | ||||
import {swhSpinnerSrc} from 'utils/constants'; | import {swhSpinnerSrc} from 'utils/constants'; | ||||
import {validate} from 'validate.js'; | import {validate} from 'validate.js'; | ||||
▲ Show 20 Lines • Show All 85 Lines • ▼ Show 20 Lines | saveRequestsTable = $('#swh-origin-save-requests') | ||||
data: 'save_request_status', | data: 'save_request_status', | ||||
name: 'status' | name: 'status' | ||||
}, | }, | ||||
{ | { | ||||
data: 'save_task_status', | data: 'save_task_status', | ||||
name: 'loading_task_status', | name: 'loading_task_status', | ||||
render: (data, type, row) => { | render: (data, type, row) => { | ||||
if (data === 'succeed' && row.visit_date) { | if (data === 'succeed' && row.visit_date) { | ||||
let browseOriginUrl = Urls.browse_origin(row.origin_url); | let browseOriginUrl = `${Urls.browse_origin()}?origin_url=${row.origin_url}`; | ||||
browseOriginUrl += `visit/${row.visit_date}/`; | browseOriginUrl += `visit/${row.visit_date}/`; | ||||
return `<a href="${browseOriginUrl}">${data}</a>`; | return `<a href="${browseOriginUrl}">${data}</a>`; | ||||
} | } | ||||
return data; | return data; | ||||
} | } | ||||
} | } | ||||
], | ], | ||||
scrollY: '50vh', | scrollY: '50vh', | ||||
▲ Show 20 Lines • Show All 179 Lines • Show Last 20 Lines |